Closed c4-bot-8 closed 6 months ago
JustDravee marked the issue as duplicate of #25
JustDravee marked the issue as sufficient quality report
koolexcrypto marked the issue as not a duplicate
koolexcrypto marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2024-04-dyad/blob/main/src/core/VaultManagerV2.sol#L146
Vulnerability details
Impact
The
withdraw
function relies on chainlink to return the actual price at the time it callsassetPrice
function which relies on thelatestRoundData
function from chainlink oracle contract to fetch the latest price data. However, if the call tolatestRoundData
reverts due to an issue with the oracle or if the feed is blocked, it could result in a DOS scenario. Since feeds cannot be changed after they are configured, this could lead to a permanent inability to query any prices.Proof of Concept
A call to
latestRoundData
could potentially revert, making it impossible to query any prices, hindering the withdrawal process since it wont return the actual price If the feed is blocked or if there is an issue with the oracle, the contract will not be able to fetch the latest price data, resulting in a denial of service scenario. Without proper error handling, the contract will be left in a state where it cannot retrieve price information, affecting any functionality relying on accurate price data.Tools Used
manual Review
Recommended Mitigation Steps
Surround the call to
latestRoundData()
with try/catch instead of calling it directly. In a scenario where the call reverts, the catch block can be used to call a fallback oracle or handle the error in any other suitable way.Assessed type
DoS