Skip to content
Access control Audit finding Advanced

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.

berndartmueller Follow

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.

Go
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,

The issue is that the emittingContract is not necessarily the contract that initiated the CCTX on ZEVM.

It will be either set to

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(): Use ZRC20Withdrawal.From as the sender address
  • ProcessZetaSentEvent(): Use zetaTxSenderAddress as the sender address

The original report as published on Sherlock, by berndartmueller. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

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.

More by berndartmueller

View all

97 more disclosed reports, best first.

More from ZetaChain Cross-Chain

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

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.