Mystery Box

First Flight #25
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: medium
Valid

A malicious user can expand the rewards array to an arbitrary size, significantly increasing storage costs

Summary

After oppening one box, malicious user can expand rewards array to arbitrary size by transfering reward back and forth. This happens because delete rewardsOwned[msg.sender][_index]; doesn't delete element in rewards array, nor just reset it and transfered reward is pushed to the rewards array.

Impact

A malicious user can expand the rewards array to an arbitrary size, significantly increasing storage costs

Recommendations

Implement a delete function that shifts elements and uses pop to remove the reward from the array.

Updates

Lead Judging Commences

inallhonesty Lead Judge
11 months ago

Appeal created

inallhonesty Lead Judge 11 months ago
Submission Judgement Published
Validated
Assigned finding tags:

A user can poison the `rewardsOwned` of another user via `transferReward` of an empty reward index

Support

FAQs

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