Skip to content
DoS Audit finding Intermediate

Auction fails if the 'Honorarium Rate' is 0%

When the Honorarium Rate is set to 0%, the auction contract's collateral check requires the total collateral to be strictly greater than the bid amount, causing all bids to revert. This prevents any new bidder from participating, effectively breaking the auction.

Al-Qa-qa Follow with sammy

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2024-02-radicalxchange-judging/issues/31

Found by

Al-Qa-qa, sammy

Summary

The Honorarium Rate is the required percentage of a winning Auction Pitch bid that the Steward makes to the Creator Circle at the beginning of each Stewardship Cycle.

$$ Winning Bid * Honorarium Rate = Periodic Honorarium $$

To mimic the dynamics of private ownership, the Creator Circle may choose a 0% Honorarium Rate. However, doing so breaks the functionality of the protocol.

Vulnerability Detail

To place a bid, a user must call the placeBid function in EnglishPeriodicAuctionFacet.sol and deposit collateral(collateralAmount) equal to bidAmount + feeAmount. The feeAmount here represents the Honorarium Rate mentioned above. The placeBid function calls the _placeBid internal function in EnglishPeriodicAuctionInternal.sol which calculates the totalCollateralAmount as follows :

Solidity
uint256 totalCollateralAmount = bid.collateralAmount + collateralAmount;

Here, bid.collateralAmount is the cumulative collateral deposited by the bidder in previous bids during the current auction round(i.e, zero if no bids were placed), and collateralAmount is the collateral to be deposited to place the bid. However the _placeBid function requires that totalCollateralAmount is strictly greater than bidAmount if the bidder is not the current owner of the Stewardship License. This check fails when the feeAmount is zero and this causes a Denial of Service to users trying to place a bid. Even if the users try to bypass this by depositing a value slightly larger than bidAmount, the _checkBidAmount function would still revert with 'Incorrect bid amount'

POC

The following test demonstrates the above-mentioned scenario :

Solidity
 describe('exploit', function () {
    it('POC', async function () {
      // Auction start: Now + 100
      // Auction end: Now + 400
      const instance = await getInstance({
        auctionLengthSeconds: 300,
        initialPeriodStartTime: (await time.latest()) + 100,
        licensePeriod: 1000,
      });
      const licenseMock = await ethers.getContractAt(
        'NativeStewardLicenseMock',
        instance.address,
      );

      // Mint token manually
      const steward = bidder2.address;
      await licenseMock.mintToken(steward, 0);

      // Start auction
      await time.increase(300);
        
      const bidAmount = ethers.utils.parseEther('1.0');
      const feeAmount = await instance.calculateFeeFromBid(bidAmount);
      const collateralAmount = feeAmount.add(bidAmount);

      // Reverts when a user tries to place a bid
      await expect( instance
        .connect(bidder1)
        .placeBid(0, bidAmount, { value: collateralAmount })).to.be.revertedWith('EnglishPeriodicAuction: Collateral must be greater than current bid');

      
    
      const extraAmt = ethers.utils.parseEther('0.1');
      const collateralAmount1 = feeAmount.add(bidAmount).add(extraAmt);
      
      // Also reverts when the user tries to deposit collateral slighty greater than bid amount
      await expect( instance
        .connect(bidder1)
        .placeBid(0, bidAmount, { value: collateralAmount1 })).to.be.revertedWith('EnglishPeriodicAuction: Incorrect bid amount');  
      
      // Only accepts a bid from the current steward
      
      await expect( instance
        .connect(bidder2)
        .placeBid(0, bidAmount, { value: 0 })).to.not.be.reverted;

    });
  });

To run the test, copy the code above to EnglishPeriodicAuction.ts and alter L#68 as follows :

Diff
-          [await owner.getAddress(), licensePeriod, 1, 10],
+          [await owner.getAddress(), licensePeriod, 0, 10],

Run yarn run hardhat test --grep 'POC'

Impact

