A malicious user can withdrawals another user's money
The vault authority signing mechanism is shared across all users, and there is no check that the withdrawal recipient matches the user who initiated the withdrawal. An attacker can use another user's valid withdrawal message to withdraw that user's funds to themselves.
0rpse Follow with 0xBoboShanti, Q7 and 10 others
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2024-09-orderly-network-solana-contract-judging/issues/99
Found by
0rpse, 0xBoboShanti, Q7, S3v3ru5, Silvermist, Tendency, chinepun, dod4ufn, g, infect3d, krikolkk, shaflow01, ubermensch
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
- User B initiates a withdrawal on the Ethereum side and a valid withdraw message is sent to the Solana.
- User A accesses the valid withdrawal messages corresponding to User B's account and calls the function before User B.
- 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
Discussion
sherlock-admin2
The protocol team fixed this issue in the following PRs/commits: https://github.com/OrderlyNetwork/solana-vault/pull/4/commits/a9f56db5e63562df9eb6a39803f3df12b7959032
gjaldon
A check was added to oapp_lz_receive() that validates that the recipient of the withdrawal is the receiver specified in the withdrawal payload.
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
Root cause
The vault authority seeds are shared across all users and there is no check that the withdrawal recipient matches the user who initiated the withdrawal.
Impact
The attacker steals the entire withdrawn amount from User B's account without any corresponding loss.
What the attacker needed
Victim initiates a withdrawal; attacker can access the withdrawal message
How it was found
- User B initiates a withdrawal on the Ethereum side, sending a valid withdraw message to Solana.
- User A accesses the valid withdrawal message for User B's account and calls the function before User B.
- Because there is no check that the message belongs to User A, the withdrawal executes and User A steals User B's money.
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 vault holds users' money and uses a single shared key to approve withdrawals. The system does not check that the person receiving the money is the same person who asked for the withdrawal. So if someone else sees a valid withdrawal request, they can use it to take the money themselves.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.