The addTreat()
function allows duplicate treat names, creating an inconsistency between the treats array and treatList mapping.
Location: src/TrickOrTreat.sol:addTreat()
Proof of Concept:
This creates several issues:
Array bloat from duplicate entries
Inconsistent state between mapping and array
Increased gas costs for array operations
Potential confusion for users/interfaces
Possible DoS vector through array size manipulation
Forge
Either prevent duplicate names or implement proper name overwrite functionality that maintains data structure consistency.
The function `addTreat` is called by the owner. The owner is trusted. There will be no duplicates.
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.