Attacker will drain vault assets through token validation bypass
Summary
Missing validation between deposit_token and allowed_token.mint_account will cause a complete loss of assets for the vault as attackers will deposit worthless tokens using legitimate token hashes.
Root Cause
In deposit.rs the deposit_token account lacks validation against allowed_token.mint_account, allowing any token mint to be used when correct token hash is provided.
System validates token_hash against AllowedToken but never checks deposit_token matches allowed_token.mint_account
Attacker's worthless tokens are accepted as if they were legitimate tokens
Attacker can now withdraw legitimate tokens from vault
Impact
The vault suffers potential complete loss of legitimate token assets. The attacker gains all withdrawn legitimate tokens while only spending worthless self-created tokens.
Plain Corduroy Goblin
High
Attacker will drain vault assets through token validation bypass
Summary
Missing validation between deposit_token and allowed_token.mint_account will cause a complete loss of assets for the vault as attackers will deposit worthless tokens using legitimate token hashes.
Root Cause
In deposit.rs the deposit_token account lacks validation against allowed_token.mint_account, allowing any token mint to be used when correct token hash is provided.
https://github.com/sherlock-audit/2024-09-orderly-network-solana-contract/blob/main/solana-vault/packages/solana/contracts/programs/solana-vault/src/instructions/vault_instr/deposit.rs#L49
Internal pre-conditions
No response
External pre-conditions
No response
Attack Path
Impact
The vault suffers potential complete loss of legitimate token assets. The attacker gains all withdrawn legitimate tokens while only spending worthless self-created tokens.
PoC
No response
Mitigation
No response