DeFiFoundry
50,000 USDC
View results
Submission Details
Severity: low
Invalid

Insufficient Validation that could lead to incorrect price validation and protocol instability

Summary

The _check function does not fully validate the Chainlink price feed data, such as checking for negative prices or ensuring the feed is not stale.

Vulnerability Details

this vulnerability can be found in the lines of code below;

https://github.com/CodeHawks-Contests/2025-02-gamma/blob/84b9da452fc84762378481fa39b4087b10bab5e0/contracts/KeeperProxy.sol#L188-L198

  • The Chainlink price feed returns a negative price due to a bug or manipulation.

  • The _check function does not handle negative prices, leading to incorrect validation.

  • Example:

    (, int chainLinkPrice, , uint256 updatedAt, ) = AggregatorV2V3Interface(dataFeed[token]).latestRoundData();
    require(updatedAt > block.timestamp - maxTimeWindow[token], "stale price feed");

    If chainLinkPrice is negative, the validation will fail silently.

Impact

Insufficient validation could lead to incorrect price validation and protocol instability

Tools Used

Deepseek

Recommendations

  • Add checks for negative prices in the _check function.

  • Ensure the price feed is not stale by validating the updatedAt timestamp.

  • Implement additional validation mechanisms to ensure data accuracy.

Updates

Lead Judging Commences

n0kto Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
Assigned finding tags:

Informational or Gas

Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelihood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.

Suppositions

There is no real proof, concrete root cause, specific impact, or enough details in those submissions. Examples include: "It could happen" without specifying when, "If this impossible case happens," "Unexpected behavior," etc. Make a Proof of Concept (PoC) using external functions and realistic parameters. Do not test only the internal function where you think you found something.

Support

FAQs

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

Give us feedback!