The protocol becomes dysfunctional in such a scenario as users as DOS'd from placing a bid.

Code Snippet

Tool used

Manual Review Hardhat

Recommendation

Alter EnglishPeriodicAuctionInternal.sol::L#330 as follows :

Diff
- totalCollateralAmount > bidAmount,
+ totalCollateralAmount >= bidAmount, 

Discussion

sammy-tm

Escalate It states in the docs that the Honorarium rate may be 0 to mimic private ownership. However, as clearly described in the issue above, this functionality fails. https://pco-art-docs.vercel.app/for-artists/pco-settings "Lower Honorarium Rates will tend to lead to higher nominal Auction Prices: the capital commitment required of the Steward each cycle is lower given a valuation. A 0% Honorarium Rate effectively would mimic the dynamics of private ownership (with a periodic auction in which the Steward could set an arbitrarily high reserve price). The theoretically optimal rate from a Periodic Honorarium maximization perspective is equal to the probability that a new Steward emerges who values the work more than the current Steward (e.g. 1 in every 10 periods implies a 10% optimal rate), but that, of course, might not be the priority."

sherlock-admin2

Escalate It states in the docs that the Honorarium rate may be 0 to mimic private ownership. However, as clearly described in the issue above, this functionality fails. https://pco-art-docs.vercel.app/for-artists/pco-settings "Lower Honorarium Rates will tend to lead to higher nominal Auction Prices: the capital commitment required of the Steward each cycle is lower given a valuation. A 0% Honorarium Rate effectively would mimic the dynamics of private ownership (with a periodic auction in which the Steward could set an arbitrarily high reserve price). The theoretically optimal rate from a Periodic Honorarium maximization perspective is equal to the probability that a new Steward emerges who values the work more than the current Steward (e.g. 1 in every 10 periods implies a 10% optimal rate), but that, of course, might not be the priority."

The escalation could not be created because you are not exceeding the escalation threshold.

You can view the required number of additional valid issues/judging contest payouts in your Profile page, in the Sherlock webapp.

cawfree

Escalate

The amazing supporting documentation for RadicalxChange states that one of the intended logical underpinnings of the fee model should be to mimic private ownership when operating using a 0% honorarium: .

However, the codebase strictly does not permit this due to emergent strict equality checks, which only arise later when actually trying to place a bid. The collection deployer finds out too late.

The counterargument to this finding is it just seems low severity given that this can be resolved by doing something like redeploy to a collection with 1 wei (i.e. a frontend fix), or even wondering how often communities are going to do this in practicality.

It is just clear that this implementation quirk works directly against the advertised functionality (a literal feature), and that should probably play into the severity. People do like free mints after all.

sherlock-admin2

Escalate

The amazing supporting documentation for RadicalxChange states that one of the intended logical underpinnings of the fee model should be to mimic private ownership when operating using a 0% honorarium: .

However, the codebase strictly does not permit this due to emergent strict equality checks, which only arise later when actually trying to place a bid. The collection deployer finds out too late.

The counterargument to this finding is it just seems low severity given that this can be resolved by doing something like redeploy to a collection with 1 wei (i.e. a frontend fix), or even wondering how often communities are going to do this in practicality.

It is just clear that this implementation quirk works directly against the advertised functionality (a literal feature), and that should probably play into the severity. People do like free mints after all.

You've created a valid escalation!

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.

Al-Qa-qa

Besides what @cawfree said, I want to add that if the Artist (Collection Admin), deployed the Collection as immutable (i.e. without an owner). No one will be able to change the fees to just make it 1 wei (And this point I mentioned in my report 107). This will make all the Auction processes/NFT Collection broken and insolvable.

zzykxx

This is valid. Setting a fee of 0 is a legitimate and expected input and the core functionality of the protocol (auctions) breaks when this is the case.

Hash01011122

It appears valid finding to me with duplicates #12 and #107 @gravenp @St4rgarden would you like to add something here??

sammy-tm

