ecrecover zero-address return unchecked
A code & audits factor in the v1.7.0 rubric. Measured per protocol on a s cadence.
Methodology how we score #
**What this measures** This factor detects whether any use of ecrecover() in the protocol's deployed code fails to validate that the returned address is not address(0). In Solidity, ecrecover() returns address(0) when the signature is invalid rather than reverting. If the calling code uses the return value without a != address(0) check, an invalid or malformed signature passes as valid, with address(0) treated as the signer. The detection is performed by static analysis of the verified source.
**Why it matters** A missing zero-address check on ecrecover() enables signature forgery: any attacker can submit a malformed signature and be treated as having been signed by address(0). If address(0) has any special permissions in the protocol (a common pattern in early contracts), the attacker gains those permissions. This pattern underpins the Wormhole-class signature validation failures -- Wormhole ($326M, 2022) involved a guardian signature verification bypass where the zero-address edge case was not handled. The vulnerability is simple to detect and fix but can be catastrophic when present in a signature-gated permission system.
**Green / Yellow / Red** Green: all uses of ecrecover() are followed by a require(signer != address(0)) check, confirmed by static analysis. Yellow: the check is absent in ecrecover() calls for non-critical signature paths (e.g., permit() functions without admin privilege), but all admin or governance signatures are correctly validated. Red: any ecrecover() call in an admin, governance, or fund-movement path lacks the != address(0) validation.
**Common gray cases** This factor is gray for protocols that do not use ecrecover() or ECDSA signature verification in any function path.
**Notable historical examples** The Wormhole bridge exploit ($320M, 2022) is the primary motivating case for this factor class.
Measurement what to look for #
Determine whether any `ecrecover` call result is used without a `!= address(0)` guard.