sherlock-audit / 2024-09-orderly-network-solana-contract-judging

0 stars 0 forks source link

Original Emerald Millipede - [High] Missing `deposit_token` Validation in Orderly Vaults deposit Instruction Allows Unauthorized Cross-Chain Transfers #166

Open sherlock-admin2 opened 4 days ago

sherlock-admin2 commented 4 days ago

Original Emerald Millipede

High

[High] Missing deposit_token Validation in Orderly Vaults deposit Instruction Allows Unauthorized Cross-Chain Transfers

Summary

The missing validation of deposit_token in the deposit instruction within the Orderly Vaults implementation allows attackers to deposit arbitrary tokens, potentially leading to unauthorized fund transfers across chains. Based on the LayerZero OFT model, which verifies token_mint during send instructions, Orderly Vaults should similarly validate token_mint in the deposit instruction to prevent unauthorized tokens from being deposited and transferred.

Root Cause

The design of the deposit instruction in Orderly Vaults does not validate deposit_token, allowing it to act as a free account rather than verifying it as the intended token. Without validation, arbitrary tokens can be deposited and processed for cross-chain transfers, compromising the security of the Orderly Vaults system. 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

External pre-conditions

Attack Path

Impact

Orderly Vaults could suffer losses as unauthorized tokens are deposited and transferred across chains. This vulnerability allows users to send arbitrary tokens that are not verified against deposit_token, which can lead to misuse of the cross-chain transfer mechanism and potential fund siphoning.

PoC

No response

Mitigation

No response