Attacker can DOS OptimisticListing with very low cost
The OptimisticListing contract only checks that a new proposal's price per token is lower than the existing one, without constraining the collateral amount. An attacker can create a proposal with a very low collateral (e.g., 1) and a price just below the current one, blocking legitimate proposals and holding the vault hostage.
Submitted by gzeon, also found by Trust, Trust, and cccz
The only check on a new proposal is that it is priced lower than the existing proposal. It does not constrain on the _collateral supplied (except it will revert in \_verifyBalance if set to 0). Anyone can block normal proposal creation by creating a proposal with lower price but \_collateral == 1. When a high total supply is used, the price of each Rae is negligible and enables an attacker to DOS the protocol.
This violated the prevent a user from holding a vault hostage and never letting the piece be reasonably bought requirement.
Proof of Concept
For any proposal, an attacker can deny it with \_collateral = 1 and \_price = price - 1.
If he does not want the NFT to be sold, he can reject the proposal himself, resetting the contract state.
// Reverts if price per token is not lower than both the proposed and active listings
if (
_pricePerToken >= proposedListing.pricePerToken ||
_pricePerToken >= activeListings[_vault].pricePerToken
) revert NotLower();
Add this test to OptimisticListingSeaport.t.sol:
function testProposeRevertLowerTotalValue() public {
uint256 _collateral = 100;
uint256 _price = 100;
// setup
testPropose(_collateral, _price);
lowerPrice = pricePerToken - 1;
// execute
vm.expectRevert();
_propose(eve, vault, 1, lowerPrice, offer);
// expect
_assertListing(eve, 1, lowerPrice, block.timestamp);
_assertTokenBalance(eve, token, tokenId, eveTokenBalance - 1);
}
[FAIL. Reason: Call did not revert as expected]
Tools Used
Foundry
Recommended Mitigation Steps
Require the total value of the new collateral to be greater than the previous.
This however still allows a Rae holder with sufficiently large holding to block proposal by creating a new proposal and immediately reject it himself.
stevennevins (Tessera) confirmed
Best report for Foundry POC + the following statement:
This violated the
prevent a user from holding a vault hostage and never letting the piece be reasonably boughtrequirement.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The contract only validates that the new price per token is lower than the existing one, but does not require the total collateral value to be higher, allowing a minimal collateral to block proposals.
What the attacker needed
A vault with an existing proposal; ability to call propose with minimal collateral
The fix
Require the total value of the new collateral to be greater than the previous, though this still allows a large holder to block proposals by creating and immediately rejecting their own proposal.
How it was found
- Set up a vault with an existing proposal.
- Attacker calls propose with collateral of 1 and price one unit lower than the current price.
- The proposal succeeds, blocking further legitimate proposals.
- Attacker can reject their own proposal to reset the state if desired.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
This is a smart contract for selling NFTs in a fair way. The contract lets people propose a lower price to buy the NFT, but it only checks the price, not how much collateral they put up. So someone can propose with almost no collateral and a tiny price reduction, which stops others from making real proposals and effectively locks the NFT.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.