LZ_security - The OAppLzReceive contract lacks underflow checks, which could allow an attacker to exploit this vulnerability to steal funds. #149
Labels
Sponsor Disputed
The sponsor disputed this issue's validity
LZ_security
High
The OAppLzReceive contract lacks underflow checks, which could allow an attacker to exploit this vulnerability to steal funds.
Summary
The OAppLzReceive contract lacks underflow checks, which could allow an attacker to exploit this vulnerability to steal funds.
Root Cause
https://github.com/sherlock-audit/2024-09-orderly-network-solana-contract/blob/main/solana-vault/packages/solana/contracts/programs/solana-vault/src/instructions/oapp_instr/oapp_lz_receive.rs#L117
Since there is no check on the size of withdraw_params.token_amount and withdraw_params.fee, when token_amount < fee, the calculated amount_to_transfer could result in a very large number. For example:
As a result, an attacker could exploit this vulnerability to steal funds from the vault.
Internal pre-conditions
No response
External pre-conditions
No response
Attack Path
attacker set withdraw_params.token_amount less than withdraw_params.fee
Impact
The protocol suffers a loss of funds.
PoC
No response
Mitigation
The text was updated successfully, but these errors were encountered: