Dria

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

Round Check Missing In Purchase

Summary

In the current implementation, the BuyerAgent::purchase and Swan::purchase functions are used to buy assets. There is no check to confirm that the asset being purchased is listed in the same round as the buyer's intended round. This oversight can lead to purchasing assets from previous rounds, which contradicts the intended protocol logic.

Vulnerability Details

Scenario:

  1. The Oracle Coordinator provides a response containing a list of assets.

  2. One or more assets in this list may be listed in a previous round rather than the current round.

  3. Without a round check, the BuyerAgent might inadvertently buy an asset listed in an outdated round, which disrupts the protocol's state consistency.

Impact

The BuyerAgent could end up purchasing assets that are no longer relevant to the current round, leading to an inconsistent protocol state. This can result in unintended purchases and a mismatch between the buyer's intentions and actual transactions, potentially affecting asset allocation and fairness.

Tools Used

Manual Review

Recommendations

Add a round validation check in both BuyerAgent::purchase and Swan::purchase functions to ensure assets are only purchased within the correct listing round.

Suggested Code:

AssetListing listing = swan.getListing(asset);
if (listing.round != round) {
revert WrongRound();
}

This pseudocode example should be adapted for both methods to validate the listing round of each asset before proceeding with the purchase. This will ensure protocol integrity by allowing only current-round assets to be bought.

Updates

Lead Judging Commences

inallhonesty Lead Judge 12 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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