Forgeries contest - yixxas'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: 25/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/fc271cf20c05ce857d967728edfb368c58881d85/src/VRFNFTRandomDraw.sol#L33

Vulnerability details

Impact

This breaks the protocol invariant of

  1. REDRAW_TIMELOCK_NEEDS_TO_BE_LESS_THAN_A_MONTH()
  2. revert RECOVER_TIMELOCK_NEEDS_TO_BE_LESS_THAN_A_YEAR()

We can set redraw timelock to 7 months

We can set recover timelock to 7 years. This is extremely unnecessary.

Proof of Concept

MONTH_IN_SECONDS is currently implemented this way uint256 immutable MONTH_IN_SECONDS = (3600 * 24 * 7) * 30

We are multiplying number of seconds in a week by 30, instead of multiplying number of seconds in a day by 30. This lead to an over computation of 7 times.

The affected part of the protocols are as mentioned above as they relies on the value of MONTH_IN_SECONDS.

Tools Used

Manual Review

Correct calculation should be

uint256 immutable MONTH_IN_SECONDS = (3600 * 24) * 30

#0 - c4-judge

2022-12-17T12:53:36Z

gzeon-c4 marked the issue as duplicate of #273

#1 - c4-judge

2022-12-17T12:53:59Z

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