NextGen - innertia's results

Advanced smart contracts for launching generative art projects on Ethereum.

General Information

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

NextGen

Findings Distribution

Researcher Performance

Rank: 126/243

Findings: 4

Award: $6.91

🌟 Selected for report: 0

🚀 Solo Findings: 0

Lines of code

https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/MinterContract.sol#L196 https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/MinterContract.sol#L258 https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/NextGenCore.sol#L193 https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/NextGenCore.sol#L231

Vulnerability details

Impact

The number of mints is set, but the number of mints can be exceeded.

Proof of Concept

In the gncore.mint function, the number of mints is managed by tokensMintedPerAddress and tokensMintedAllowlistAddress, but _safeMint is invoked before updating them. Therefore, when re-entry is performed, any number of mints can be made.

Tools Used

Manual

Update the state and then call _safeMint. Or make it a normal mint instead of safe.

Assessed type

Reentrancy

#0 - c4-pre-sort

2023-11-19T08:09:53Z

141345 marked the issue as duplicate of #51

#1 - c4-pre-sort

2023-11-26T14:04:10Z

141345 marked the issue as duplicate of #1742

#2 - c4-judge

2023-12-08T16:17:27Z

alex-ppg marked the issue as satisfactory

#3 - c4-judge

2023-12-08T16:17:33Z

alex-ppg marked the issue as partial-25

Findings Information

🌟 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

Awards

0 USDC - $0.00

Labels

bug
3 (High Risk)
partial-50
duplicate-1323

External Links

Lines of code

https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/AuctionDemo.sol#L105 https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/AuctionDemo.sol#L125 https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/AuctionDemo.sol#L135

Vulnerability details

Impact

After receiving the goods from an auction win or a refund from a loss, additional funds can be stolen from the contract.

Proof of Concept

Looking at the conditional statements for cancelBid(and cancelAllBids) and claimAuction, when block.timestamp == minter.getAuctionEndTime(_tokenid), both conditions are passed. In other words, it would be possible to launch cancelBid(and cancelAllBids) after claimAuction. Both the winner and the loser get an additional refund of the amount they bid, so the hacker can make a lot of money!

Tools Used

Manual

Set claimAuction condition as block.timestamp > minter.getAuctionEndTime(_tokenid)

Assessed type

Timing

#0 - c4-pre-sort

2023-11-14T10:31:28Z

141345 marked the issue as duplicate of #1904

#1 - c4-pre-sort

2023-11-14T23:31:45Z

141345 marked the issue as duplicate of #962

#2 - c4-judge

2023-12-01T14:54:56Z

alex-ppg marked the issue as not a duplicate

#3 - c4-judge

2023-12-01T14:55:04Z

alex-ppg marked the issue as duplicate of #1788

#4 - c4-judge

2023-12-08T17:50:49Z

alex-ppg marked the issue as partial-50

Lines of code

https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/AuctionDemo.sol#L116

Vulnerability details

Impact

Auction participants funds are locked into the contract.

Proof of Concept

claimAuction will provide refunds to auction losers with the following code. (bool success, ) = payable(auctionInfoData[_tokenid][i].bidder).call{value: auctionInfoData[_tokenid][i].bid}(""); At this time, if the bidder contains code that consumes a lot of gas, for example, this function will always be reverted, and the participant's funds will be locked into the contract

Tools Used

Manual

Consider pull-type refunds, such as processing refunds yourself after the auction is over.

Assessed type

DoS

#0 - c4-pre-sort

2023-11-19T08:06:03Z

141345 marked the issue as duplicate of #486

#1 - c4-pre-sort

2023-11-19T08:06:42Z

141345 marked the issue as duplicate of #486

#2 - c4-judge

2023-12-01T22:15:46Z

alex-ppg marked the issue as not a duplicate

#3 - c4-judge

2023-12-01T22:16:05Z

alex-ppg marked the issue as duplicate of #1782

#4 - c4-judge

2023-12-08T20:47:25Z

alex-ppg marked the issue as partial-50

Awards

5.4864 USDC - $5.49

Labels

bug
2 (Med Risk)
partial-50
duplicate-175

External Links

Lines of code

https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/AuctionDemo.sol#L58 https://github.com/code-423n4/2023-10-nextgen/blob/8b518196629faa37eae39736837b24926fd3c07c/smart-contracts/AuctionDemo.sol#L105

Vulnerability details

Impact

Funds tendered by the user are locked into the contract and cannot be retrieved.

Proof of Concept

Looking at the conditional statements for participateToAuction and claimAuction, when block.timestamp == minter.getAuctionEndTime(_tokenid), both conditions are passed. In other words, it would be possible to launch participateToAuction after claimAuction. claimAuction can only be launched once, so the money bid after it is over cannot be retrieved and will be wasted.

Tools Used

Manual

Set claimAuction condition as block.timestamp > minter.getAuctionEndTime(_tokenid)

Assessed type

Timing

#0 - c4-pre-sort

2023-11-14T10:33:24Z

141345 marked the issue as duplicate of #1935

#1 - c4-pre-sort

2023-11-14T14:21:36Z

141345 marked the issue as duplicate of #962

#2 - c4-judge

2023-12-02T15:33:02Z

alex-ppg marked the issue as not a duplicate

#3 - c4-judge

2023-12-02T15:34:51Z

alex-ppg marked the issue as duplicate of #1926

#4 - c4-judge

2023-12-08T18:49:21Z

alex-ppg marked the issue as partial-50

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter