-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The message suspension mechanism can be circumvented if the message is with status RETRIABLE #150
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate-298
🤖_29_group
AI based duplicate group recommendation
satisfactory
satisfies C4 submission criteria; eligible for awards
Comments
minhquanym marked the issue as duplicate of #273 |
minhquanym marked the issue as duplicate of #298 |
0xean changed the severity to QA (Quality Assurance) |
0xean marked the issue as grade-c |
This previously downgraded issue has been upgraded by 0xean |
0xean marked the issue as satisfactory |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate-298
🤖_29_group
AI based duplicate group recommendation
satisfactory
satisfies C4 submission criteria; eligible for awards
Lines of code
https://github.com/code-423n4/2024-03-taiko/blob/f58384f44dbf4c6535264a472322322705133b11/packages/protocol/contracts/bridge/Bridge.sol#L82-L95
https://github.com/code-423n4/2024-03-taiko/blob/f58384f44dbf4c6535264a472322322705133b11/packages/protocol/contracts/bridge/Bridge.sol#L310-L337
Vulnerability details
Impact
Within Taiko's bridge there is a
suspendMessages()
function which serves to suspend or unsuspend invocation for a list of messages. This is a safety for the 2-step bridging, if the team notices "fantom/fake" transactions that can be proven (a bug in the Merkle tree) during the proof cooldown window, they can intervene to stop the message. By suspending the message or the list of messages, they will be setting thereceivedAt
timestamp at type(uint64).max so the current timestamp can't be greater than thereceivedAt
+ invocationDelay so messages can't be processed or recalled. The vulnerability is that we don't have the needed checks thatrecallMessage()
andprocessMessage()
do forretryMessage()
.If a fantom transaction failed to be processed (e.g. due to low gas) and is with status
RETRIABLE
and is noticed after the processing has failed, it can't be suspended as there are no such checks inretryMessage()
allowing for anyone to retry and pass the message as a real one.Proof of Concept
The
suspendMessages()
function can suspend/unsuspend a list of messages by suspending their invocation, meaningreceivedAt
will be set totype(uint64).max
and the invocation checksblock.timestamp > invocationDelay + receivedAt
will always fail:Invocation checks are present in both
processMessage()
andrecallMessage()
:if (block.timestamp >= invocationDelay + receivedAt)
The above-mentioned checks wouldn't hold true if the messages is "suspended" and
receivedAt
is set totype(uint64).max
. If the above check fails, messages won't be invoked:If a message with a status
RETRIABLE
is spotted to be a fantom one, it can't be suspended as no such checks are present within theretryMessage()
function, allowing for fake/fantom messages to be invoked:Tools Used
Manual Review
Recommended Mitigation Steps
Add the same checks present in
recallMessage()
andprocessMessage()
forretryMessage()
as well.Assessed type
Invalid Validation
The text was updated successfully, but these errors were encountered: