Two vulnerabilities in Bitcoin’s codebase can disguise massive miner fees and allow valid transactions to bypass standard security checks.

Bitcoinjs-lib, a widespread toolkit for crypto developers, resolved two flaws that could trick software into underestimating transaction fees before valid transfers get broadcast and accepted.

Security advisories published Oct. 26 highlight critical updates across versions 5.2.2, 6.1.9, and 7.0.4 to address the vulnerabilities in each release line.

The affected format involves partially signed Bitcoin transactions (PSBTs), which BIP 174 defines as a protocol for sharing transaction data and signatures across clients. Signing, aggregating signatures, finalizing inputs, and extracting the transaction remain distinct functions, even if a single app handles multiple steps.

The risk impacts applications that import these packages and rely on bitcoinjs-lib’s fee metrics or safeguard limits without independently verifying spent outputs. Maintainers must review their dependency versions and confirm how imported PSBTs are validated.

A Bitcoin transaction fee represents the difference between input and output values, so understating an input makes the calculated fee appear much smaller.

Why Valid Digital Signatures Can Still Hide Misleading Fees#

Under the first flaw, signing and fee accounting can process conflicting values for the same input. While signing relies on the full prior transaction, fee accounting prioritizes a different record with a lower amount. Consequently, vulnerable software can authorize the actual transfer while calculating an inaccurate fee.

The advisory details a test on bitcoinjs-lib 7.0.1 where the true fee reached 900,000,000 satoshis, yet the library reported just 200 satoshis. The signature was verified successfully, and extraction returned without triggering the standard fee-rate warning.

Stay in the loop

Get crypto news before the market moves

Join thousands of investors who read our daily briefing.

No spam. Unsubscribe anytime.

The second advisory details finalized inputs where both value records are missing. The tool counts these inputs as zero, allowing an already-signed PSBT imported from an external party to undergo calculation without requiring an additional signing step.

Its hypothetical scenario shows an actual fee of 91,000 satoshis, yet the library calculates just 1,000 satoshis. Finalized scripts and signatures alone fail to establish the missing input’s true value.

Financial loss occurs only when an authorized, valid transaction gets broadcast and accepted by the network. These flaws cannot forge signatures, so any leftover funds are absorbed as miner fees.

Regarding conflicting records, impacted versions cover 5.2.0 through 5.2.1, 6.0.0 through 6.1.8 including 6.1.0-rc.0, and 7.0.0-rc.0 through 7.0.3. The missing-record defect targets these same v6 and v7 builds, alongside 5.1.0 through 5.2.1 within the v5 branch.

The remediation provides a shared method for signing and accounting to resolve previous outputs, rejects conflicting values or scripts, and mandates an amount for every input during fee calculation. Cached fees and extracted transactions are also cleared after relevant metadata changes or combinations.

Maintainers who are unable to upgrade must independently verify referenced output values. Conflicting records should be rejected before signing or trusting fees, and every input value must be validated before trusting calculated fees or extracting a transaction.