Platform: Code4rena
Start Date: 13/12/2023
Pot Size: $36,500 USDC
Total HM: 18
Participants: 110
Period: 8 days
Judge: 0xTheC0der
Id: 311
League: ETH
Rank: 92/110
Findings: 2
Award: $8.56
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: jnforja
Also found by: 0x175, 0xCiphky, 0xDING99YA, 0xmystery, ArmedGoose, Aymen0909, Franklin, KupiaSec, McToady, MrPotatoMagic, Ocean_Sky, PNS, Pechenite, TermoHash, Topmark, _eperezok, alexbabits, deth, hals, imare, jeff, ktg, leegh, mahdirostami, marqymarq10, mojito_auditor, neocrao, ptsanev, twcctop, zraxx
1.337 USDC - $1.34
https://github.com/code-423n4/2023-12-revolutionprotocol/blob/d42cc62b873a1b2b44f57310f9d4bbfdd875e8d6/packages/revolution/src/AuctionHouse.sol#L287-L291 https://github.com/code-423n4/2023-12-revolutionprotocol/blob/d42cc62b873a1b2b44f57310f9d4bbfdd875e8d6/packages/revolution/src/AuctionHouse.sol#L348-L356
Changing the reserve price variable while an auction is running or near an auction's end could cause the winner to unfairly lose his NFT.
Whenever the auction time runs out and _settleAuction
is invoked, we make a check to see the current ETH balance of the contract against the reserve price. If everything was done correctly, the ETH balance would be >= reserve price and the NFT would be minted to the winner. Otherwise, these was no bidder and the NFT is burned.
But in the scenario where the bid is less than the reserve price, the ETH gets refunded and the NFT burned. Such scenario at first seems unlikely, but factors like network congestion, front-running and block-stuffing could (highly unlikely) result in such a scenario where there was low auction activity so the only bidder bid the reserve price, an admin decides to increase the reserve price, thus leading to the winner not receiving his NFT.
Manual Review
Make sure the reserve price can only be called during an auction and not during it's settlement or even better - only between auctions as to not serve an unfair advantage for the earlier bidders who would have a different entry.
Context
#0 - c4-pre-sort
2023-12-22T03:14:05Z
raymondfam marked the issue as sufficient quality report
#1 - c4-pre-sort
2023-12-22T03:14:14Z
raymondfam marked the issue as duplicate of #55
#2 - c4-pre-sort
2023-12-24T14:17:56Z
raymondfam marked the issue as duplicate of #495
#3 - c4-judge
2024-01-06T18:14:50Z
MarioPoneder changed the severity to QA (Quality Assurance)
#4 - c4-judge
2024-01-07T16:03:11Z
MarioPoneder marked the issue as grade-c
#5 - c4-judge
2024-01-10T17:32:52Z
This previously downgraded issue has been upgraded by MarioPoneder
#6 - c4-judge
2024-01-10T17:33:16Z
MarioPoneder marked the issue as duplicate of #515
#7 - c4-judge
2024-01-10T17:35:18Z
MarioPoneder marked the issue as partial-50
#8 - c4-judge
2024-01-11T18:03:12Z
MarioPoneder changed the severity to 2 (Med Risk)
🌟 Selected for report: deth
Also found by: 00xSEV, 0xCiphky, 0xHelium, ABAIKUNANBAEV, Aamir, AkshaySrivastav, King_, Pechenite, SpicyMeatball, Tricko, ast3ros, ayden, bart1e, deth, fnanni, ke1caM, mahdirostami, peanuts, pep7siup, pontifex, ptsanev, roland, rvierdiiev, y4y
7.2215 USDC - $7.22
https://github.com/code-423n4/2023-12-revolutionprotocol/blob/d42cc62b873a1b2b44f57310f9d4bbfdd875e8d6/packages/revolution/src/CultureIndex.sol#L234 https://github.com/code-423n4/2023-12-revolutionprotocol/blob/d42cc62b873a1b2b44f57310f9d4bbfdd875e8d6/packages/revolution/src/CultureIndex.sol#L498-L503
The quorum votes property are a safeguard for the protocol to prevent flash attacks on art pieces. They are calculated at the time of the art piece creation and are saved in it's struct, effectively meaning that older art pieces would either have an unfair advantage or disadvantage over newer art pieces in case the admin decides to do _setQuorumVotesBPS()
in times of low or high activity.
In the implementation of the createPiece
we can see that quorum votes calculation happens at the time of creation, meaning it is constant throughout. In times of bad network, low/too high protocol activity, etc. the team has the option to change the quorum votes BPS needed to pass and let a piece be dropped. This creates an unfair advantage/disadvantage for older pieces, since they quorum is already calculated and saved using the old value, instead of at the time of dropping.
Scenario 1: There is low protocol activity, so the current quorum proves too difficult to pass and to avoid a system DoS, the threshold gets reduced. Now all of the old art pieces would still be checked against the old quorum, newer art pieces (if any in times of low activity), would have an unfair advantage, which isn't even a guarantee they would get most votes, meaning a DoS could happen anyway if an older pieces gets stuck in the top of the maxHeap
Scenario 2: Activity is high and the protocol deems it reasonable to increase the quorum to avoid potential flash attacks for rigging. Now older pieces are checked against the old value, deeming them much more favorable to pass quorum and unnecessarily favoring them over newer pieces. A user might even consider front-running the quorum upgrade, since the latest added piece would have 1. Lower quorum threshold 2. More token holders who can vote for it (because of how the snapshots work)
Manual Review
Instead of doing newPiece.quorumVotes = (quorumVotesBPS * newPiece.totalVotesSupply) / 10_000;
at the time of creation, calculate the quorum threshold only at the time of dropping. So instead of require(totalVoteWeights[piece.pieceId] >= piece.quorumVotes)
you should have require(totalVoteWeights[piece.pieceId] >= (quorumVotesBPS * newPiece.totalVotesSupply) / 10_000
to account for the updated quorumVotesBPS.
Context
#0 - c4-pre-sort
2023-12-21T23:43:21Z
raymondfam marked the issue as sufficient quality report
#1 - c4-pre-sort
2023-12-21T23:43:34Z
raymondfam marked the issue as duplicate of #17
#2 - c4-pre-sort
2023-12-22T05:11:07Z
raymondfam marked the issue as duplicate of #260
#3 - c4-pre-sort
2023-12-24T05:38:08Z
raymondfam marked the issue as not a duplicate
#4 - c4-pre-sort
2023-12-24T05:38:15Z
raymondfam marked the issue as duplicate of #16
#5 - c4-pre-sort
2023-12-24T15:10:59Z
raymondfam marked the issue as duplicate of #449
#6 - c4-judge
2024-01-06T15:56:37Z
MarioPoneder changed the severity to 2 (Med Risk)
#7 - c4-judge
2024-01-06T15:56:41Z
MarioPoneder marked the issue as satisfactory