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

0 stars 0 forks source link

Orbiting Tweed Shell - A malicious user can withdrawals another user's money #99

Open sherlock-admin2 opened 4 days ago

sherlock-admin2 commented 4 days ago

Orbiting Tweed Shell

High

A malicious user can withdrawals another user's money

Summary

A shared vault authority signing mechanism will cause unauthorized withdrawals for users, as User A can withdraw funds belonging to User B.

Root Cause

In the OAppLzReceive, the vault_authority_seeds are shared across all users, allowing any user with valid withdrawal parameters to use the same PDA signing authority. As a result, any valid withdrawal request can be signed by the vault without distinguishing which user is performing the withdrawal.

Also, there is no check that the wallet receiving the funds belongs to the same user for whom the withdrawal request was initiated. The system only checks that the withdrawal message comes from a valid sender (peer.address == params.sender), but does not verify that the user account corresponds to the sender.

Internal pre-conditions

No response

External pre-conditions

No response

Attack Path

  1. User B initiates a withdrawal on the Ethereum side and a valid withdraw message is sent to the Solana.
  2. User A accesses the valid withdrawal messages corresponding to User B's account and calls the function before User B.
  3. Since there is no check to ensure the User A uses a withdrawal message corresponding to his account, the withdraw is successfully executed and User A steals User B's money.

Impact

The attacker steals the entire withdrawn amount from User B's account without any corresponding loss.

PoC

No response

Mitigation

No response