Bitcoin wallet bug let rogue servers steal funds when users tried to speed up payments

A bitcoin wallet security flaw allowed malicious servers to trick users into signing payments to attackers when they tried to speed up transactions, with developers confirming at least one case in which money was stolen.

Electrum, one of Bitcoin's oldest software wallets, disclosed the vulnerability on Saturday, saying some servers were already exploiting it. The developers received two reports in October, including one from a user who lost funds after approving what appeared to be a routine transaction-fee increase.

The attack exploited how Electrum handles bitcoin payments that have not yet been confirmed by the network.

Unlike a full Bitcoin node, Electrum relies on outside servers to retrieve transaction histories and broadcast payments. Before the fix, the wallet trusted those servers to report pending transactions without checking whether their signatures were valid.

An attacker controlling one of those servers could intercept a payment before it reached the Bitcoin network and replace it in the wallet's history with a fake transaction. This replacement spent the user's coins to an address controlled by the attacker, using invalid signatures that Electrum failed to detect.

But the wallet then displayed the fake payment as pending, and the trap came when users tried to speed things up.

Bitcoin allows unconfirmed transactions to be replaced with versions carrying higher fees, a feature called Replace-by-Fee. If a user selected that option, Electrum could take the fraudulent transaction and sign a valid replacement, sending the coins to the attacker.

In one reported case, the malicious transaction carried no fee at all, making it appear stuck. Attackers also generated receiving addresses whose last four characters matched the legitimate destination, making the substitution harder to spot during a quick check.

The first report, submitted Oct. 11, involved a two-of-three multisignature wallet using two Trezor hardware devices. The user had checked the legitimate payment on both devices but later noticed a different outgoing transaction in the wallet's history (that user did not report losing funds).

A second user reported on Oct. 18 that they had raised the fee on a substituted transaction and lost money. Developers have not disclosed the amount stolen or identified the malicious servers.

In response, Electrum released version 4.8.3 on Oct. 24, adding signature checks for unconfirmed transactions spending coins from the user's own wallet. However, earlier versions remain vulnerable to the reported attack when connected to malicious servers.