Two security flaws in one of the most widely used Bitcoin software libraries could quietly drain funds from wallet applications that never realized anything was wrong. The bugs sat inside bitcoinjs-lib, the open-source toolkit that developers around the world embed in wallets, trading tools and payment software to build and sign Bitcoin transactions. On October 26, the maintainers published security advisories and patched releases, and the episode is a useful reminder for everyday crypto users that the weakest link in a wallet is often not the blockchain itself but the ordinary software stacked on top of it.
What went wrong inside bitcoinjs-lib
Bitcoinjs-lib is a JavaScript library that applications use to construct transactions, manage keys and handle the partially signed Bitcoin transaction format known as PSBT, defined by BIP 174. That format lets separate tools pass transaction data and signatures between one another — signing, combining signatures, finalizing inputs and extracting the finished transaction are distinct steps, even when a single application performs several of them. It is precisely this flexible, multi-step pipeline where the two flaws crept in.
According to the October 26 security advisories published by the bitcoinjs-lib maintainers, both bugs involve how the library accounts for miner fees. A Bitcoin transaction’s fee is simply the difference between the value of its inputs and the value of its outputs. Understate the value of an input and the calculated fee looks far smaller than the amount actually being paid. The patched releases — versions 5.2.2, 6.1.9 and 7.0.4 for their corresponding release lines — force the fee calculation to treat every input honestly.
How a valid signature can hide a giant fee
The first flaw is subtle. Signing a transaction and calculating its fee are separate operations, and the bug allowed them to consult different values for the same input. Signing used the full previous transaction record, while fee accounting preferred a conflicting record carrying a smaller value. The result: the vulnerable software could authorize a perfectly legitimate transaction while evaluating the wrong fee entirely.
The advisory describes a demonstration on bitcoinjs-lib version 7.0.1 in which a transaction’s true fee was 900,000,000 satoshi — roughly nine whole bitcoin at the smallest unit of the currency — while the library reported just 200 satoshi. The signature verified successfully, and the extraction step completed without triggering the default excessive-fee warning. In other words, every safeguard built on top of the library’s accounting would have been silently satisfied while nearly the entire input value was diverted to a miner.
The second advisory covers a related failure mode: finalized inputs whose input-value records were missing entirely. The fee calculator counted those inputs as zero. Critically, an already-signed PSBT imported from another party could reach this calculation without needing any further signing operation — a realistic scenario for coordination tools, multisig setups and exchanges that assemble transactions from externally prepared files. The advisory’s hypothetical example showed a true fee of 91,000 satoshi reported as only 1,000 satoshi.
Who is actually at risk
There is an important limit to the damage these bugs can cause. The defects do not forge signatures and do not create unauthorized transactions. Actual loss requires a legitimate, authorized transaction to be broadcast and accepted by the network; when it is, the excess value quietly becomes a miner’s fee rather than landing in an attacker’s pocket. That distinction makes exploitation less dramatic than a classic exchange hack, but no less painful for a user whose wallet software approves a payment and accidentally torches the balance difference.
The real risk concentrates in applications that import the library and trust its fee calculation or excessive-fee safeguard without independently verifying the outputs being spent. For the conflicting-record flaw, the affected releases are 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 flaw affects those same version 6 and version 7 ranges, plus 5.1.0 through 5.2.1 in the version 5 line. Any wallet or service built on those versions inherits the vulnerability until it upgrades.
How the maintainers fixed it
The remediation, described in the project’s public commit history, gives signing and fee accounting a shared method for resolving previous outputs, rejects conflicting values or scripts outright, and requires an explicit amount for every input during fee calculation. It also clears cached fees and extracted transactions whenever relevant metadata changes or PSBTs are combined, closing the door on stale values lingering from earlier steps.
For maintainers who cannot upgrade immediately, the advisories recommend a disciplined workaround: independently verify the value of every referenced output before trusting any fee figure. Reject conflicting records before signing, and confirm every input value before extracting a final transaction. It is old-fashioned bookkeeping discipline, but it is exactly the kind of check that catches an understated input before the network does.
Why this matters beyond one library
For everyday investors, the lesson is less about bitcoinjs-lib specifically and more about the supply chain that sits underneath every wallet. Open-source libraries are reused across thousands of applications, and a single accounting flaw can propagate quietly into hardware wallet companion apps, browser wallets, merchant tooling and exchange back-ends. Most users have no way to inspect which library versions their wallet vendor has bundled.
The practical takeaways are straightforward. Prefer wallets from teams that respond quickly to upstream security advisories — the patch here shipped with coordinated disclosures, which is a sign of a healthy maintenance process. Watch for wallet updates in the coming weeks and install them promptly, since vendors will be folding the patched releases into their own builds. And if you use multisig or coordination tooling that passes PSBT files between parties, be aware that imported transactions deserve the same skepticism as ones you build yourself.
The bitcoinjs-lib episode ended without a headline-grabbing theft, but only because maintainers caught the flaws before someone else did. In crypto, the difference between a security advisory and a nine-figure loss is often just timing — and this time, the good guys moved first.
a 91,000 sat fee showing up as 1,000 in the UI. imagine signing that in a hurry on mobile. glad the patch landed Oct 26
this is why i never let a wallet app load pre-built tx files. if the dev still hasnt bumped bitcoinjs-lib since the advisory, thats a red flag not a bug
The scary part is BIP 174 lets the finalize step carry metadata the wallet trusts blindly. Years of quiet library code and one audit changes the whole trust chain overnight.
checked my wallet app changelog after this. zero mention of a library bump since Oct 26. considering a move now
same with mine. silent changelog, not encouraging
Two fee accounting bugs in a library half the wallet world builds on, and the patched releases only landed October 26. Time to audit what your favorite wallet actually ships.
auditing deps is great until the wallet app pins a three year old version of the lib and never bumps it lol. that’s the actual failure mode here
pinned deps plus silent changelogs is literally the nightmare scenario in every supply chain talk. id fork and bump the lib myself before waiting on an app store review cycle
pinned forever deps and no changelog mention is the real bug. if your wallet hasnt bumped bitcoinjs-lib since the oct 26 advisory, the fee math bug is still in your pocket
pinned forever deps is the norm, not the exception, in wallet land. half the mobile wallets shipping today run a bitcoinjs version older than the psbt behavior they advertise
and app store review cycles mean even a bumped lib ships weeks late. signing blind is just trusting the dev with your fees
satlayerdev the review cycle lag is the scary part, the patch dropped oct 26 and half the wallets on my machine still cant tell me which lib version they ship
been telling my group to recompute the fee in a second tool before broadcasting anything. one bad PSBT finalize and the miner quietly thanks you
second tool is the move. i paste the raw hex into a standalone fee calc before broadcasting, it already caught one mislabeled amount on a small tx for me
Which second tool do you use for the check? Looking for something that reads the raw tx and recalculates inputs minus outputs, not just what the wallet claims.
been using a mempool space raw tx viewer plus a quick python script that sums inputs minus outputs. ugly but it does not care what the wallet ui claims
inputs minus outputs in a second script is the only habit worth keeping from this whole saga. five lines of python beats trusting a changelog forever
91,000 sats showing as 1,000 in the ui and you sign on mobile in a queue. recompute the fee in a second tool before broadcast, takes 30 seconds
been running the python sum since the psbt scare last year. ugly, but it caught a mislabeled change output on a small tx once
the patch math is simple, apps pinned to anything before the oct 26 releases are still calculating fees on the old code. check the dependency list of your wallet before assuming the advisory fixed anything for you
This is why UTXO accounting on the frontend is such a minefield when you’re relying on JS libraries. If bitcoinjs-lib is miscalculating input values or failing to validate change outputs properly, the implicit fee calculation (inputs minus outputs) can easily swallow an entire UTXO without throwing an error. Always verify the raw PSBT details directly on your hardware wallet screen before signing anything.
Bro imagine fat-fingering your entire stack to a mining pool just because your wallet dev didn’t patch a JavaScript dependency. Make it a habit to check the sat/vB and total fee on your cold storage device every single time, don’t ever trust the app UI blindly.
Honestly it’s wild how much of the crypto ecosystem still leans on open-source libraries where silent bugs like this can lurk for ages. For regular users who don’t know how to decode raw transactions, a wallet app approving a massive miner fee without a warning is pretty much a nightmare scenario.
Apps pinned to anything before the Oct 26 releases are the silent majority here. Check the dependency lock before you check anything else on your wallet.
Pedro Casals the dependency lock habit is underrated. check the lib version, then sum inputs minus outputs in a second tool before signing. two minutes beats a fat fee forever
Pedro dependency lock first is right but most users cant even find it, buried six screens deep in some electron wallet. maintainers patched 5.2.2 through 7.0.4, the apps are the bottleneck