Proof of Research

·

5 min read

·

A block with the same Merkle root can hold a different transaction list, and bitcoinjs-lib's checkTxRoots misses it

A block with the same Merkle root can hold a different transaction list, and bitcoinjs-lib's checkTxRoots misses it

A block with the same Merkle root can hold a different transaction list, and bitcoinjs-lib's checkTxRoots misses it

bitcoinjs-lib's checkTxRoots can accept a block whose transaction list was altered but whose Merkle root, hash and ID are unchanged.

bitcoinjs-lib's checkTxRoots can accept a block whose transaction list was altered but whose Merkle root, hash and ID are unchanged.

OM

Otto Myst

Cirqus Intelligence · The Order of Choice

A block with the same Merkle root can hold a different transaction list, and bitcoinjs-lib's checkTxRoots misses it

Per the GitHub advisory GHSA-8vv3-6qpc-gpw6, a peer can do this without mining. Fixes are 5.2.1, 6.1.8 and 7.0.2. If your service credits deposits from blocks that peers send you, check your dependency tree.

What exactly does the advisory say is broken?

The check does not notice duplicated nodes in the Merkle tree. When a tree level has an odd number of nodes, the library hashes the last node with itself. The advisory puts it this way:

fastMerkleRoot pads an odd level by hashing the last node with itself.

checkTxRoots never checks for repeated transactions, so the altered list passes. The advisory’s proof of concept takes a real mainnet block with 9 transactions and a forged copy with 10. Both have the same block ID and both pass checkTxRoots. The advisory also describes a 12-transaction variant.

The advisory classifies the flaw as CWE-354 (improper validation of an integrity check value). It identifies it as CVE-2012-2459, the same class of issue in Bitcoin Core (advisory).

How severe is it, and when was it published?

The advisory gives a CVSS v4 base score of 9.3, rated Critical (advisory). It was published on 26 October 2026. It reached the GitHub Advisory Database on 10 November and was last updated on 11 November. It is tracked as CVE-2026-107846. The advisory credits 0xaudron and Ali-Kalout as reporters and landabaso as remediation developer.

What can go wrong in a service that uses it?

According to the advisory, explorers, exchange indexers and SPV clients that gate on checkTxRoots can be fooled into crediting the same deposit twice. It also warns that a consumer who blacklists the block hash in response would reject the honest block too, which it links to the “chain split denial of service” of the original CVE.

Our assessment: these are consequences the advisory describes, not reported incidents. We found no source for in-the-wild exploitation, for named affected services, or for losses. Don’t read “double-credited deposit” as something that has happened to anyone.

Which versions are affected, and what do I upgrade to?

Branch

Affected

Fixed in

2.x–5.x

2.3.0 to before 5.2.1

5.2.1

6.x

6.0.0 to before 6.1.8

6.1.8

7.x

7.0.0-rc.0 to before 7.0.2

7.0.2

According to the advisory, the verifier was introduced in 2.3.0 as Block.checkMerkleRoot(), alongside Block.calculateMerkleRoot().

How do I find out whether I’m exposed?

  1. List every copy of the package. Direct and transitive dependencies both count. Run npm ls bitcoinjs-lib, pnpm why bitcoinjs-lib or yarn why bitcoinjs-lib, depending on your package manager. Multiple versions can coexist in one tree, so check each one.

  2. Match each version against the table. Anything in a listed “affected” range is in scope.

  3. Find where your code validates blocks. Search for checkTxRoots and checkMerkleRoot. If you never validate peer-supplied blocks, the advisory’s described scenarios may not apply. The advisory itself notes that severity depends on the consumer.

  4. Upgrade to the fixed version on your line. Use the “Fixed in” column of the table, or a later patched release on the same line.

What if I’m on a version below 5?

The advisory says:

Versions below v5 have no in-line patch and require upgrading to a fixed line.

You can’t patch within your current line. You need to move to a fixed line, which means 5.2.1 or later per the advisory. It lists no workarounds. We did not check what a migration from an older major version involves, so test it before you plan around it.

What should I change in deposit logic?

The advisory’s proposed fix is for the library’s own code. It detects adjacent equal hashes at each level before padding, sets a mutated flag, and makes the Merkle-root check return false when the flag is set. It also offers an alternative:

Rejecting any block that contains a repeated txid gives the same result and is simpler to audit.

Our assessment: the advisory gives no guidance for service owners. The list below is our adaptation of two of its ideas, the “repeated txid” alternative fix and the warning against blacklisting the block hash. It is not advisory text.

  • Credit a deposit once per txid, not once per appearance in a block.

  • Check a block’s transaction list for repeated txids before you process it. This mirrors the advisory’s alternative fix, applied on the service side.

  • Don’t blacklist a block hash because one copy of the block failed (see the chain-split warning above).

What did we not verify?

  • Source: this article rests on one advisory record. We found no independent confirmation beyond the advisory itself.

  • Not established by the advisory: whether anyone has exploited this in real attacks, and which specific services are affected.

  • Bitcoin Core: the advisory notes that its statements about Bitcoin Core come from published source, not from tests against a running node.

FAQ

Does an attacker need to mine a block?
No. According to the advisory, the block header never changes, so no mining is required (advisory).

Is there a public proof of concept?
The advisory includes a proof of concept using a real mainnet block (9 transactions) and a forged copy (10 transactions). We have not run it.

Has anyone lost funds?
We found no source that says so, so we can’t say it happened.

I only have bitcoinjs-lib as a transitive dependency. Does this matter?
It can. See step 1 above to find the version, then step 3 to check whether block validation is used.

Which version do I install?
The one in the “Fixed in” column of the table for your branch.

Next step: Run npm ls bitcoinjs-lib (or pnpm why / yarn why) in each of your projects and compare every version you find against the table above.

Where to go next

Enter the Order — Join the Order of Cirqus Heresy.

Not financial advice. We disclose our own positions and any affiliate links in each report.

Tools we actually use.

Every tool in the Arsenal passes the same checks as this report.

Open the Arsenal

THE ORACLE BRIEF

New investigations, straight to your inbox.

One short letter when a report is published. Evidence, sources, and what to do about it. No hype, no spam.

Subscribe