Dria

Swan
NFTHardhat
21,000 USDC
View results
Submission Details
Severity: low
Valid

Lack of Validation for Non-Empty `input` in `request` Function

Summary

The request function in LLMOracleCoordinator lacks validation to ensure that the input parameter is non-empty. As a result, a request can be created with an empty input, which may lead to unexpected behavior or wasted computational resources.

Vulnerability Detail

The request function facilitates an LLM generation task by accepting parameters such as protocol, input, and others, and then generates a taskId for processing. According to the function’s documentation, input is required to be non-empty. However, there is no actual validation within the function to enforce this condition. This omission could allow empty inputs, potentially resulting in ineffective or invalid LLM generation requests.

Since the input field may be used by the LLM oracles for processing, having an empty input could lead to:

  • Unwanted results (e.g., tasks that process empty data)

  • Inefficient use of oracle resources

  • Potential denial of service (DoS) vulnerabilities if numerous empty requests flood the system

The input should be validated at the beginning of the function to ensure it is non-empty, thus adhering to the expected behavior stated in the documentation.

Impact

Allowing empty inputs in the request function can lead to unexpected behavior in the oracle processing and may contribute to inefficient resource usage. In the worst case, malicious actors could exploit this to create empty requests that might impact system performance or cause unnecessary resource allocation on the oracle nodes.

Tool used

Manual Code Review

Recommendation

Implement a check at the beginning of the request function to validate that the input parameter is non-empty. This could be achieved with a simple require statement:

require(input.length > 0, "Input must be non-empty");

This modification will enforce the intended constraint, preventing empty input values from being processed and ensuring that the function behaves as documented.

Updates

Lead Judging Commences

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Validated
Assigned finding tags:

No validation of input and models in `request` function

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.