Closed code423n4 closed 2 years ago
Seems like the contract is not working as intended.
I don't believe that the design intends for the whitelisted addresses to use the router. Will leave open for sponsor review and confirmation, but most likely this is invalid.
The Gateway Router will generally only be used by end users bridging tokens through the Arbitrum bridge UI. Whitelisted contracts will only perform direct calls to the L1GraphTokenGateway, so indeed there's no need to allow messages from the router to trigger callhooks.
closing as invalid.
Lines of code
https://github.com/code-423n4/2022-10-thegraph/blob/7ea88cc41f17f2d49961aafec7ebe72daeaad3f9/contracts/gateway/L1GraphTokenGateway.sol#L214
Vulnerability details
Impact
Whitelisted entity cannot use callhook if they use router
Proof of Concept
In the
L1GraphTokenGateway
, thecallhookWhitelist
was checked for themsg.sender
. If a whitelisted entity is using router, the router will be themsg.sender
and the whitelisted entity is thefrom
. Thus, they cannot use the callhook.Tools Used
Manual review
Recommended Mitigation Steps
consider check the
callhookWhitelist
for thefrom
address.