The signature used in the TimelockTokenPool.withdraw
function might be reused since the signed message doesn't include nonce
and deadline
#204
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate-60
🤖_60_group
AI based duplicate group recommendation
satisfactory
satisfies C4 submission criteria; eligible for awards
upgraded by judge
Original issue severity upgraded from QA/Gas by judge
Lines of code
https://github.com/code-423n4/2024-03-taiko/blob/f58384f44dbf4c6535264a472322322705133b11/packages/protocol/contracts/team/TimelockTokenPool.sol#L170
Vulnerability details
The
TimelockTokenPool
contract allows for token withdrawals on behalf of users by utilizing a permit-like signature:This function might be called multiple times as the tokens are unlocked gradually. The issue arises from the fact that the signed message doesn't include
deadline
andnonce
. It means that anyone can reuse this signature and replay a withdrawal transaction.It's not much of an issue if the user manages approvals meticulously, but users often opt for unlimited approvals to save on gas. In this case, an attacker is still unable to steal anything, but they can replay a withdrawal transaction without the user's consent. This is quite concerning, as this transaction might essentially involve swapping
costToken
fortaikoToken
and the user might have some other use forcostToken
in mind. There also might be extreme cases where the user attempts to prevent liquidation usingcostToken
, only to be front-run by the attacker.This issue becomes even more severe if the
_to
address is compromised. In such a scenario, an attacker can gettaikoToken
at the expense of the user. The issue becomes more likely because of the following:nonce
anddeadline
and can't be reused;costToken
approval and withdrawal within a single transaction which is possible but isn't simple and obvious for the common user.Impact
An attacker can reuse a signature to execute an action without the user's consent. In some cases it allows the attacker to steal user's funds.
Proof of Concept
-
Tools Used
Manual Review
Recommended Mitigation Steps
Consider adding a
nonce
anddeadline
to the signed message. Additionally, consider exposing a function that marks the currentnonce
as used, providing a means for the user to revoke signatures.Assessed type
Invalid Validation
The text was updated successfully, but these errors were encountered: