Forgotten Runes Warrior Guild contest - broccolirob's results

16,000 Warrior NFTs sold in a phased Dutch Auction.

General Information

Platform: Code4rena

Start Date: 03/05/2022

Pot Size: $30,000 USDC

Total HM: 6

Participants: 93

Period: 3 days

Judge: gzeon

Id: 118

League: ETH

Forgotten Runes

Findings Distribution

Researcher Performance

Rank: 30/93

Findings: 2

Award: $276.82

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

🌟 Selected for report: Kulk0

Also found by: 0x1f8b, 0xDjango, BowTiedWardens, Dinddle, broccolirob, defsec, dirk_y, hyh, rajatbeladiya, throttle, unforgiven

Labels

bug
duplicate
2 (Med Risk)

Awards

246.5367 USDC - $246.54

External Links

Lines of code

https://github.com/code-423n4/2022-05-runes/blob/060b4f82b79c8308fe65674a39a07c44fa586cd3/contracts/ForgottenRunesWarriorsMinter.sol#L257-L262

Vulnerability details

Impact

The docs say there is a cap on how many tokens the project team can mint, however there are no checks or tracking implemented in the teamSummon function to enforce that limit. An admin calling that function could accidentally or maliciously exceed the amount of tokens allotted to the team at any point.

Proof of Concept

At the start of the public sale, eager team member Bob tries to call teamSummon(0xb0b..., 333). Bob adds an extra 3 to the second argument and accidentally sends teamSummon(0xb0b...,3333). Bob successfully mints more than the total team token allocation

Tools Used

Manual analysis

Add a check to make sure team members who summon tokens don't summon more than their allocated share.

#0 - KenzoAgada

2022-06-06T05:38:46Z

Duplicate of #104.

Lines of code

https://github.com/code-423n4/2022-05-runes/blob/060b4f82b79c8308fe65674a39a07c44fa586cd3/contracts/ForgottenRunesWarriorsMinter.sol#L179 https://github.com/code-423n4/2022-05-runes/blob/060b4f82b79c8308fe65674a39a07c44fa586cd3/contracts/ForgottenRunesWarriorsMinter.sol#L139 https://github.com/code-423n4/2022-05-runes/blob/060b4f82b79c8308fe65674a39a07c44fa586cd3/contracts/ForgottenRunesWarriorsMinter.sol#L156-L160

Vulnerability details

Impact

Phase one of the mint doesn't end until phase two begins. Presumably, phase one might not sell out all the available tokens. If this happens finalPrice will not be reassigned from the starting price. There is a mechanism for admins to assign it themselves, however, the assumption is that phase 1 will remain open till phase 2 starts, so there will inevitably be some lag between phase 1 ending and the admins reassigning the finalPrice variable. During the overlapping time interval a claimer will have to pay the start price of 2.5 ether to mint their NFT, instead of the finalPrice of whatever the admins set it to.

Proof of Concept

Phase 2 timestamp is surpassed by block.timestamp and begins. Phase 1 ends. Bob calls mintlistSummon and has to pay 2.5 eth

Tools Used

manual

Don't let mintlistSummon be called till finalPrice is set

#0 - gzeoneth

2022-06-18T17:34:12Z

True but also they have to supply the incorrect msg.value, also well documented. https://github.com/code-423n4/2022-05-runes/blob/060b4f82b79c8308fe65674a39a07c44fa586cd3/contracts/ForgottenRunesWarriorsMinter.sol#L157-L158

// optimistic: save gas by not setting on every mint, but will // require manual `setFinalPrice` before refunds if da falls short

and in README

Known Configuration Required The times all need to be set correctly The finalPrice of the Dutch Auction is used in subsequent phases and it set automatically if the DA sells out. If the DA fails to sell out, the owner needs to set this value manually for the subsequent phases to be priced correctly.

Downgrading to Low / QA.

#1 - gzeoneth

2022-06-18T19:25:33Z

As warden's QA report.

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