Dria

Swan
NFTHardhat
21,000 USDC
View results
Submission Details
Severity: medium
Invalid

Oracle Request Overwriting

Summary

Both oraclePurchaseRequest() and oracleStateRequest() allow overwriting existing requests.

Vulnerability Details

function oracleStateRequest(bytes calldata _input, bytes calldata _models) external onlyAuthorized {
// check that we are in the Withdraw phase, and return round
(uint256 round,) = _checkRoundPhase(Phase.Withdraw);
oracleStateRequests[round] =
swan.coordinator().request(SwanBuyerStateOracleProtocol, _input, _models, swan.getOracleParameters());
}
function oraclePurchaseRequest(bytes calldata _input, bytes calldata _models) external onlyAuthorized {
// check that we are in the Buy phase, and return round
(uint256 round,) = _checkRoundPhase(Phase.Buy);
oraclePurchaseRequests[round] =
swan.coordinator().request(SwanBuyerPurchaseOracleProtocol, _input, _models, swan.getOracleParameters());
}

No check if a request already exists for the round. Owner and operator can overwrite each other's requests. Potential loss of oracle fees if previous request wasn't processed. Malicious operator could override legitimate requests

Impact

loss of oracle fees if previous request wasn't processed.

Tools Used

Manual Review

Recommendations

// Add protection against overwriting

if (oraclePurchaseRequests[round] != 0) {

revert ExistingRequest(round);

}

Updates

Lead Judging Commences

inallhonesty Lead Judge 12 months ago
Submission Judgement Published
Invalidated
Reason: Known issue

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.