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
The auction and sale systems are interfacing with the same consignment database, permitting an auction and sale for a particular consignment to run in parallel. This can lead to malicious pendingPayout claims for active auctions that also contain an active sale.
Example:
function claimPendingPayout(uint256_consignmentId)
externaloverride
{
// Get Market Handler Storage slot
MarketHandlerLib.MarketHandlerStorage storage mhs = MarketHandlerLib.marketHandlerStorage();
// Get consignment
Consignment memory consignment =getMarketController().getConsignment(_consignmentId);
// Ensure that there is a pending payoutrequire(consignment.pendingPayout >0);
// Ensure that caller is the sellerrequire(consignment.seller ==msg.sender);
// Ensure that the sale has not yet sold outrequire((consignment.supply - consignment.releasedSupply) >0, "Sale is sold out - call closeSale instead");
// Make sure the sale exists and is running
Sale storage sale = mhs.sales[_consignmentId];
require(sale.start !=0, "Sale does not exist");
require(sale.state == State.Running, "Sale hasn't started");
// Distribute the funds (handles royalties, staking, multisig, and seller)disburseFunds(_consignmentId, consignment.pendingPayout);
getMarketController().setConsignmentPendingPayout(consignment.id, 0);
}
Recommendation:
We advise this trait of the system to be prohibited by ensuring an auction and sale for the same consignment cannot run in parallel.
The text was updated successfully, but these errors were encountered:
We were under the impression that the marketConsignment function requirement of "consignment.marketHandler == MarketHandler.Unhandled" would prevent such a scenario, are we perhaps missing something here?
i.e. we thought this line here would have prevented this vuln:
SRF-01M: Potential Consignment Vulnerability
Description:
The auction and sale systems are interfacing with the same consignment database, permitting an auction and sale for a particular consignment to run in parallel. This can lead to malicious
pendingPayout
claims for active auctions that also contain an active sale.Example:
Recommendation:
We advise this trait of the system to be prohibited by ensuring an auction and sale for the same consignment cannot run in parallel.
The text was updated successfully, but these errors were encountered: