Oracle's price update mechanism lacks cumulative increase controls, allowing gradual but significant price manipulation through a series of updates that each stay within bounds. #115
YieldOracle contracts allow for systematic price manipulation through a series of small updates that individually comply with maxPriceIncrease limits but compound to create significant price movements.
This vulnerability directly compromises the core price stability mechanism of the protocol, enabling systematic value extraction through oracle manipulation.
The key insight is that while individual price updates respect bounds, the cumulative effect creates unbounded geometric growth potential.
function updatePrice(uint256 price) external onlyOracle {
// @Issue - Delay check only prevents rapid updates but not incremental manipulation
require(lastUpdate + updateDelay < block.timestamp, "Insufficient update delay"); // @Issue: Each check is isolated, enabling sequential manipulation
// @Issue - Price state updates allow baseline manipulation
if (nextPrice != NO_PRICE) {
previousPrice = currentPrice;
currentPrice = nextPrice;
emit PriceCommitted(currentPrice);
}
// @Issue - Single-step price bound check enables incremental manipulation
require(price - currentPrice <= maxPriceIncrease, "Price out of bounds");
nextPrice = price;
}
InvestToken.sol - Price Oracle Dependency
function convertToAssets(uint256 shares) public view returns (uint256) {
// @Issue - Direct reliance on oracle price without manipulation safeguards
return yieldOracle.sharesToAssets(shares);
}
The price oracle system allows for incremental price manipulation through a series of small updates that each stay within bounds but compound to create significant price movements. This enables an attacker to gradually push the exchange rate in their desired direction, because the YieldOracle implementation allows systematic price manipulation through incremental updates, enabling an attacker to influence the USDE/InvestToken exchange rate for profit.
The fundamental issue lies in the price validation mechanism that:
Only checks against the immediate previous price
Allows geometric growth through sequential updates
Lacks cumulative increase controls
Real-world exploitation path:
Step 1: Initial State
- USDE/InvestToken rate: 1.0
- maxPriceIncrease: 10%
Step 2: Attack Sequence
T=0: Update price to 1.10 (within 10% bound)
T=1h: Price commits
T=1h: Update to 1.21 (within 10% of new baseline)
T=2h: Price commits
Result: 21% total increase despite 10% limit
Attack Scenario
Exploitation strategy for the price manipulation vulnerability
Optimal Timing Pattern
// Wait exactly updateDelay + 1 between updates
vm.warp(block.timestamp + oracle.updateDelay() + 1);
// Wait minimum commitDelay + 1 to lock in prices
vm.warp(block.timestamp + oracle.commitDelay() + 1);
Github username: @0xbrett8571 Twitter username: 0xbrett8571 Submission hash (on-chain): 0xd98c4d81f30a950aed79ac21aeb951f280b963ee8f96f9da7b34eb9714f0557d Severity: high
Description:
Description
YieldOracle contracts allow for systematic price manipulation through a series of small updates that individually comply with
maxPriceIncrease
limits but compound to create significant price movements.This vulnerability directly compromises the core price stability mechanism of the protocol, enabling systematic value extraction through oracle manipulation.
The key insight is that while individual price updates respect bounds, the cumulative effect creates unbounded geometric growth potential.
YieldOracle.sol#L69-L85
InvestToken.sol - Price Oracle Dependency
The price oracle system allows for incremental price manipulation through a series of small updates that each stay within bounds but compound to create significant price movements. This enables an attacker to gradually push the exchange rate in their desired direction, because the YieldOracle implementation allows systematic price manipulation through incremental updates, enabling an attacker to influence the USDE/InvestToken exchange rate for profit.
The fundamental issue lies in the price validation mechanism that:
Real-world exploitation path:
Attack Scenario
Exploitation strategy for the price manipulation vulnerability
Attachments
Logs:
Consider either of the two mitigation.
This fix implements rolling window price tracking and cumulative increase limits while maintaining individual update bounds.