Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: medium
Invalid

Unchecked Christmas Time

Impact:

The collectPresent function allows users to collect presents anytime after a specific block time, which is supposed to represent Christmas 2023. However, the contract does not verify the actual date or time, leading to potential manipulation.

Proof of Concept:

The contract relies on a hardcoded block time to determine if it is Christmas 2023.
An attacker could manipulate the blockchain's timestamp or mine blocks in a specific way to trigger the collectPresent function prematurely before the actual Christmas date.
This could allow the attacker to unfairly collect presents and gain an advantage over other users.

Recommended Mitigation Steps:

Replace the hardcoded block time with a more reliable mechanism for checking the actual date and time. This could involve using an oracle service or relying on a decentralized time protocol.
Implement additional checks to ensure that users can collect presents only during a specific period around Christmas.
Consider adding penalties or blacklisting mechanisms for users who attempt to exploit the timestamp vulnerability.

Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Too generic

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.