The _extractParametersFromProof
function applies an unnecessary keccak256
hash to all PARAM_SLOTS[i]
values when extracting storage slot data. This double hashing affects all parameters (params[0] to params[6]), including literal slots (e.g., 21 for total_debt) and the calculated slot for balanceOf(self). As a result, all extracted values are likely incorrect, disrupting the data passed to SCRVUSD_ORACLE
for price updates.
In the function _extractParametersFromProof
:
The function hashes each PARAM_SLOTS[i]
value with keccak256(abi.encode(...))
before passing it to extractSlotValueFromProof
.
For literal slots (e.g., PARAM_SLOTS[1] = 21 for total_debt):
Expected: Slot 21 should be used directly to fetch total_debt
.
Actual: keccak256(abi.encode(21))
is used, which points to an unrelated slot.
For the computed slot (PARAM_SLOTS[7] = keccak256(abi.encode(18, SCRVUSD))):
Expected: A precomputed slot like keccak256(abi.encode(SCRVUSD, 18))
should be used directly.
Actual: keccak256(abi.encode(keccak256(abi.encode(18, SCRVUSD))))
is used, further deviating from the correct slot.
This affects all extracted params values (total_debt
, total_idle
, totalSupply
, etc ).
Data Corruption: All params values (params[0] to params[6]) passed to SCRVUSD_ORACLE
are incorrect, likely breaking the oracle’s ability to compute accurate prices or validate state.
Financial Risk: If SCRVUSD
is a token contract and the oracle relies on these parameters (e.g., totalSupply, total_debt) for pricing or liquidity, this could lead to significant financial miscalculations or exploitable errors.
Manual code review
Fix the logic: Remove the extra keccak256
hash to use PARAM_SLOTS[i]
directly
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.