# Anyone can create disputes if contractor is not set

Invalid signature recovers address(0), matching unset contractor, letting anyone raise disputes and spam Rigor Protocol.

- Payout: Contest reward
- Severity: medium
- Program: Rigor Protocol
- Credited: berndartmueller
- Disclosed: 2022-09-12
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2022-08-rigor-findings/issues/327
- Library page: https://bugbountylibrary.com/r/c4%3A2022-08-rigor%3AM-05
- Tags: domain:web3 impact:dos kind:contest platform:code4rena sev:medium tech:evm tech:solidity technique:source-review vuln:access-control vuln:auth-bypass

**Target:** Project.sol raiseDispute / SignatureDecoder.recoverKey
**Root cause:** recoverKey returns address(0) for malformed signatures (length not multiple of 65), and the authorization check compares signer to contractor which is address(0) when unset, so the check passes.
**Steps:**
1. Call `Project.raiseDispute(_data, _signature)` with `_signature` of length 66 (not multiple of 65) so recoverKey returns address(0).
2. Encode `_data` with `_project = address(this)` and `_task = 0` (or a task with a subcontractor).
3. When contractor is unset (address(0)), `require(signer == builder || signer == contractor)` passes since signer == address(0).
4. Disputes.raiseDispute is invoked, creating a dispute.
**How found:** Code reading of raiseDispute authorization: noticed recoverKey returns address(0) on bad signature length and that contractor defaults to address(0), making the equality check trivially satisfiable.
**Exploitation:** Attacker repeatedly submits malformed signatures to create arbitrary disputes, spamming the dispute system with invalid entries.
**Insight:** When an authorization check compares a recovered/parsed identity against a possibly-unset storage field, check whether the parser can return the zero/default value and whether the field defaults to it too.
