The contract ScrvusdVerifierV1
contains an error in computing storage slot hashes for mapping-type slots in the _extractParametersFromProof
function. Specifically, the storage position for mapping-type slots (e.g., balanceOf(address)
) has already been correctly computed in the storage definition, yet the extractSlotValueFromProof
function call incorrectly performs an extra hashing operation, causing an incorrect slot position computation:
For the mapping slots, the position was already pre-hashed correctly:
Applying an additional hash is incorrect and it creates an inconsistency with the expected behavior.
Root Cause:The contract does not differentiate clearly between static and mapping slots. Although static slots must be hashed once during verification, the mapping-type slots have been hashed correctly beforehand and must not be hashed again. The incorrect additional hashing of the mapping slot leads to an incorrect storage slot calculation, resulting in a failure to verify the state proof properly.
This vulnerability causes the contract to incorrectly verify or fail to verify real data stored in mapping slots (balanceOf(self)
).
N/A
Explicitly distinguish between static and mapping storage slots by modifying the verification logic to correctly handle hashing
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.