Closed sherlock-admin closed 1 year ago
Agree that this should be updated to be consistent across auctioneers. We will use the function value since it incorporates the capacity as a limit. The maxPayout
value from this function is currently only used in a view function in the Aggregator.
Escalate for 10 USDC.
There is no impact of loss of funds shown in this issue. By the Sherlock criteria it does not qualify for a Medium.
Watson states as impact that "any parties (internal or external) that rely on the getMarketInfoForPurchase function will have an issue because of the inconsistent result returned by the interface." However this explanation is not concrete, does not include a POC, and does not show a scenario where loss of funds are possible.
Sponsor notes that the incorrect function is " only used in a view function in the Aggregator."
Medium criteria state that:
Medium: There is a viable scenario (even if unlikely) that could cause the protocol to enter a state where a material amount of funds can be lost.
This has not been shown.
Escalate for 10 USDC.
There is no impact of loss of funds shown in this issue. By the Sherlock criteria it does not qualify for a Medium.
Watson states as impact that "any parties (internal or external) that rely on the getMarketInfoForPurchase function will have an issue because of the inconsistent result returned by the interface." However this explanation is not concrete, does not include a POC, and does not show a scenario where loss of funds are possible.
Sponsor notes that the incorrect function is " only used in a view function in the Aggregator."
Medium criteria state that:
Medium: There is a viable scenario (even if unlikely) that could cause the protocol to enter a state where a material amount of funds can be lost.
This has not been shown.
You've created a valid escalation for 10 USDC!
To remove the escalation from consideration: Delete your comment.
You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final.
Issue fixed here: https://github.com/Bond-Protocol/bonds/pull/48
Escalation accepted
Not a valid medium Given that this affects only the view function. Considering this issue a low
Escalation accepted
Not a valid medium Given that this affects only the view function. Considering this issue a low
This issue's escalations have been accepted!
Contestants' payouts and scores will be updated according to the changes made on this issue.
xiaoming90
medium
Inconsistent max payout returned from
getMarketInfoForPurchase
across different auctioneersSummary
The max payout returned by
getMarketInfoForPurchase
function has a different meaning depending on the type of Auctioneer. Given these differences, any parties (internal or external) that rely on thegetMarketInfoForPurchase
function will have an issue because of the inconsistent result returned by the interface.Vulnerability Detail
The
BondBaseFPA.getMarketInfoForPurchase
andBondBaseOFDA.getMarketInfoForPurchase
functions retrieve the market's max payout directly frommarket.maxPayout
.However, for the
BondBaseOSDA.getMarketInfoForPurchase
function, it was done differently. It calls theBondBaseOSDA.maxPayout
function instead of accessing themarket.maxPayout
to obtain the max payout of a market.The result returned from the
BondBaseOSDA.maxPayout
function is different from themarket.maxPayout
because if the capacity is lower than the max payout, the max payout will be capped at the remaining capacity. Refer to Line 573 below.Assume the max payout of an FPA, OFDA, and OSDA market is 100, and their current capacity is 50.
Calling
BondBaseFPA.getMarketInfoForPurchase
andBondBaseOFDA.getMarketInfoForPurchase
functions will return 100 as the max payout, while callingBondBaseOSDA.getMarketInfoForPurchase
function will return 50 as the max payout.Impact
The max payout returned by
getMarketInfoForPurchase
function has a different meaning depending on the type of Auctioneer. For FPA and OFDA, it means the max payout that is configured during market initialization, and it stays constant. For OSDA, it means the maximum amount of payout tokens that can be issued to a user at this point in time, and it is not constant and takes into consideration of the current capacity of the market.Given these differences, any parties (internal or external) that rely on the
getMarketInfoForPurchase
function will have an issue because of the inconsistent result returned by the interface.Code Snippet
https://github.com/sherlock-audit/2023-02-bond/blob/main/bonds/src/bases/BondBaseFPA.sol#L314
https://github.com/sherlock-audit/2023-02-bond/blob/main/bonds/src/bases/BondBaseOFDA.sol#L422
https://github.com/sherlock-audit/2023-02-bond/blob/main/bonds/src/bases/BondBaseOSDA.sol#L505
Tool used
Manual Review
Recommendation
Standardize the max payout returned from the
getMarketInfoForPurchase
function across all the auctioneers (FPA, OFDA, OSDA, SDA)