GSD-2024-1631

Vulnerability from gsd - Updated: 2024-02-20 06:02
Details
Impact The library offers a function to generate an ed25519 key pair via Ed25519KeyIdentity.generate with an optional param to provide a 32 byte seed value, which will then be used as the secret key. When no seed value is provided, it is expected that the library generates the secret key using secure randomness. However, a recent change broke this guarantee and uses an insecure seed for key pair generation. Since the private key of this identity (535yc-uxytb-gfk7h-tny7p-vjkoe-i4krp-3qmcl-uqfgr-cpgej-yqtjq-rqe) is compromised, one could lose funds associated with the principal on ledgers or lose access to a canister where this principal is the controller. Users are asked to take proactive measures mentioned below in Workarounds:Users to protect their assets. Patches Patch for the vulnerability is available in v1.0.1 for all the packages listed in the advisory. Please upgrade and deploy your canisters immediately. Workarounds Developers The recommended fix is to upgrade the package to the patched version. If that is not possible, there are couple of workarounds to handle the insecure key generation. * Invoking the function as Ed25519KeyIdentity.generate(null) would fix the broken conditional evaluation and force the function to generate a securely random seed. However, this is not guaranteed to work for future upgrades. * Passing a securely generated randomness as a seed to Ed25519KeyIdentity.generate would force the library to use it as the seed to generate the key pair. Users Removing a controller of a canister if it's the affected principal For all canisters you control, fetch the controllers of the canisters using dfx canister info --ic <CANISTER> If you see the principal 535yc-uxytb-gfk7h-tny7p-vjkoe-i4krp-3qmcl-uqfgr-cpgej-yqtjq-rqe as one of the controllers, follow the steps below dfx identity whoami # record CURRENT_IDENTITY dfx identity new <NEW_IDENTITY_NAME> dfx identity use <NEW_IDENTITY_NAME> dfx identity get-principal <NEW_IDENTITY_NAME> # record NEW_IDENTITY_PRINCIPAL dfx identity use <CURRENT_IDENTITY> dfx canister update-settings --ic <CANISTER> --add-controller <NEW_IDENTITY_PRINCIPAL> dfx canister update-settings --ic <CANISTER> --remove-controller `535yc-uxytb-gfk7h-tny7p-vjkoe-i4krp-3qmcl-uqfgr-cpgej-yqtjq-rqe` For more details on canister management, please visit here https://internetcomputer.org/docs/current/tutorials/developer-journey/level-1/1.6-managing-canisters Checking funds on wallets / ledgers If you have funds on ledgers using a browser wallet, please check if the account principal matches 535yc-uxytb-gfk7h-tny7p-vjkoe-i4krp-3qmcl-uqfgr-cpgej-yqtjq-rqe. If it does, please create a new account and transfer the funds to the new account immediately.
Aliases

