V1 ZEVM logs incorrectly use the `emittingContract` address as the CCTX `sender` address
The ZEVM log processing functions incorrectly use the emitting contract address as the CCTX sender, which may not be the actual initiator. This can cause revert refunds to be sent to the wrong address and bypass access controls on the receiving contract.
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2025-04-zetachain-cross-chain-judging/issues/318
This issue has been acknowledged by the team but won't be fixed at this time.
Found by
berndartmueller
Summary
The ProcessZRC20WithdrawalEvent() and ProcessZetaSentEvent() functions use the emittingContract address as the to address as the CCTX sender when processing v1 ZEVM logs.
This is not necessarily the contract that initiated the CCTX on ZEVM, which can lead to revert refunds going to the wrong address and access protection issues on the receiving contract.
Root Cause
When processing ZEVM v1 logs, ProcessZRC20WithdrawalEvent()#L195 uses the emittingContract address as the to address as the CCTX sender.
156: func (k Keeper) ProcessZRC20WithdrawalEvent(
157: ctx sdk.Context,
158: event *zrc20.ZRC20Withdrawal,
159: emittingContract ethcommon.Address,
160: txOrigin string,
161: ) error {
... // [...]
193: msg := types.NewMsgVoteInbound(
194: "",
195: ❌ emittingContract.Hex(),
Same as ProcessZetaSentEvent().
This sender address will be used in a few places. For example,
- as the
zetaTxSenderAddressaddress that is passed to the external chain when callingZetaConnector.onReceive(), used for authentication. - and in V2 also as the revert address that receives the funds in case of the revert process.
The issue is that the emittingContract is not necessarily the contract that initiated the CCTX on ZEVM.
It will be either set to
msg.Towhen regularly processing ZEVM logs. Which is the first contract that was called in the ZEVM transaction.- the inbound receiver address in
HandleEVMDeposit - the outbound revert receiver address in
processFailedOutboundV2when reverting a CCTX on ZEVM
Those addresses would be the CCTX sender. However, it could be a nested contract call that originated the CCTX, which is the rightful sender.
Tl;dr
Using an intermediary contract on the zEVM that initiates outbound CCTXs causes refund and access protection issues on the receiving contract.
Internal Pre-conditions
N/A
External Pre-conditions
N/A
Attack Path
N/A
Impact
- Revert refunds go to the wrong address
- Access protection issues on the receiving contract when checking
zetaTxSenderAddress
PoC
N/A
Mitigation
ProcessZRC20WithdrawalEvent(): UseZRC20Withdrawal.Fromas thesenderaddressProcessZetaSentEvent(): UsezetaTxSenderAddressas thesenderaddress
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely, the code uses the emitting contract address as the sender instead of the actual initiator address from the event data.
Impact
Revert refunds could be sent to the wrong address, and access protection on the receiving contract may be bypassed when checking the sender address.
What the attacker needed
None
The fix
The functions should be fixed to use the correct sender address: for ZRC20 withdrawals, use the `From` field of the event; for Zeta sent events, use the `zetaTxSenderAddress`.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When a cross-chain transaction is started, the system records who sent it. Here, the code mistakenly records the address of the contract that emitted an event, not the address that actually started the transaction. This means refunds might go to the wrong place, and security checks on the receiving side could be fooled.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.