hats-finance / Proof-Of-Humanity-V2-0xef0709445d394a22704850c772a28a863bb780b0

Proof of Humanity Protocol v2
2 stars 1 forks source link

challengeRequest function do not increases nbPendingRequests , whenever a challengeReuest is made #85

Open hats-bug-reporter[bot] opened 2 months ago

hats-bug-reporter[bot] commented 2 months ago

Github username: -- Twitter username: -- Submission hash (on-chain): 0x501eda3d9a8693581dc843b786803f42669fbacf2f59f454c5d398d2c19cb69c Severity: high

Description: Description\ Under challengeRequest their is no increment of nbPendingRequests param which is resposible for calculate number of pending requests in challenging phase as per the comment on L89 and it successfully decrease the nbPendingRequests pending request number for a particular humanityId under rule function,

humanity.nbPendingRequests--;

not increasing nbPendingRequests in challengeRequest will always fall into a situation in which whenever a rule function get called it makes nbPendingRequests underlow, which makes the function DOS.

Attack Scenario\ Describe how the vulnerability can be exploited.

Attachments

  1. Proof of Concept (PoC) File

  2. Revised Code File (Optional)

clesaege commented 2 months ago

The function challengeRequest challenges a request but does not create one. This request would have been created prior (and nbPendingRequests updated at that time).

If you believe you can make nbPendingRequests underflow, please provide such an example.