The assertValidNonce
function in the LLMOracleCoordinator
contract incorrectly implements the Proof-of-Work (PoW) difficulty check, allowing invalid nonces to be accepted as valid. This discrepancy could compromise the integrity of the PoW system, leading to unintended acceptance of low-effort computations.
The assertValidNonce
function is designed to validate a candidate nonce
for a task by calculating a hash and comparing it to a difficulty threshold. The intended logic, as specified in the LLMOracleTask
interface, is that the computed hash should be less than the difficulty target (SHA3(taskId, input, requester, responder, nonce) < difficulty
).
However, in the current implementation:
The conditional check is >
rather than >=
, meaning that nonces resulting in hash values equal to the difficulty target are not validated as per the intended threshold.
This oversight means that some valid PoW nonces are unnecessarily rejected, potentially causing legitimate computations to be discarded. It also creates an inconsistency in how PoW difficulty is enforced, which could be exploited if the system incorrectly interprets validation boundaries.
By incorrectly rejecting nonces that meet but do not exceed the difficulty threshold, this flaw could result in:
Rejection of valid tasks and associated computational results, leading to wasted resources.
Potential exploitation, as misinterpreted thresholds might create loopholes for attackers to bypass the difficulty restriction.
Manual Code Review
To align with the intended behavior, update the conditional statement to use >=
in order to correctly enforce the difficulty boundary
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.