I would also like to urge the lead judge to re-evaluate the severity of this finding. "Breaking core functionality" might be considered High in some cases.

gravenp

The 0% Honorarium example is the theoretical limit, but in practice, it doesn't make sense to configure it that way (the PCO system ends up being a lot of complex code for the current steward to basically hold the art as long as they want). I agree that as implemented, we allowed it, and it breaks things. Our fix will not allow the artist/admin to configure a 0% honorarium as this specific configuration isn't core to our intended functionality.

Hash01011122

I think this issue is open ended double edge sword where sponsors claiming this cannot be rectified as this is design choice but in my opinion, it suffices medium severity as this breaks protocol's functionality, let me know your thoughts @zzykxx, @gravenp, @Czar102

gravenp

I'm fine with whatever the judges decide. Ultimately, our design choice is not to allow 0% honorarium, so the intended functionality won't include supporting this scenario.

zzykxx

I think this issue is open ended double edge sword where sponsors claiming this cannot be rectified as this is design choice but in my opinion, it suffices medium severity as this breaks protocol's functionality, let me know your thoughts @zzykxx, @gravenp, @Czar102

In my opinion this should be a valid issue unless it was mentioned somewhere public that the 0% honorarium is not allowed/intended.

Hash01011122

As mentioned by @zzykxx, this is a valid finding with duplicates #107 and #12

Czar102

A 0% Honorarium Rate effectively would mimic the dynamics of private ownership (with a periodic auction in which the Steward could set an arbitrarily high reserve price).

The usage of "would mimic" instead of "mimics" implies that it's either know not to be possible to use such a configuration, or it is undesired for such a configuration to be used.

The 0% Honorarium example is the theoretical limit, but in practice, it doesn't make sense to configure it that way (the PCO system ends up being a lot of complex code for the current steward to basically hold the art as long as they want).

It seems that using a 0% Honorarium Rate doesn't make sense, hence it doesn't really limit the intended functionality of the implemented codebase.

Am I mistaken somewhere?

sammy-tm

You're correct; however, it doesn't expressly state that the artists are not supposed to do this. Neither does it prevent them from doing so. A naive artist may read the documentation and want to mimic an IRL auction/ private ownership for their art, so they would set the fees to 0%. But doing so visibly breaks the protocol. This needs to be handled either during configuration (as @gravenp mentioned)

I agree that as implemented, we allowed it, and it breaks things. Our fix will not allow the artist/admin to configure a 0% honorarium as this specific configuration isn't core to our intended functionality.

or mitigated using the recommendation in the Issue.

Al-Qa-qa

The documentation did not deny setting 0 fees totally, it expresses that setting 0% is not typically advisable (Or What means this).

The 0% Honorarium example is the theoretical limit

This sentence does not exist in the docs, The docs did not explain that 0% is prevented or other, it explained that it's like the Steward owns the thing they're managing as if it were their own property. They get all the benefits without having to pay anything for it

So according to the documentation which was the only resource for that issue in the Auditing period, setting 0% Honorarium was not prevented totally, nor said by the Devs in the README, nor that edge case was handled in the code.

I hope the issue gets reviewed according to the information that was with us (Auditors) in the Auditing period, The points that the sponsor said after the Auditing finished (In Escalation) should not be taken as proof to either validate or invalidate issues.

And if the likelihood of the issue is LOW, its impact is so HIGH. And this is illustrated in my report, and escalation engagements.

Hash01011122

This issue, along with its duplicates #12 and #107, should be deemed valid. It highlights the complication arising from a 0% honorarium rate, contradicting the project documentation which states this as a theoretical limit not reflected in the codebase. Moreover, the documentation does not clearly advise against its use. What are your thoughts, @Czar102?

Evert0x

I believe this issue should be valid and the main issue (12) should be assigned Medium severity.

gravenp

It doesn't seem that #12 is the right parent issue to me. #42 and #107 appear to be the proper issues to connect here, @Hash01011122.

sammy-tm

#42 is about setting the fee denominator to 0, which is a completely different issue and is invalid.

