Malicious observer can drain Solana bridge by adding failed deposit transaction to inbound tracker
The Solana inbound observer processes transactions without checking whether they succeeded, so a malicious observer can add a failed deposit transaction to the inbound tracker and cause validators to mint unbacked ZRC20 tokens. This allows the attacker to withdraw all lamports and SPL tokens locked in the Solana bridge.
0xalpharush Follow with berndartmueller
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2025-04-zetachain-cross-chain-judging/issues/58
Found by
0xalpharush, berndartmueller
Summary
Any single entity with the admin or observer role can drain the Solana-Zetachain bridge. Deposits can be spoofed by encoding a deposit instruction such that the transaction fails yet is still processed as valid when a malicious observer adds the tx to the inbound CCTX tracker. This is due to the lack of validation on the solana transaction’s meta not containing an error. Normally, observers will not process failing transactions, but this code path fails to perform the same validation unlike its EVM counterpart. While this requires a "privileged" role, every validator is an observer and BFT consensus is supposed to be byzantine tolerant i.e. tolerate <1/3 malicious parties. Thus, one malicious observer should not be able to forge a deposit and induce honest validators to vote to mint ZRC20 Sol for failed transactions through the inbound tracker, which lacks validations for its Solana implementation.
Root Cause
The ProcessInboundEvents function does not require a transaction to have succeeded unlike the EVM inbound observer which does this correctly here. Since the instruction is decoded as if it succeeded, a malicious observer can spoof a deposit for the entire ZRC20-SOL balance and then withdraw the SOL locked in the Solana side of the bridge, stealing all lamports in the bridge. This attack could also be used to withdraw SPL tokens or perform arbitrary deposits and calls. For example, removing the writable property from the gateway’s PDA in the deposit instruction results in a failing transaction (see the anchor constraint error in the POC), and it can still be processed once added to the inbound tracker via MsgAddInboundTracker.
Internal Pre-conditions
- A malicious or negligent observer adds the a failing Solana tx that contains Gateway instructions to the inbound tracker using
MsgAddInboundTracker, resulting in all validators processing and voting to mint ZRC20 Sol on Zetachain. - The CCTX receives sufficient votes and unbacked ZRC20 Sol on Zetachain is minted.
External Pre-conditions
- Any party sends a failing transaction to the gateway with a deposit instruction (or deposit and call).
- The recipient of the ZRC20 Sol on Zetachain withdraws it and receives lamports on Solana.
Attack Path
- Any party sends a failing transaction to the gateway with a deposit instruction (or deposit and call).
- A malicious or negligent observer adds the a failing Solana tx that contains Gateway instructions to the inbound tracker using
MsgAddInboundTracker, resulting in all validators processing and voting to mint ZRC20 Sol on Zetachain. - The
ProcessInboundTrackerstask causes the spoofed CCTX to received sufficient votes, and unbacked ZRC20 Sol on Zetachain is minted. - The recipient of the ZRC20 Sol on Zetachain withdraws it and receives lamports on Solana.
Impact
All lamports and SPL tokens deposited in the Solana bridge can be stolen given deposits can be forged for any amount (they are processed despite the Gateway program causing the txs to revert).
PoC
Apply the git diff here to the node/.
Run the following tests
$ export E2E_ARGS='--verbose'
$ make start-solana-test
$ docker logs orchestrator --follow
Observe in the orchestrator's logs that the solana_deposit test passes, and ZRC20 is minted for a failing deposit transaction (fails with AnchorError caused by account: pda. Error Code: ConstraintMut. Error Number: 2000).
Mitigation
Do not process events from failing Solana txs by checking its Meta.Err is nil as this patch does.
Discussion
sherlock-admin2
The protocol team fixed this issue in the following PRs/commits: https://github.com/zeta-chain/node/pull/3914
gjaldon
Fixed by adding a check that the transaction succeeded before observing it as an Inbound.
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
Impact
All lamports and SPL tokens deposited in the Solana bridge can be stolen because deposits can be forged for any amount despite the transactions failing on Solana.
What the attacker needed
Attacker has observer or admin role; victim (or attacker) sends a failing deposit tx; transaction is added to inbound tracker
How it was found
- Send a failing transaction to the Solana gateway that contains a deposit instruction.
- A malicious observer adds that failing transaction to the inbound tracker using MsgAddInboundTracker.
- The ProcessInboundTrackers task causes the spoofed cross-chain transaction to receive enough votes, minting unbacked ZRC20 Sol on Zetachain.
- The recipient withdraws the minted ZRC20 Sol on Zetachain and receives lamports on Solana.
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.
A bridge moves assets between blockchains. Here, a special user (an observer) could tell the system that a deposit happened on Solana even though the deposit transaction actually failed. The system then created tokens on the other chain without real backing, letting the attacker take out all the real assets locked in the bridge.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.