Forgeries contest - Matin's results

A protocol for on-chain games with NFT prizes on Ethereum.

General Information

Platform: Code4rena

Start Date: 13/12/2022

Pot Size: $36,500 USDC

Total HM: 5

Participants: 77

Period: 3 days

Judge: gzeon

Total Solo HM: 1

Id: 191

League: ETH

Forgeries

Findings Distribution

Researcher Performance

Rank: 21/77

Findings: 1

Award: $110.27

🌟 Selected for report: 0

🚀 Solo Findings: 0

Findings Information

Labels

bug
2 (Med Risk)
satisfactory
duplicate-273

Awards

110.2711 USDC - $110.27

External Links

Lines of code

https://github.com/code-423n4/2022-12-forgeries/blob/main/src/VRFNFTRandomDraw.sol#L33

Vulnerability details

Impact

"MONTH_IN_SECONDS" is an immutable uint256 variable, declared to calculate 1 month in seconds, and is wrongly multiplied by the number 7. In this case it stands for 7 months rather than 1 month.

Proof of Concept

With multiplication by 7, the "MONTH_IN_SECONDS" extends the time interval. As a result, assigning large time intervals accidentally in "settings" struct inside the VRFNFTRandomDrawFactory contract will pass the requirements. Now, with triggering the startDraw() function, the drawTimeLock variable extends also: https://github.com/code-423n4/2022-12-forgeries/blob/main/src/VRFNFTRandomDraw.sol#L159 In a scenario when the owner wants to call redraw() function, he/she should wait till the block.timestamp fill in the required interval: https://github.com/code-423n4/2022-12-forgeries/blob/main/src/VRFNFTRandomDraw.sol#L204

Tools Used

Manual analysis

correct the definition of "MONTH_IN_SECONDS" to 1 month by deleting the *7 part

#0 - c4-judge

2022-12-17T12:53:20Z

gzeon-c4 marked the issue as duplicate of #273

#1 - c4-judge

2022-12-17T12:53:54Z

gzeon-c4 marked the issue as satisfactory

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