Al-Qa-qa

I read issue 12, and the issue is about different Root causes and Impact.

Could you give another look at it @Hash01011122 , and determine your final thought about this issue, whether it is a Dup of 31 and 107 or not?

sammy-tm

Went through #12, agree with @Al-Qa-qa that the concern highlighted in the issue is completely different from #31 and #107. I think the judge has incorrectly grouped these together because the mitigation step is the same.

If you read carefully, #12 is a wrong interpretation of the codebase and focuses on user input validation (invalid according to sherlock rules)

Quoting Issue #12 :

The root of the issue is the expectation that the fee should be paid on top of the bidAmount, which goes fully against documentation and poses many problems. Since the protocol has the stated requirement of 100% collateralisation, many valid bids will revert with the confusing message that you need overcollateralisation. @>"The fee is a percentage of the bid, so there is no logical reason why the fee should be paid on top of the bid." Even if users are willing to overcollateralise, for every bid they need to take into account both collateral paid and fee paid and recalculate both perfectly to be within rounding error. This is prone to error. In a heated auction with many competing bidders trying to take the price close to a deadline, the complexity demanded to perfectly calculate every bid is not realistic. This will lead to many valid bids being reverted due to a wei-sized deviation and the auction will close at a lower price than the highest valid bid submitted. This constitutes a loss to the creator's circle and the current holder of the license.

It talks about how it is "confusing" to the user to pay the fee on top of the bid and argues against the intended implementation of the codebase. It is known that the codebase is implemented in such a way that the user is expected to pay the fee on top of the bid. The watson has simply misinterpreted the codebase and this is further illustrated by the example scenario described by the watson in the issue.

Issue #12 has nothing to do with the Honorarium Rate being set to 0.

I urge the judges @Evert0x @Hash01011122 and the sponsor @gravenp to go through #12 separately and remove duplication from #31 and #107

Hash01011122

@sammy-tm thanks for providing a detailed explanation for every issue of this family, after inspecting issues thoroughly I can say #31 is valid finding with #107 as its dup @Evert0x

Evert0x

Agree with the proposed outcome here. Thanks @sammy-tm

Planning to accept escalation, make #31 a Medium issue with #107 as a duplicate.

Evert0x

Result: Medium Has Duplicates

sherlock-admin4

Escalations have been resolved successfully!

Escalation status:

sherlock-admin3

The protocol team fixed this issue in the following PRs/commits: https://github.com/RadicalxChange/pco-art/pull/10

zzykxx

The issue has been fixed as recommended. Plus, if feeDenominator is 0 the returned fee is now 0.

sherlock-admin2

The Lead Senior Watson signed off on the fix.

The original report as published on Sherlock, by Al-Qa-qa. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

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 uses a strict greater-than comparison for total collateral versus bid amount, which fails when the fee is zero and collateral equals the bid.

Impact

The protocol becomes dysfunctional as users are denied service from placing bids, effectively breaking the auction.

What the attacker needed

Honorarium rate set to 0%; Auction is active; Bidder is not the current steward

The fix

The fix was to change the strict greater-than check to greater-than-or-equal, and additionally to return a fee of zero when the fee denominator is zero.

How it was found

  1. Deploy the auction contract with a 0% honorarium rate.
  2. Mint a stewardship license token to a steward.
  3. Start the auction.
  4. Attempt to place a bid with collateral equal to the bid amount plus zero fee.
  5. Observe the transaction reverts with 'Collateral must be greater than current bid'.
  6. Attempt to place a bid with slightly more collateral; observe revert with 'Incorrect bid amount'.

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.

In this auction system, bidders must deposit extra money (collateral) on top of their bid. The contract checks that the total collateral is strictly more than the bid amount. If the fee is set to zero, the collateral equals the bid, so the check fails and no one can bid. This means the auction is stuck.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More by Al-Qa-qa

View all

7 more disclosed reports, best first.

More from RadicalxChange

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.