You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 26, 2023. It is now read-only.
github-actionsbot opened this issue
Mar 1, 2023
· 0 comments
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
Insufficient validation of oracle's data feed is present. There is no check for stale prices and rounding. Price can be stale, leading to incorrect return amounts.
function getPrice(address_token) externalviewoverridereturns (uint256) {
// remap token if possibleaddress token = remappedTokens[_token];
if (token ==address(0)) token = _token;
uint256 maxDelayTime = maxDelayTimes[token];
if (maxDelayTime ==0) revertNO_MAX_DELAY(_token);
// try to get token-USD priceuint256 decimals = registry.decimals(token, USD);
(, int256answer, , uint256updatedAt, ) = registry.latestRoundData(
token,
USD
);
if (updatedAt <block.timestamp- maxDelayTime)
revertPRICE_OUTDATED(_token);
return (answer.toUint256() *1e18) /10**decimals;
}
Impact
It is possible for the price to be stale, resulting in the return value being wrong.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelMediumA valid Medium severity issueRewardA payout will be made for this issue
WatchDogs
medium
The Oracle data feed is insufficiently validated.
Summary
The Oracle data feed is insufficiently validated.
Vulnerability Detail
Insufficient validation of oracle's data feed is present. There is no check for stale prices and rounding. Price can be stale, leading to incorrect return amounts.
Impact
It is possible for the price to be stale, resulting in the return value being wrong.
Code Snippet
https://github.com/sherlock-audit/2023-02-blueberry/blob/main/contracts/oracle/ChainlinkAdapterOracle.sol#L76
Tool used
Manual Review
Recommendation
Validate data feed
Duplicate of #94
The text was updated successfully, but these errors were encountered: