Use of depreciated OZ Function isContract(), can be bypassed #96
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
edited-by-warden
insufficient quality report
This report is not of sufficient quality
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
Lines of code
https://github.com/code-423n4/2024-03-taiko/blob/f58384f44dbf4c6535264a472322322705133b11/packages/protocol/contracts/bridge/Bridge.sol#L493
Vulnerability details
Impact
Bypass Logic to Verify if Caller is a Contract (Deprecated by OZ)
Proof of Concept
The
processMessage()
calls the_invokeMessageCall()
function to invoke the message call which in turn checks if theto
value is a contract or not and if it is, then it assignsfalse
value tosuccess_
parameter (L495).However, OZ's official docs state that
isContract
function can return false for an address where a contract lived but, but was destroyed and also, the function has been deprecated. In which case the following condition:will resolve as
false
and the funds will get transferred regardless.Tools Used
Manual audit (VS Code)
Recommended Mitigation Steps
Make a function that verifies their EOA status with 2 calls that must be on 2 different blocks.
Assessed type
call/delegatecall
The text was updated successfully, but these errors were encountered: