Steadefi

Steadefi
DeFiHardhatFoundryOracle
35,000 USDC
View results
Submission Details
Severity: low
Valid

Negative chainlink response not properly validated.

Summary

After consultation, the gotten chainlink response is checked to ensure that its not bad. One of requiments is that the response is not negative.

Vulnerability Details

In the _badChainlinkResponse() function,

// Check for non-positive price
if (response.answer == 0) { return true; }

This check is intended for negative price. As can be seen above, the response is only checked against 0 and not for values less than 0.

Impact

Tools Used

Manual code review

Recommendations

Change the check
if (response.answer <= 0) { return true; }

Updates

Lead Judging Commences

hans Lead Judge almost 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

Chainlink oracle answer can be negative

Very low likelihood -> evaluate the severity to LOW

Support

FAQs

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