In the contract FestivalPass, inside the function getMemorabiliaDetailed(address user)
cId is initialized to 1 and cId < nextCollectionId
Likelihood: HIGH
This will occur whenever a user calls getUserMemorabiliaDetailed()
and the contract has only ever created collections starting from ID 100
(as nextCollectionId
is initialized to 100
). The loop begins at cId = 1
, so it accesses collections[1]
to collections[99]
, which are uninitialized.
This will also occur every time new collections are created (IDs >= 100
) and users own memorabilia from them. The function will either revert due to accessing uninitialized mappings or return incomplete data.
Impact: HIGH
The function may revert entirely due to reading collections[cId].currentItemId
on an uninitialized mapping for cId < 100
, resulting in a complete failure to retrieve user memorabilia—even when the user owns valid tokens.
The function may miss valid memorabilia held by the user if the early iteration causes a premature return or skips real collection IDs. This breaks frontends relying on accurate ownership data and degrades user trust.
VULNERABILITY SUMMARY
=====================
* Function: getUserMemorabiliaDetailed(address user) external view
* Contract: FestivalPass
* Type: Logic flaw – Incorrect iteration range causing data loss
* Severity: HIGH
* Impact: Function has severe gas inefficiency and may become unusable with many collections
* ROOT CAUSE:
- nextCollectionId is initialized to 100 (line 20)
- createMemorabiliaCollection() assigns collectionId = nextCollectionId++ (starts from 100)
- getUserMemorabiliaDetailed() iterates from cId = 1, wasting gas on 99 non-existent collections
- While the function technically works (range [1, nextCollectionId) includes valid IDs),
it's extremely inefficient and may hit gas limits with many collections
* RESULT: Severe gas inefficiency, potential DoS, and poor user experience
Require changes in line 269 and 284 of FestivalPass.sol
The collectionId is iterated correctly starting from the initial (=100)
Invalid/no user data bug is resolved
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.