r/Electrum • • 1h ago

Electrum 2FA and the RBF fee-bump attack (fixed in 4.8.3): what 2FA protects

3 Upvotes

Some users recommend 2FA as protection against the recent fee-bump attack. A 2FA wallet probably does not stop this attack. To protect your coins, use Electrum 4.8.3 or later. The current release is 4.8.4. Also, compare the full output address before you sign a transaction.

The first sections of this post are about the attack. The last sections are about 2FA.

The attack

Electrum is a light wallet. It gets your transaction history from an Electrum server. It also sends your transactions to that server for broadcast.

Electrum published a security advisory about the attack (GHSA-6jp4-8v48-cc5v on GitHub). The advisory gives this sequence:

  1. You send a payment. A malicious server does not broadcast it.
  2. The server shows a different transaction in your history. This transaction spends the same coins to the address of the attacker.
  3. The signatures of this transaction are not valid. Electrum versions before 4.8.3 did not check these signatures.
  4. Electrum shows the transaction as unconfirmed, with a fee of approximately zero.
  5. You increase the fee with RBF (replace-by-fee). Electrum then signs a new, valid version of the transaction. This version sends your coins to the attacker.

The advisory also gives these facts:

  • The address of the attacker had the same last four characters as your real address.
  • The attacks occurred on public servers. The attack did not affect users with their own server.

What to do now

  1. Find your version in Help > About.
  2. If your version is earlier than 4.8.3, update Electrum.
  3. Download Electrum only from electrum.org. Criminals have used fake Electrum versions to steal coins in the past.
  4. Verify the GPG signature before you install. The instructions are on electrum.org.
  5. Before you sign a transaction, compare the full output address with the address that you want to pay. Compare all characters. The attacker copied the last four characters.
  6. Compare the amount. Do these checks for a fee bump too.

If your history shows an unconfirmed payment that you do not know, do not increase its fee. Do these steps:

  1. Update Electrum.
  2. Select a different server in Tools > Network.
  3. Examine your history again.

In the incident in the advisory, the server did not broadcast the real payment. That payment was still valid, and the coins did not move.

If you use your own Electrum server, or a server that you trust, the advisory says that the attack does not affect you.

Why 2FA does not stop this attack

An Electrum 2FA wallet is a 2-of-3 multisig wallet. Your seed contains two of the three keys. TrustedCoin has the third key.

When you send coins, Electrum signs the transaction with the key in your wallet file. Then Electrum sends the transaction to TrustedCoin, together with the 6-digit code from your authenticator app. If the code is correct, TrustedCoin also signs.

A fee bump uses the same procedure. In this attack, you approve the transaction of the attacker yourself. When you type your code, TrustedCoin cannot know that you made a mistake. We did not find a statement in the advisory or in the TrustedCoin documentation that TrustedCoin checks the destination address.

The incident in the advisory occurred in a 2-of-3 multisig wallet with two Trezor devices. More signers give protection when a different person gets your keys. In this attack, the signature came from you.

What 2FA protects

The Electrum documentation says that 2FA gives protection when malware or a criminal controls your computer. That person cannot send your coins without your code, also with your wallet file and your password.

2FA also gives you more ways to lose access. Check these items:

  • Electrum shows the seed only one time, when you make the wallet. After that, the Seed menu item is not available, because the seed can disable the second factor. If you did not write the seed on paper, Electrum cannot show it again. Make sure today that you have the seed. If you added seed extension words, make sure that you have them too.
  • A 2FA seed uses the same word list as a standard Electrum seed. But it is a different seed type, and it is not a BIP-39 seed. To restore it, select the two-factor wallet type in Electrum. Wallets for BIP-39 seeds cannot open it.
  • If you lose your authenticator, TrustedCoin does not reset it without the seed. Restore the wallet with the seed. Then select Keep and request a new authenticator secret. Or select Disable.
  • Disable puts your two keys on one computer and removes the second factor. Your addresses stay multisig addresses. To get a standard wallet, make a new standard wallet and send the coins to it.
  • If you do not have the seed and you do not have a working authenticator, usually nobody can move the coins. A backup of the authenticator is the exception.

Before you restore or update

  1. Make a backup of your wallet folder. On Windows, the folder is %APPDATA%\Electrum. On Linux and macOS, the folder is ~/.electrum.
  2. If your authenticator app can export a backup, make that backup.
  3. After you restore a wallet, compare one known receiving address and your transaction history. Do this before you use the wallet.

Messages from strangers

After posts like this one, people get messages from "recovery agents" and from fake "TrustedCoin support" accounts. Offers to reset 2FA by email or chat do not come from TrustedCoin. Do not send your seed, your wallet file or your password to anybody. Honest helpers do not send you a message first.

Disclosure

I work at Crypto Recovers, a wallet recovery service. You can ask questions in this thread. You do not need to send a DM. Our longer guide about all Electrum 2FA restore cases is here: https://cryptorecovers.com/blog/electrum-2fa-recovery/