The loadExisting()
function in WithdrawalRequest.sol
assumes that a withdrawal request exists if timestamp != 0
. However, an attacker can manually craft a fake request by setting timestamp = 1
, bypassing the existence check. This can lead to unauthorized fund withdrawals or reward claims.
WithdrawalRequest.sol
loadExisting()
The function checks if withdrawalRequest.timestamp != 0
to determine if the request exists.
An attacker can manually set timestamp = 1
and bypass this check.
This allows an attacker to simulate a valid withdrawal request and potentially withdraw unallocated funds.
The contract assumes timestamp != 0
is a valid indicator of an existing withdrawal request.
There is no explicit verification of whether the request was genuinely created by the contract.
No additional authentication flag is used to track valid withdrawal requests.
Unauthorized Withdrawals Attackers may simulate fake withdrawal requests and withdraw funds they never deposited.
Fake Reward Claims Attackers can trick the system into issuing rewards based on non-existent withdrawal requests.
Potential Loss of Funds Users’ deposits and protocol reserves may be at risk if an attacker abuses this vulnerability.
Foundry (Forge) – To simulate and test the vulnerability.
Slither – Static analysis to identify insecure storage validation.
Manual Review – Code inspection to confirm logical flaws.
Below is a Foundry test that exploits this issue by manually creating a fake withdrawal request with timestamp = 1
.
Without fix: The test fails because the attacker can bypass the existence check and load an invalid withdrawal request.
With fix: The test passes, as the contract correctly identifies the fake request and reverts.
initialized
Flag**Modify the Data
struct to include an initialized
flag:
loadExisting()
to Validate initialized
**The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.