The digital asset ecosystem was alerted to a critical security development this week as maintainers of bitcoinjs-lib, a cornerstone JavaScript library for Bitcoin application development, released urgent patches to address two significant vulnerabilities. These flaws, if exploited, could allow Bitcoin applications to inadvertently broadcast transactions with massive miner fees, potentially draining user wallets of substantial funds while bypassing standard software safety checks. The security disclosures, published on October 26, 2026, have sent ripples through the developer community, highlighting the delicate nature of transaction construction and the risks inherent in third-party library dependencies.

The vulnerabilities specifically target the handling of Partially Signed Bitcoin Transactions (PSBTs), a standard defined by BIP 174 that facilitates the movement of transaction data between different software and hardware clients. By manipulating how these transactions are parsed and calculated, an attacker or a malformed data set could trick a wallet into believing a transaction fee is negligible when, in reality, it constitutes nearly the entire value of the inputs.

The Technical Foundation: Understanding PSBTs and BIP 174

To grasp the severity of these bugs, one must understand the role of the Partially Signed Bitcoin Transaction (PSBT) format. Introduced via Bitcoin Improvement Proposal (BIP) 174, PSBT was designed to standardize the way different Bitcoin participants—such as hardware wallets, multi-signature coordinators, and watch-only wallets—communicate.

In a typical PSBT workflow, the process is decentralized into several roles: the Creator, the Updater, the Signer, the Finalizer, and the Extractor. This modularity allows for complex security setups, such as air-gapped signing. However, this separation of duties also creates potential points of failure if the data passed between these roles is not perfectly synchronized or validated. Bitcoinjs-lib is one of the most widely used tools for implementing these roles in web-based and Node.js environments. When an application using this library calculates a transaction fee, it relies on the metadata provided within the PSBT to determine the difference between the total value of inputs and the total value of outputs.

Analysis of the First Flaw: Conflicting Input Records

The first vulnerability identified in the security advisory concerns a discrepancy in how the library handles conflicting records for the same input. In Bitcoin, a transaction fee is not explicitly stated in the transaction data; rather, it is the "leftover" amount: Total Input Value minus Total Output Value equals the Miner Fee.

Under this flaw, the library’s signing logic and its fee accounting logic could be forced to use different values for the exact same input. Specifically, the signing function would use the correct, full value from the previous transaction to generate a valid signature. Simultaneously, the fee accounting logic would prioritize a conflicting record within the PSBT that contained a significantly smaller value for that same input.

The result is a "phantom fee" scenario. To the software and the user, the transaction appears to have a small, reasonable fee because the input value is being reported as lower than it actually is. However, because the signature is valid for the true, higher value, the Bitcoin network will accept the transaction. Once broadcast, the network calculates the fee based on the real input value, leading to a massive overpayment to miners.

Bitcoin apps risk massive fee drain, and 2 library bugs are blamed

In a demonstration provided in the October 26 disclosure, researchers showed that on bitcoinjs-lib version 7.0.1, a transaction with an actual fee of 900,000,000 satoshis (9 BTC) was reported by the library as having a fee of only 200 satoshis. Because the signature was technically valid, the library’s extraction process proceeded without triggering the default high-fee-rate warnings that usually protect users from such errors.

Analysis of the Second Flaw: The Zero-Value Calculation Risk

The second advisory describes a vulnerability related to finalized inputs where input-value records are missing entirely. In these instances, the library’s fee calculator was found to default the value of those inputs to zero.

This is particularly dangerous for applications that import PSBTs that have already been signed by another party. If a PSBT is imported with finalized scripts and signatures but lacks the explicit input-value metadata, the bitcoinjs-lib calculator would treat those inputs as contributing zero satoshis to the transaction.

For example, if a user is spending an input worth 100,000 satoshis and sending 9,000 satoshis to a recipient, the intended fee should be 91,000 satoshis (assuming a very high-priority transaction or a mistake). If the library reports the input as zero, it might calculate a negative or nonsensical fee, or in some configurations, report a nominal fee of 1,000 satoshis by ignoring the missing data. The critical danger is that finalized scripts and signatures do not inherently carry the value of the input; that value must be verified against the blockchain or provided accurately in the PSBT metadata. By defaulting to zero rather than throwing an error, the library allowed for the creation of transactions with hidden, excessive fees.

