The requestSerialize()
and requestDeserialize()
functions in the Protocol library do not perform input validation on the lengths of arrays within the Request
struct. This omission could lead to inconsistencies between the tokenIds
, tokenValues
, tokenURIs
, and newOwners
arrays, potentially causing unexpected behavior or errors during the bridging process.
In the current implementation, the functions assume that these arrays have matching lengths:
If these arrays have mismatched lengths, it could lead to incorrect serialization or deserialization, potentially corrupting the bridged data or causing the transaction to revert unexpectedly.
Manual Review
To mitigate this risk, it's recommended to add input validation at the beginning of both requestSerialize()
and requestDeserialize()
functions. This validation should ensure that all relevant arrays have matching lengths.
Add the following checks at the start of requestSerialize()
:
Similar checks should be added at the end of requestDeserialize()
to ensure the deserialized data is consistent.
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.