Withdrawn USDC from SolanaVault can be replaced with any token
Summary
There is no validation that the deposit_token account is USDC or the allowed_token when running lz_receive(). Anyone that runs lz_receive() on the withdrawal message can use a worthless token for deposit_token so the recipient gets that worthless token instead of USDC.
A user withdraws USDC from a source chain to Solana.
Attack Path
The Attacker deploys a worthless token.
The Attacker then deposits the worthless token into SolanaVault so the vault_token_account is created.
Once the withdrawal message has been verified, the attacker executes it by calling lz_receive() on SolanaVault with the appropriate params for the target message. Typically, the Executor does this but it is open to anyone.
The Attacker passes a worthless deposit_token so the recipient receives the worthless token instead of USDC.
Note that is a different issue from the Attacker sending the tokens to themselves due to lacking validation on the user_deposit_wallet.
Impact
The withdrawer loses all their USDC in place of worthless tokens. There is no cost to the attacker apart from gas. This is a permanent loss of funds.
PoC
No response
Mitigation
Consider validating that the deposit_token is the allowed_token.
Tangy Mocha Fox
High
Withdrawn USDC from
SolanaVault
can be replaced with any tokenSummary
There is no validation that the
deposit_token
account is USDC or theallowed_token
when runninglz_receive()
. Anyone that runslz_receive()
on the withdrawal message can use a worthless token fordeposit_token
so the recipient gets that worthless token instead of USDC.Root Cause
In
oapp_lz_receive.rs::35-133
, there is no validation thatdeposit_token
is USDC or theallowed_token
.Internal pre-conditions
No response
External pre-conditions
Attack Path
deposits
the worthless token into SolanaVault so thevault_token_account
is created.lz_receive()
on SolanaVault with the appropriateparams
for the target message. Typically, the Executor does this but it is open to anyone.deposit_token
so the recipient receives the worthless token instead of USDC.Note that is a different issue from the Attacker sending the tokens to themselves due to lacking validation on the
user_deposit_wallet
.Impact
The withdrawer loses all their USDC in place of worthless tokens. There is no cost to the attacker apart from gas. This is a permanent loss of funds.
PoC
No response
Mitigation
Consider validating that the
deposit_token
is theallowed_token
.