Open hats-bug-reporter[bot] opened 1 month ago
Check the reality.eth constructor, it automatically creates a bunch of templates. Also it's not comparing template_id, but the timestamp of it's creation. Finally, this would be a reality.eth vuln if anything, out of scope. ChatGPT should be banned
I didnt use ChatGPT @greenlucid
I don't see a vuln there, you do indeed need for a template to exist to ask a question. Moreover this is already deployed and we are able to ask questions.
Github username: @Jelev123 Twitter username: zhulien_zhelev Submission hash (on-chain): 0x8ad58a29f1ad07bf1420ad03e9ad1a0fcfb042deac63967a4d61b92714f12e6e Severity: low
Description: Description\ In createTemplate function when create the template the
id
is set tonextTemplateID
which is 0 by default.Impact
When the askQuestion and askQuestionWithMinBond is used it checks
require(templates[template_id] > 0
but thetemplateId
will be 0 at the first creation of template and these functions will revert.Proof of Concept (PoC) File