Closed sherlock-admin closed 2 years ago
Not an issue, works as expected. The approve proof has to already be in block (meaning at least one block before current). For current block blockhash would be returned as 0 since it's not finalized, and this would result in the failure of checks and revert of tx.
GalloDaSballo
medium
M-03 Blockhash doesn't work for current block
Summary
https://github.com/sherlock-audit/2022-10-mover/blob/main/cardtopup_contract/contracts/HardenedTopupProxy.sol#L1058-L1059
Should check that block provided is less than current as the current blockHash cannot be known
Vulnerability Detail
Checking for blockhash(block.number) will always return 0
Impact
Am not sure value can be stolen via this
Code Snippet
If the value was non-zero we'd get a revert
However we do not, meaning a 0 blockhash will be provided
Tool used
Manual Review
Recommendation
Prevent using current block