Platform: Code4rena
Start Date: 30/10/2023
Pot Size: $49,250 USDC
Total HM: 14
Participants: 243
Period: 14 days
Judge: 0xsomeone
Id: 302
League: ETH
Rank: 243/243
Findings: 2
Award: $0.00
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: smiling_heretic
Also found by: 00decree, 00xSEV, 0x180db, 0x3b, 0x656c68616a, 0xAadi, 0xAleko, 0xAsen, 0xDetermination, 0xJuda, 0xMAKEOUTHILL, 0xMango, 0xMosh, 0xSwahili, 0x_6a70, 0xarno, 0xgrbr, 0xpiken, 0xsagetony, 3th, 8olidity, ABA, AerialRaider, Al-Qa-qa, Arabadzhiev, AvantGard, CaeraDenoir, ChrisTina, DanielArmstrong, DarkTower, DeFiHackLabs, Deft_TT, Delvir0, Draiakoo, Eigenvectors, Fulum, Greed, HChang26, Haipls, Hama, Inference, Jiamin, JohnnyTime, Jorgect, Juntao, Kaysoft, Kose, Kow, Krace, MaNcHaSsS, Madalad, MrPotatoMagic, Neon2835, NoamYakov, Norah, Oxsadeeq, PENGUN, REKCAH, Ruhum, Shubham, Silvermist, Soul22, SovaSlava, SpicyMeatball, Talfao, TermoHash, The_Kakers, Toshii, TuringConsulting, Udsen, VAD37, Vagner, Zac, Zach_166, ZdravkoHr, _eperezok, ak1, aldarion, alexfilippov314, alexxander, amaechieth, aslanbek, ast3ros, audityourcontracts, ayden, bdmcbri, bird-flu, blutorque, bronze_pickaxe, btk, c0pp3rscr3w3r, c3phas, cartlex_, cccz, ciphermarco, circlelooper, crunch, cryptothemex, cu5t0mpeo, darksnow, degensec, dethera, devival, dimulski, droptpackets, epistkr, evmboi32, fibonacci, gumgumzum, immeas, innertia, inzinko, jasonxiale, joesan, ke1caM, kimchi, lanrebayode77, lsaudit, mahyar, max10afternoon, merlin, mrudenko, nuthan2x, oakcobalt, openwide, orion, phoenixV110, pontifex, r0ck3tz, rotcivegaf, rvierdiiev, seeques, shenwilly, sl1, slvDev, t0x1c, tallo, tnquanghuy0512, tpiliposian, trachev, twcctop, vangrim, volodya, xAriextz, xeros, xuwinnie, y4y, yobiz, zhaojie
0 USDC - $0.00
https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/MinterContract.sol#L276 https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/AuctionDemo.sol#L57-L61 https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/AuctionDemo.sol#L134-L143 https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/AuctionDemo.sol#L104-L120
NextGen Protocol implements a phase where the creator can call mintAndAuction()
for certain NFTs in collection for a fixed duration of time, during which users can bid the price they are willing to pay for the NFT, and the highest bidder at the end of the auction gets the NFT.
Every bidder has to pay the ETH amount they are willing to bid, and it has to be higher than the previous bid. In the end, the winner gets the NTF, and the rest of the bids are returned to the respective bidders.
Alll the bids are stored in an array of struct auctionInfoData[_tokenid]
, Each time a new bid is made, a struct containing the address of the bidder and their bid is pushed into the array.
Any user can make multiple bids in auction and are also allowed to cancel their bids before the auctions ends.
A malicious user can simply back-run the mintAndAuction()
and place two bids:
Then this malicious user simply waits till the auction is about to end.
Meanwhile other interested buyers won't make a bid seeing the absurd bid by our malicious user, and even if they tried to make one with a fair value (say of half or one third of our malicious user's second bid), it will be rejected as it wont be higher than the previous bid.
When the auction is just about to end, the malicious user will call cancelBid()
for their second bid, cancelling it and getting his high value bid amount back.
As a result, there will be only one bid when the auction ends: that of 1 wei by attacker, allowing him to claim the NFT for just 1 wei.
Now, there is a possibility that the malicious user may get back-run or that the transaction does not go through before auction ends, but for precious NFT, he has a very good incentive to pay the Validators/Miners and brick the auction.
manual review
cancelBid()
functionality altogether.MEV
#0 - c4-pre-sort
2023-11-15T07:18:46Z
141345 marked the issue as duplicate of #962
#1 - c4-judge
2023-12-02T15:12:23Z
alex-ppg marked the issue as not a duplicate
#2 - c4-judge
2023-12-02T15:14:53Z
alex-ppg marked the issue as duplicate of #1784
#3 - c4-judge
2023-12-07T11:50:51Z
alex-ppg marked the issue as duplicate of #1323
#4 - c4-judge
2023-12-08T17:17:31Z
alex-ppg marked the issue as partial-50
#5 - c4-judge
2023-12-08T17:27:54Z
alex-ppg marked the issue as satisfactory
#6 - c4-judge
2023-12-08T17:58:45Z
alex-ppg marked the issue as partial-50