Large Arctic Kookaburra
Medium
The observe()
call in BalancerOracleAdapter.sol:107 is vulnerable to TWAP price manipulation. Due to:
- The pools obseravation cardinality not being checked
- Whether the requested time window
secondAgo
is available
If the pool cardinality is 1, it'll only store the most recent observation and will fall back to using current price instead of historical data making TWAP meaningless as it's just current price. This makes the price easier to manipulate
No response
No response
No response
No response
This vulnerability can lead to inaccurate price calculations, potentially resulting in loss of funds
No response
- Revert if oldestObservation <
secondsAgo
to ensure the full intended TWAP period is used. - Check the cardinality of the pool and set it to a reasonable number, so a number of observations would be used to calculate the TWAP