{
  "gsd": {
    "metadata": {
      "exploitCode": "unknown",
      "remediation": "unknown",
      "reportConfidence": "confirmed",
      "type": "vulnerability"
    },
    "osvSchema": {
      "aliases": [
        "CVE-2024-1631"
      ],
      "details": "Impact\nThe library offers a function to generate an ed25519 key pair via Ed25519KeyIdentity.generate with an optional param to provide a 32 byte seed value, which will then be used as the secret key. When no seed value is provided, it is expected that the library generates the secret key using secure randomness. However, a recent change broke this guarantee and uses an insecure seed for key pair generation.\n\n\nSince the private key of this identity (535yc-uxytb-gfk7h-tny7p-vjkoe-i4krp-3qmcl-uqfgr-cpgej-yqtjq-rqe)\n is compromised, one could lose funds associated with the principal on \nledgers or lose access to a canister where this principal is the \ncontroller. Users are asked to take proactive measures mentioned below \nin Workarounds:Users to protect their assets.\n\n\nPatches\nPatch for the vulnerability is available in v1.0.1 for all the packages listed in the advisory. Please upgrade and deploy your canisters immediately.\n\n\nWorkarounds\nDevelopers\nThe recommended fix is to upgrade the package to the \npatched version. If that is not possible, there are couple of \nworkarounds to handle the insecure key generation.\n\n\n\n  *  Invoking the function as Ed25519KeyIdentity.generate(null)\n would fix the broken conditional evaluation and force the function to \ngenerate a securely random seed. However, this is not guaranteed to work\n for future upgrades.\n\n  *  Passing a securely generated randomness as a seed to Ed25519KeyIdentity.generate would force the library to use it as the seed to generate the key pair.\n\n\nUsers\nRemoving a controller of a canister if it\u0027s the affected principal\nFor all canisters you control, fetch the controllers of the canisters using\n\n\ndfx canister info --ic \u003cCANISTER\u003e\n\n\n    \n\n\n\nIf you see the principal 535yc-uxytb-gfk7h-tny7p-vjkoe-i4krp-3qmcl-uqfgr-cpgej-yqtjq-rqe as one of the controllers, follow the steps below\n\n\ndfx identity whoami # record CURRENT_IDENTITY\n\ndfx identity new \u003cNEW_IDENTITY_NAME\u003e \ndfx identity use \u003cNEW_IDENTITY_NAME\u003e \ndfx identity get-principal \u003cNEW_IDENTITY_NAME\u003e # record NEW_IDENTITY_PRINCIPAL\n\ndfx identity use \u003cCURRENT_IDENTITY\u003e\ndfx canister update-settings --ic \u003cCANISTER\u003e --add-controller \u003cNEW_IDENTITY_PRINCIPAL\u003e\ndfx canister update-settings --ic \u003cCANISTER\u003e --remove-controller `535yc-uxytb-gfk7h-tny7p-vjkoe-i4krp-3qmcl-uqfgr-cpgej-yqtjq-rqe`\n\n\n    \n\n\n\nFor more details on canister management, please visit  here https://internetcomputer.org/docs/current/tutorials/developer-journey/level-1/1.6-managing-canisters \n\n\nChecking funds on wallets /  ledgers\nIf you have funds on ledgers using a browser wallet, please check if the account principal matches 535yc-uxytb-gfk7h-tny7p-vjkoe-i4krp-3qmcl-uqfgr-cpgej-yqtjq-rqe. If it does, please create a new account and transfer the funds to the new account immediately.\n\n\n",
      "id": "GSD-2024-1631",
      "modified": "2024-02-20T06:02:27.973236Z",
      "schema_version": "1.4.0"
    }
  },
  "namespaces": {
    "cve.org": {
      "CVE_data_meta": {
        "ASSIGNER": "cve@mitre.org",
        "ID": "CVE-2024-1631",
        "STATE": "PUBLIC"
      },
      "affects": {
        "vendor": {
          "vendor_data": [
            {
              "product": {
                "product_data": [
                  {
                    "product_name": "agent-js",
                    "version": {
                      "version_data": [
                        {
                          "version_affected": "\u003c",
                          "version_name": "v0.20.0-beta.0",
                          "version_value": "v1.0.1"
                        }
                      ]
                    }
                  }
                ]
              },
              "vendor_name": "Internet Computer"
            }
          ]
        }
      },
      "data_format": "MITRE",
      "data_type": "CVE",
      "data_version": "4.0",
      "description": {
        "description_data": [
          {
            "lang": "eng",
            "value": "Impact: The library offers a function to generate an ed25519 key pair via Ed25519KeyIdentity.generate with an optional param to provide a 32 byte seed value, which will then be used as the secret key. When no seed value is provided, it is expected that the library generates the secret key using secure randomness. However, a recent change broke this guarantee and uses an insecure seed for key pair generation. Since the private key of this identity (535yc-uxytb-gfk7h-tny7p-vjkoe-i4krp-3qmcl-uqfgr-cpgej-yqtjq-rqe) is compromised, one could lose funds associated with the principal on ledgers or lose access to a canister where this principal is the controller. \n"
          }
        ]
      },
      "generator": {
        "engine": "Vulnogram 0.1.0-dev"
      },
      "impact": {
        "cvss": [
          {
            "attackComplexity": "LOW",
            "attackVector": "NETWORK",
            "availabilityImpact": "NONE",
            "baseScore": 9.1,
            "baseSeverity": "CRITICAL",
            "confidentialityImpact": "HIGH",
            "integrityImpact": "HIGH",
            "privilegesRequired": "NONE",
            "scope": "UNCHANGED",
            "userInteraction": "NONE",
            "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N",
            "version": "3.1"
          }
        ]
      },
      "problemtype": {
        "problemtype_data": [
          {
            "description": [
              {
                "cweId": "CWE-321",
                "lang": "eng",
                "value": "CWE-321: Use of Hard-coded Cryptographic Key"
              }
            ]
          },
          {
            "description": [
              {
                "cweId": "CWE-330",
                "lang": "eng",
                "value": "CWE-330: Use of Insufficiently Random Values"
              }
            ]
          }
        ]
      },
      "references": {
        "reference_data": [
          {
            "name": "https://github.com/dfinity/agent-js/pull/851",
            "refsource": "MISC",
            "url": "https://github.com/dfinity/agent-js/pull/851"
          },
          {
            "name": "https://www.npmjs.com/package/@dfinity/identity/v/1.0.1",
            "refsource": "MISC",
            "url": "https://www.npmjs.com/package/@dfinity/identity/v/1.0.1"
          },
          {
            "name": "https://github.com/dfinity/agent-js",
            "refsource": "MISC",
            "url": "https://github.com/dfinity/agent-js"
          },
          {
            "name": "https://agent-js.icp.xyz/identity/index.html",
            "refsource": "MISC",
            "url": "https://agent-js.icp.xyz/identity/index.html"
          },
          {
            "name": "https://github.com/dfinity/agent-js/security/advisories/GHSA-c9vv-fhgv-cjc3",
            "refsource": "MISC",
            "url": "https://github.com/dfinity/agent-js/security/advisories/GHSA-c9vv-fhgv-cjc3"
          }
        ]
      },
      "source": {
        "discovery": "UNKNOWN"
      }
    },
    "nvd.nist.gov": {
      "cve": {
        "descriptions": [
          {
            "lang": "en",
            "value": "Impact: The library offers a function to generate an ed25519 key pair via Ed25519KeyIdentity.generate with an optional param to provide a 32 byte seed value, which will then be used as the secret key. When no seed value is provided, it is expected that the library generates the secret key using secure randomness. However, a recent change broke this guarantee and uses an insecure seed for key pair generation. Since the private key of this identity (535yc-uxytb-gfk7h-tny7p-vjkoe-i4krp-3qmcl-uqfgr-cpgej-yqtjq-rqe) is compromised, one could lose funds associated with the principal on ledgers or lose access to a canister where this principal is the controller. \n"
          },
          {
            "lang": "es",
            "value": "Impacto: la librer\u00eda ofrece una funci\u00f3n para generar un par de claves ed25519 a trav\u00e9s de Ed25519KeyIdentity.generate con un par\u00e1metro opcional para proporcionar un valor inicial de 32 bytes, que luego se utilizar\u00e1 como clave secreta. Cuando no se proporciona ning\u00fan valor inicial, se espera que la librer\u00eda genere la clave secreta mediante aleatoriedad segura. Sin embargo, un cambio reciente rompi\u00f3 esta garant\u00eda y utiliza una semilla insegura para la generaci\u00f3n del par de claves. Dado que la clave privada de esta identidad (535yc-uxytb-gfk7h-tny7p-vjkoe-i4krp-3qmcl-uqfgr-cpgej-yqtjq-rqe) est\u00e1 comprometida, se podr\u00edan perder fondos asociados con el principal en los libros de contabilidad o perder el acceso a un contenedor donde este principal es el controlador."
          }
        ],
        "id": "CVE-2024-1631",
        "lastModified": "2024-02-22T19:07:37.840",
        "metrics": {
          "cvssMetricV31": [
            {
              "cvssData": {
                "attackComplexity": "LOW",
                "attackVector": "NETWORK",
                "availabilityImpact": "NONE",
                "baseScore": 9.1,
                "baseSeverity": "CRITICAL",
                "confidentialityImpact": "HIGH",
                "integrityImpact": "HIGH",
                "privilegesRequired": "NONE",
                "scope": "UNCHANGED",
                "userInteraction": "NONE",
                "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N",
                "version": "3.1"
              },
              "exploitabilityScore": 3.9,
              "impactScore": 5.2,
              "source": "6b35d637-e00f-4228-858c-b20ad6e1d07b",
              "type": "Secondary"
            }
          ]
        },
        "published": "2024-02-21T03:15:08.747",
        "references": [
          {
            "source": "6b35d637-e00f-4228-858c-b20ad6e1d07b",
            "url": "https://agent-js.icp.xyz/identity/index.html"
          },
          {
            "source": "6b35d637-e00f-4228-858c-b20ad6e1d07b",
            "url": "https://github.com/dfinity/agent-js"
          },
          {
            "source": "6b35d637-e00f-4228-858c-b20ad6e1d07b",
            "url": "https://github.com/dfinity/agent-js/pull/851"
          },
          {
            "source": "6b35d637-e00f-4228-858c-b20ad6e1d07b",
            "url": "https://github.com/dfinity/agent-js/security/advisories/GHSA-c9vv-fhgv-cjc3"
          },
          {
            "source": "6b35d637-e00f-4228-858c-b20ad6e1d07b",
            "url": "https://www.npmjs.com/package/@dfinity/identity/v/1.0.1"
          }
        ],
        "sourceIdentifier": "6b35d637-e00f-4228-858c-b20ad6e1d07b",
        "vulnStatus": "Awaiting Analysis",
        "weaknesses": [
          {
            "description": [
              {
                "lang": "en",
                "value": "CWE-321"
              },
              {
                "lang": "en",
                "value": "CWE-330"
              }
            ],
            "source": "6b35d637-e00f-4228-858c-b20ad6e1d07b",
            "type": "Secondary"
          }
        ]
      }
    }
  }
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…