sherlock-audit / 2024-08-sentiment-v2-judging

5 stars 5 forks source link

Polished White Coyote - Lack of Input Validation at getValueInEth for FixedPriceOracle contract #617

Closed sherlock-admin2 closed 3 months ago

sherlock-admin2 commented 3 months ago

Polished White Coyote

Low/Info

Lack of Input Validation at getValueInEth for FixedPriceOracle contract

Summary

Line: https://github.com/sherlock-audit/2024-08-sentiment-v2/blob/main/protocol-v2/src/oracle/FixedPriceOracle.sol#L32

The contract does not validate the amt parameter in the getValueInEth function.

Root Cause

Lack of input validation

Internal pre-conditions

No response

External pre-conditions

No response

Attack Path

No response

Impact

Passing extremely large or small values could cause unexpected behavior, such as overflow or underflow in calculations.

PoC

No response

Mitigation

Implement checks to validate that the amt parameter is within a reasonable range and does not cause arithmetic issues.