Open hats-bug-reporter[bot] opened 9 months ago
The calldata
is user provided, so he only hurts himself.
Adding calldata to the cross-chain swap is expected to be done by advanced users. As such, they should we aware of our encoding scheme for the calldata. When not needed, I prefer not having a check and in this case I am leaning not having the check.
Github username: -- Twitter username: -- Submission hash (on-chain): 0xf589e38631045ac8160c778bc6fdbdd028b70693fca9cb3aa54490520b12b224 Severity: medium
Description: Description\ The CCI contract makes external call to a user supplied address during the cross chain swap. Before making the external
onCatalystCall
the CCI contract tried to decode the address and calldata for that call.This is done in these functions:
_handleReceiveAssetFallback
https://github.com/catalystdao/catalyst/blob/main/evm/src/CatalystChainInterface.sol#L536-L537
It can be seen that this function tries to decode
dataTarget
address.In case a user supplied invalid calldata (length < 20 bytes) then this decoding will fail abruptly, resulting in the
CCI.receiveMessage
call getting reverted.Attachments
Test case was added to
ExampleTest.t.sol
Output:
The
ff
in the log shows that theCCI.receiveMessage
call failed silently.