The LLMOracleCoordinator::request
function includes a protocol
field, specified as a 32-byte data type. According to documentation, this field should be a short string limited to 32 bytes. However, the function does not validate the length of protocol
, meaning if the input exceeds 32 bytes, it will be automatically truncated without warning. This can lead to unexpected outcomes, as only the first 32 bytes are preserved, potentially resulting in incorrect protocol data being stored and processed.
The protocol
parameter is expected to be a bytes32
value. If the caller supplies data longer than 32 bytes, it will be silently truncated when cast to bytes32
, potentially resulting in data loss or unexpected values. There is no length validation for protocol
, making it possible for users to pass in an unintended protocol identifier if unaware of the truncation behavior.
Call the request
function with a protocol
value exceeding 32 bytes.
Observe that only the first 32 bytes of the protocol
value are retained, with the remaining bytes discarded.
The task request may proceed with an incorrect or unintended protocol identifier due to truncation.
Data truncation of the protocol
field may cause misrepresentation or incorrect processing of tasks, which can lead to:
Incorrect protocol identification, potentially causing misrouting or handling of tasks.
Manual code review
Add a validation check in the request
function to ensure the protocol
string length does not exceed 32 bytes before it is cast to bytes32
. This will ensure that the function reverts if the input exceeds the specified limit, preventing unintended truncation.
This check will revert the transaction if the protocol
input length exceeds the 32-byte limit, ensuring that only valid data is accepted.
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.