Open c4-bot-9 opened 11 months ago
Empty string instead of using ZetaConnectorZEVMZetaSent.Message
DadeKuma marked the issue as sufficient quality report
DadeKuma marked the issue as primary issue
lumtis (sponsor) confirmed
0xean marked the issue as satisfactory
0xean marked the issue as selected for report
Lines of code
https://github.com/code-423n4/2023-11-zetachain/blob/b237708ed5e86f12c4bddabddfd42f001e81941a/repos/node/x/crosschain/keeper/evm_hooks.go#L221
Vulnerability details
Impact
Cross-chain Zeta messages originating from the zEVM have an empty
message
field, preventing thedestinationAddress
contract from being called.This renders the cross-chain messaging functionality useless as the
message
is never used and potentially causes a loss of funds (if assets have been burned on the zEVM) or locked funds (if unable to unlock on the receiver end).Proof of Concept
zEVM transactions are post-processed in the
PostTxProcessing
function of thex/crosschain
module. Specifically, the goal is to parse and processZetaSent
and ZRC-20Withdrawal
events and send them to the corresponding, external receiver chains.Any emitted
ZetaSent
events are parsed and processed in theProcessZetaSentEvent
function. This event is emitted by theZetaConnectorZEVM.send
function to send a cross-chain message to an external chain.The message input,
ZetaInterfaces.SendInput
, allows the sender to specify amessage
that is forwarded to the receiver contract (destinationAddress
) on the destination chain.Specifically, once the cross-chain message is received by the
onReceive
function of the ZetaConnector contract on the receiver chain (e.g.,ZetaConnectorEth
orZetaConnectorNonEth
), thedestinationAddress
'sonZetaMessage
function is called and themessage
is provided as a parameter.However, the user-specified
message
is not used, instead, it is overwritten by an empty string in line 221.As a result, the destination contract is never called as the
message
is empty.Tools Used
Manual review
Recommended mitigation steps
Consider using the user-specified
message
instead of overwriting it with an empty string.Assessed type
Other