Security Digest · Vulnerability record

CVE-2026-107846: bitcoinjs-lib: Undetected merkle node duplication in block root computation validates a forged transaction list

bitcoinjs-lib is a JavaScript Bitcoin library for Node.js and browsers.

CVSS 9.3 Critical EPSS 0.3% · p17

Should you act?

Critical and remotely reachable

No known exploitation yet, but it is network-reachable without credentials. This signal is computed from CISA KEV, EPSS and CVSS data; it is not an editorial verdict.

  • Not in CISA KEV, but CISA’s SSVC assessment records a public proof-of-concept, so attack code exists.
  • EPSS 0.3%, percentile 17: FIRST’s model estimates a 0.3% chance of exploitation activity in the next 30 days, higher than 17% of all scored CVEs (low). EPSS is a probability, not a verdict.
  • Remotely reachable with no login and no user interaction. If the vulnerable service is exposed to the internet, prioritize it.
  • Only applies if your dependency tree includes bitcoinjs-lib (npm) >= 2.3.0, < 5.2.1, fixed in 5.2.1; bitcoinjs-lib (npm) >= 6.0.0, < 6.1.8, fixed in 6.1.8; bitcoinjs-lib (npm) >= 7.0.0-rc.0, < 7.0.2, fixed in 7.0.2. Check your lockfile, including transitive dependencies.

What it is

bitcoinjs-lib is a JavaScript Bitcoin library for Node.js and browsers. From 2.3.0 until 5.2.1, 6.1.8, and 7.0.2, fastMerkleRoot pads odd Merkle-tree levels by hashing the final node with itself but does not report adjacent duplicate hashes. The affected block-root verifier was introduced as Block.checkMerkleRoot() alongside Block.calculateMerkleRoot(), while later versions expose validation through checkTxRoots() and checkMerkleRoot; these validation paths can accept a recomputed root without checking for mutation. A peer can append duplicate transactions so a different transaction list retains the original Merkle root, block header, proof of work, and block identifier. Consumers that rely on block-root validation, including explorers, exchange indexers, or SPV clients, can process a duplicated transaction twice or blacklist the shared block hash and reject the honest block. This issue is fixed in versions 5.2.1, 6.1.8, and 7.0.2.

From the GitHub advisory

Summary fastMerkleRoot pads an odd level by hashing the last node with itself. It does not report that it did so, and checkTxRoots never looks for repeated transactions. A peer can therefore duplicate transactions to fill the pad and produce a block with a different transaction list but the same merkle root. The block hash and block id do not change, so the header still carries valid proof of work. In the proof of concept a real mainnet block goes from nine transactions to ten, and separately to twelve, with the same id every time, and checkTxRoots accepts all three. Bitcoin Core rejects this case through the mutated flag in ComputeMerkleRoot and the bad-txns-duplicate reason in CheckBlock. This is CVE-2012-2459.

Details A bitcoin merkle tree pads an odd level by hashing the last node with itself. Duplicating transactions to fill that pad therefore yields the same root for a different transaction list. This is CVE-2012-2459. Bitcoin Core detects it in ComputeMerkleRoot, which scans each level for two adjacent equal hashes before padding and raises a mutated flag when it finds a pair, and CheckBlock then rejects the block with bad-txns-duplicate.

The forged block carries the duplicate in its own transaction list, so the pair is present at a level and the flag is raised. The honest block has no such pair and is unaffected.

fastMerkleRoot performs the duplication and reports nothing.

Block.calculateMerkleRoot returns that value unchanged, and checkMerkleRoot only compares it to the header field.

Weakness type: CWE-354.

Product: bitcoinjs-lib (npm) · Assigned by: GitHub_M · Published: 2026-11-04

Affected and fixed versions

EcosystemPackageVulnerableFirst fixed
npmbitcoinjs-lib>= 2.3.0, < 5.2.15.2.1
npmbitcoinjs-lib>= 6.0.0, < 6.1.86.1.8
npmbitcoinjs-lib>= 7.0.0-rc.0, < 7.0.27.0.2
VendorProductAffected versions (per CVE record)
bitcoinjsbitcoinjs-lib>= 2.3.0, < 5.2.1, >= 6.0.0, < 6.1.8, >= 7.0.0-rc.0, < 7.0.2

Severity scores

Scored byCVSSScoreVector
GitHub_M4.09.3 CriticalCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:H/VA:L/SC:N/SI:H/SA:H
GitHub4.09.3 CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:H/VA:L/SC:N/SI:H/SA:H
  • Attack vector: network (remotely reachable)
  • Attack complexity: low
  • Attack requirements: none
  • Privileges required: none (no login)
  • User interaction: none

CVSS measures how bad a flaw is if exploited, not how likely exploitation is. Read it next to the exploitation data below.

Exploitation and urgency

  • CISA KEV: not listed (no confirmed in-the-wild exploitation known to CISA).
  • CISA SSVC assessment: exploitation poc, automatable yes, technical impact partial.
  • FIRST EPSS (model of 2026-11-21): 0.25% probability of exploitation activity in the next 30 days; percentile 17.

Timeline

  • — CVE record published by GitHub_M
  • — CVE record last updated
  • — GitHub-reviewed advisory GHSA-8vv3-6qpc-gpw6 published (critical)

Sources and references

Original sources first. Version and fix details should always be confirmed against the vendor or project advisory.

Vulnerability records

  1. GitHub Advisory GHSA-8vv3-6qpc-gpw6 github.com
  2. CVE.org record CVE-2026-107846 cve.org
  3. NVD entry CVE-2026-107846 nvd.nist.gov

Other references from the CVE record and advisory

  1. github.com github.com
  2. github.com github.com
  3. github.com github.com
  4. github.com github.com

Critical npm advisories · Today’s Security Digest