CVE-2024-49365: Tiny secp256k1 Tiny-secp256k1 Allows For Verify() Bypass Vulnerability
HIGHCVE-2024-49365 is a HIGH tiny-secp256k1 allows for verify() bypass vulnerability (CWE-347: Improper Verification of Cryptographic Signature) affecting Tiny secp256k1 libraries in the npm ecosystem. The issue involves tiny-secp256k1 allows for verify() bypass when running in bundled environment. Remediation is available by upgrading affected packages to version 1.1.7.
CVE-2024-49365 at a Glance
How to Fix CVE-2024-49365
To remediate this vulnerability, upgrade all affected Tiny secp256k1 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install tiny-secp256k1@1.1.7
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls tiny-secp256k1
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2024-49365, inspect your project dependencies using npm:
npm ls tiny-secp256k1
Analyze the terminal output to locate any version of Tiny secp256k1 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.1.7), your application is affected.
Note: The npm ls tiny-secp256k1 command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-347: Improper Verification of Cryptographic Signature, where the product does not verify, or incorrectly verifies, the cryptographic signature for data. In Tiny secp256k1, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-49365 Affected Tiny secp256k1 Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
tiny-secp256k1
|
npm |
< 1.1.7
|
1.1.7
|
References
Frequently Asked Questions
What is CVE-2024-49365?
Which Tiny secp256k1 versions are affected?
What version fixes CVE-2024-49365?
Is tiny-secp256k1 affected?
What CWE is associated with CVE-2024-49365?
How can I check npm dependencies for CVE-2024-49365?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-5vhg-9xg4-cv9m",
"modified" : "2025-07-01T13:13:38Z",
"published" : "2025-06-30T17:44:14Z",
"aliases" : [ "CVE-2024-49365" ],
"summary" : "tiny-secp256k1 allows for verify() bypass when running in bundled environment",
"details" : "### Summary\n\nA malicious JSON-stringifyable message can be made passing on `verify()`, when global Buffer is [`buffer` package](https://www.npmjs.com/package/buffer)\n\n### Details\n\nThis affects only environments where `require('buffer')` is <https://npmjs.com/buffer>\nE.g.: browser bundles, React Native apps, etc.\n\n`Buffer.isBuffer` check can be bypassed, resulting in strange objects being accepted as `message`, and those messages could trick `verify()` into returning false-positive `true` values\n\nv2.x is unaffected as it verifies input to be an actual `Uint8Array` instance\n\nSuch a message can be constructed for any already known message/signature pair\nThere are some restrictions though (also depending on the known message/signature), but not very limiting, see PoC for example\n\nhttps://github.com/bitcoinjs/tiny-secp256k1/pull/140 is a subtle fix for this\n\n### PoC\n\nThis code deliberately doesn't provide `reencode` for now, could be updated later\n\n```js\nimport { randomBytes } from 'crypto'\nimport tiny from 'tiny-secp256k1' // 1.1.6\n\n// Random keypair\nconst privateKey = randomBytes(32)\nconst publicKey = tiny.pointFromScalar(privateKey)\n\nconst valid = Buffer.alloc(32).fill(255) // let's sign a static buffer\nconst signature = tiny.sign(valid, privateKey)\n\n// Prevent processing any unverified data by fail-closed throwing\nfunction verified(data, signature) {\n if (!Buffer.isBuffer(data)) data = Buffer.from(data, 'hex')\n if (!tiny.verify(data, publicKey, signature)) throw new Error('Signature invalid!')\n return new Uint8Array(data)\n}\n\nfunction safeProcess(payload) {\n const totally = JSON.parse(payload) // e.g. json over network\n\n const message = verified(totally, signature)\n console.log(message instanceof Uint8Array)\n console.log(Buffer.from(message).toString('utf8')) \n}\n\nconst payload = reencode(valid, \"Secure contain protect\")\nsafeProcess(payload)\n```\n\nOutput (after being bundled):\n```console\ntrue\nSecure contain protect����\n```\n\n### Impact\n\nMalicious messages could crafted to be verified from a given known valid message/signature pair",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N/E:P"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "tiny-secp256k1"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.1.7"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.1.6"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/bitcoinjs/tiny-secp256k1/security/advisories/GHSA-5vhg-9xg4-cv9m"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-49365"
}, {
"type" : "WEB",
"url" : "https://github.com/bitcoinjs/tiny-secp256k1/pull/140"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/bitcoinjs/tiny-secp256k1"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-347" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2025-06-30T17:44:14Z",
"nvd_published_at" : "2025-07-01T03:15:21Z"
}
}