GHSA-WG2X-RV86-MMPX

GHSA-WG2X-RV86-MMPX is a high-severity security vulnerability in @keep-network/tbtc-v2 (npm), affecting versions <= 1.5.1. It is fixed in 1.5.2.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

SPV Merkle proof malleability allows the maintainer to prove invalid transactions

By publishing specially crafted transactions on the Bitcoin blockchain, the SPV maintainer can produce seemingly valid SPV proofs for fraudulent transactions.

The issue was originally identified by Least Authority in the tBTC Bridge V2 Security Audit Report as Issue B: Bitcoin SPV Merkle Proofs Can Be Faked. A mitigation was believed to have been in place, but this turned out to contain an error, and the issue had not been effectively mitigated.

Details

This is achieved by creating a 64-byte transaction that the fraudulent transaction treats as a node in its merkle proof:

The attacker creates the malicious transaction E and calculates an unusual but valid transaction D, so that the last 32 bytes of D are a part of the merkle proof of E:

D = foo | hash256(E')
E' = bar | hash256(E)

foo and bar are arbitrary 32-byte values selected to facilitate this attack.

The attacker can then publish D and wait for it to be mined. A valid SPV proof for D can then be transformed into a proof for E by prepending bar and foo to the merkle proof, and changing the transaction index into one matching E's implied position in the merkle tree.

Calculating a suitable value for E' has been estimated to require between 2^60 to 2^81 operations. By contrast, the current Bitcoin hashrate is approximately 2^69. Thus the cost of performing the requisite brute-force is at most similar to, or possibly up to 1,000,000 times lower than, the cost of mining 6 Bitcoin blocks at the current difficulty.

Workarounds

The trusted SPV maintainer position prevents this issue

References

Weaknesses in Bitcoin’s Merkle Root Construction

Leaf-Node weakness in Bitcoin Merkle Tree Design

SPV proof verification vulnerable to potential (but expensive to exploit) Merkle tree problem #192

tBTC Bridge V2 Security Audit Report

Impact

The vulnerability does not enable the SPV maintainer to do anything they would not have been able to do otherwise. However, the ability to bypass the need to mine 6 blocks at the current difficulty makes abusing the SPV maintainer position significantly cheaper.

Affected versions

@keep-network/tbtc-v2 (<= 1.5.1)

Security releases

@keep-network/tbtc-v2 → 1.5.2 (npm)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

Adding the coinbase transaction and its merkle proof into the SPV proofs prevents this issue, by increasing the brute-force required to 2^224. If the length of the coinbase proof matches the length of the transaction proof, and both proofs are valid for the same header, we can trust that the exploit has not been abused for the transaction.

Frequently Asked Questions

  1. What is GHSA-WG2X-RV86-MMPX? GHSA-WG2X-RV86-MMPX is a high-severity security vulnerability in @keep-network/tbtc-v2 (npm), affecting versions <= 1.5.1. It is fixed in 1.5.2.
  2. Which versions of @keep-network/tbtc-v2 are affected by GHSA-WG2X-RV86-MMPX? @keep-network/tbtc-v2 (npm) versions <= 1.5.1 is affected.
  3. Is there a fix for GHSA-WG2X-RV86-MMPX? Yes. GHSA-WG2X-RV86-MMPX is fixed in 1.5.2. Upgrade to this version or later.
  4. Is GHSA-WG2X-RV86-MMPX exploitable, and should I be worried? Whether GHSA-WG2X-RV86-MMPX is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  5. What actually determines whether GHSA-WG2X-RV86-MMPX is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  6. How do I fix GHSA-WG2X-RV86-MMPX? Upgrade @keep-network/tbtc-v2 to 1.5.2 or later.

Other vulnerabilities in @keep-network/tbtc-v2

Stop the waste.
Protect your environment with Kodem.