Skip to content
Crypto Audit finding Intermediate

Signatures can be replayed in withdraw() to withdraw more tokens than the user originally intended.

The withdraw function recovers the signer from a hash that only binds the destination address, with no nonce or other replay protection. An attacker holding a user's signature could call withdraw repeatedly with the same signature to move more tokens than the user intended.

lightoasis Follow with 0xleadwizard, wangxx2026 and 3 others

Originally disclosed on Code4rena

Submitted by lightoasis, also found by 0xleadwizard, wangxx2026, alexfilippov314, ladboy233, and Tendency

Signatures can be replayed in withdraw() to withdraw more tokens than the user originally intended.

Vulnerability Details

In the TimelockTokenPool.sol contracts, users can provide a signature to allow someone else to withdraw all their withdrawable tokens on their behalf using their signature. TimelockTokenPool.sol#L170)

    function withdraw(address _to, bytes memory _sig) external {
        if (_to == address(0)) revert INVALID_PARAM();
        bytes32 hash = keccak256(abi.encodePacked("Withdraw unlocked Taiko token to: ", _to));
 @>     address recipient = ECDSA.recover(hash, _sig);
        _withdraw(recipient, _to);
    }

As seen from above, the signature provided does not include a nonce and this can lead to signature replay attacks. Due to the lack of a nonce, withdraw() can be called multiple times with the same signature. Therefore, if a user provides a signature to withdraw all his withdrawable tokens at one particular time, an attacker can repeatedly call withdraw() with the same signature to withdraw more tokens than the user originally intended. The vulnerability is similar to Arbitrum H-01 where user’s signatures could be replayed to use up more votes than a user intended due to a lack of nonce.

Recommended Mitigation Steps

Consider using a nonce or other signature replay protection in the TimelockTokenPool contract.

dantaik (Taiko) confirmed and commented:

Valid bug report, trying to fix it in this PR: https://github.com/taikoxyz/taiko-mono/pull/16611/files


The original report as published on Code4rena, by lightoasis. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The signed message contains only the destination address and no nonce or one-time marker, so the same signature stays valid for every later call.

Impact

An attacker with a user's withdrawal signature could repeatedly call withdraw to move more tokens than the user intended.

What the attacker needed

A valid withdrawal signature from a user; attacker can submit transactions

The fix

The project said it was fixing the issue by adding signature replay protection such as a nonce to the contract.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A signature is a cryptographic stamp proving the owner approved an action. Here the stamp only says 'send my unlocked tokens to this address' and nothing marks it as used, so the same stamp can be presented again and again. Each repeat moves more tokens out.

What is Crypto?

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.

More from Taiko

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cryptographic weaknesses

The lesson behind this report.

Encryption, signatures, randomness or certificate checks that do not protect what they claim to.