Chronology of Discovery and Remediation

The timeline for these vulnerabilities suggests a coordinated effort to secure the Bitcoin ecosystem before details were made public.

  • Pre-October 2026: Internal audits or third-party reports identified inconsistencies in how bitcoinjs-lib processed PSBT inputs across different versions.
  • October 26, 2026: Official security disclosures were published via GitHub and security mailing lists. The maintainers identified specific affected version ranges.
  • Version Impact:
    • Conflicting Records Flaw: Affected versions 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.
    • Missing Record Flaw: Affected the same ranges in versions 6 and 7, as well as 5.1.0 through 5.2.1 in the version 5 branch.
  • Immediate Remediation: Patches were fast-tracked and released as versions 5.2.2, 6.1.9, and 7.0.4.

The remediation involved a fundamental change in how the library resolves previous outputs. The software now utilizes a shared method for both signing and accounting to ensure they never view different values for the same transaction. Furthermore, the library now strictly rejects any PSBT containing conflicting values or scripts and mandates that an explicit amount be provided for every input during the fee calculation process.

Implications for the Bitcoin Ecosystem

The implications of these bugs are significant, given the ubiquity of JavaScript in the cryptocurrency space. Many web-based wallets, browser extensions, and mobile applications rely on bitcoinjs-lib to handle the heavy lifting of transaction construction.

For end-users, the risk is the irreversible loss of funds. Because Bitcoin transactions are immutable, a fee paid to a miner cannot be clawed back. While some mining pools have historically returned accidental "fat-finger" fees as a gesture of goodwill, there is no protocol-level requirement to do so. In an automated attack or a widespread software error, millions of dollars could be transferred to miners in minutes.

Bitcoin apps risk massive fee drain, and 2 library bugs are blamed

For developers, this event serves as a stark reminder of the "dependency hell" that can plague modern software. Even if an application’s core code is secure, a bug in a low-level library can introduce catastrophic vulnerabilities. The maintainers of bitcoinjs-lib have advised that any developer unable to upgrade immediately must implement manual checks. These include independently verifying all referenced output values and rejecting any PSBT with conflicting records before signing or broadcasting.

Broader Impact and Industry Reaction

The Bitcoin community has generally reacted with a mixture of concern and relief that the bugs were caught and patched. Security researchers have noted that as Bitcoin’s value increases, the incentive for finding and exploiting these "logic bugs" grows. Unlike a hack that steals private keys, these bugs exploit the way software interprets transaction data, making them harder to detect through traditional antivirus or perimeter security.

Industry experts suggest that this incident may lead to a push for more formal verification of cryptographic libraries. Formal verification involves using mathematical proofs to ensure that code behaves exactly as intended under all possible conditions, leaving no room for the kind of "default-to-zero" logic that caused the second vulnerability.

Furthermore, this event highlights the importance of the PSBT standard’s evolution. While BIP 174 revolutionized interoperability, it also placed a heavy burden on "Updaters" and "Finalizers" to ensure data integrity. Future iterations of the protocol or related libraries may include more robust internal checksums to prevent conflicting metadata from being processed in the first place.

Summary of Action for Stakeholders

The path forward for those involved in the Bitcoin infrastructure is clear.

  1. Application Maintainers: Every project using bitcoinjs-lib must audit their dependency tree immediately. Upgrading to the patched versions (5.2.2, 6.1.9, or 7.0.4) is the primary line of defense.
  2. Wallet Users: Users of non-custodial web or mobile wallets should ensure their applications are updated to the latest versions. While users cannot fix the library themselves, they can be vigilant by double-checking fee rates on block explorers before confirming high-value transactions, if their wallet allows for raw transaction inspection.
  3. Security Auditors: This incident provides a new case study for auditing transaction construction logic, specifically focusing on how input values are fetched and validated against the actual blockchain state rather than relying solely on provided metadata.

In the wake of these disclosures, the Bitcoin development community continues to move toward more resilient standards. The rapid response from the bitcoinjs-lib maintainers has likely prevented significant financial loss, but the event underscores the persistent need for "don’t trust, verify" at every level of the technology stack.