Improper Escrow Check in _withdrawFromEscrow
allows unauthorized withdrawals.
The _withdrawFromEscrow
function in the StarklaneEscrow
contract checks if a token is in escrow using the _isEscrowed
function. However, this check alone is insufficient to prevent unauthorized withdrawals because it does not verify if the caller is the original depositor of the token.
Unauthorized entities can withdraw tokens from escrow.
Potential loss of user assets.
This the POC which was created in Escrow.t.sol as the function testFail_withdrawNotInEscrow
was designed to test the scenario where a token that is not in escrow is attempted to be withdrawn.
The output is as follows
This means that the withdrawFromEscrow
function returned true
, indicating that the item token ID 15 was in escrow and successfully withdrawn, which contradicts the expectation that it should not be in escrow.
Tools Used
Foundry
Ensure that only the original depositor can withdraw the token from escrow.
Add a check to verify that the caller is the original depositor.
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.