Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rilwan99 - DebitaPyth.sol: uses 600s instead of 90s in getThePrice() #1013

Open
sherlock-admin2 opened this issue Nov 25, 2024 · 0 comments
Open

Comments

@sherlock-admin2
Copy link

sherlock-admin2 commented Nov 25, 2024

rilwan99

Medium

DebitaPyth.sol: uses 600s instead of 90s in getThePrice()

Summary

The DebitaPyth contract's getThePrice() function allows for price data that could be up to 10 minutes old (600 seconds).

This exposes the protocol to price manipulation risks and outdated price data in volatile market conditions.

https://github.com/sherlock-audit/2024-11-debita-finance-v3/blob/main/Debita-V3-Contracts/contracts/oracles/DebitaPyth.sol#L31-L35

Root Cause

10 mins is a long time window, and token prices can change drastically during this period. This would result in inaccurate/stale price being returned from the oracle.

Internal pre-conditions

No response

External pre-conditions

  • Token price changes drastically within those 10 mins
  • High float low FDV tokens are an example

Attack Path

No response

Impact

  • Outdated price feeds could lead to inaccurate asset valuations
  • Potential for price manipulation through strategic timing of transactions
  • Higher risk during periods of high market volatility
  • Could affect liquidations, collateral calculations, and other price-dependent

PoC

No response

Mitigation

Use 90 instead of 600 in getPriceNoOlderThan()

@sherlock-admin3 sherlock-admin3 changed the title Smooth Butter Worm - DebitaPyth.sol: uses 600s instead of 90s in getThePrice() rilwan99 - DebitaPyth.sol: uses 600s instead of 90s in getThePrice() Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant