ScrvusdVerifierV1::_extractParametersFromProof
and ScrvusdVerifierV2::_extractPeriodFromProof
functions use the RLPReader library to parse RLP-encoded nodes in the Ethereum trie, but when parsing a bytes string as a RLPItem
there is no check to verify the length of the specified RLP encoding matches the actual length of the payload.
Let's see the following example:
toRlpItem
should've reverted because the encoded length of three bytes is larger than the length of the payload. Then toList
access the malformed data and encodes to 16 bytes, which is also larger than the underlying payload.
Add a check in both functions of the verifiers to validate the length of the proof matches the expected length of prefix + payload based on the encoded prefix.
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.