hats-finance / SeeR-PM-0x899bc13919880db76edf4ccd72bdfa5dfa666fb7

1 stars 0 forks source link

Missing validation check on outcomeSlotCount #78

Open hats-bug-reporter[bot] opened 1 month ago

hats-bug-reporter[bot] commented 1 month ago

Github username: @cpp-phoenix Twitter username: 0xrochimaru Submission hash (on-chain): 0x2241daf6b6c0608cd29d5eb42213e54c03a08305bc05cfe4bffa2721adaadce9 Severity: low

Description: Description\ There is a missing validation on outcomeSlotCount value in MarketFactory.sol. As the underlying conditionalTokens only supports value outcomeSlotCount <= 256.

Attack Scenario\ It'll result in unexpected revert. Must be handled properly.

Recommendation\ Add a proper validation of params.outcomes.length < 256.

greenlucid commented 1 month ago

Done automatically on prepareCondition

cpp-phoenix commented 1 month ago

@greenlucid As per the documentation. The prepareCondition expects the value to be <=256. It's better the do validation prior then relying on underlying method reverts.

Screenshot 2024-09-26 at 7 18 33 PM
clesaege commented 1 month ago

It's better the do validation prior then relying on underlying method reverts.

I disagree on that, it's better to keep the contracts simple.

As per contest rules, are excluded: