# Signature check fails open on edge input

Recovery or validation path that skips checks or accepts zero or stale values on edge input

_Area: Smart contract access control and control flow. Seen in 3 disclosed reports; one confirmed bounty: $2,200,000; latest 2026-05-07. Updated 2026-10-25._

## How it works
A signature or sighash check is supposed to answer one question: is this input authorized? The failure mode is that the check's error path does not actually reject. Instead of returning "invalid," the code substitutes a default value (an empty hash, a zero address) or leaves a previous value in place, and the caller treats that as success. The broken assumption is that "no valid result" and "valid result" are distinguishable downstream. When the error signal is dropped, malformed or forged input passes as authorized.

## Where it shows up
- `ecrecover`/`ecrecovery` results used without a nonzero-address check [E2](https://bugbountylibrary.com/r/blog%3Aimmunefi-com-blog-bug-fix-reviews-polygon-lack-of-balance-check-bugfix-review-2-2m-bounty.md)
- Sighash or digest computed with a fallback (e.g. hashing an empty list) when an index is out of range, instead of erroring [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-cwfq-rfcr-8hmp.md)
- FFI or callback bridges returning `Option`/`Result` where only the success branch writes the output buffer [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-gq4h-3grw-2rhv.md)
- Callers that read a result buffer unconditionally, ignoring a returned error flag
- Validation added on one side of a language/process boundary but not propagated across it [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-gq4h-3grw-2rhv.md)

## How to review
Trace every path where a signature, digest, or recovered address is produced and consumed. The invariant: any invalid, missing, or out-of-range input must yield an explicit rejection that reaches the caller, and no default or stale value may be treated as valid. Check that (a) recovered addresses are compared to an expected nonzero owner [E2](https://bugbountylibrary.com/r/blog%3Aimmunefi-com-blog-bug-fix-reviews-polygon-lack-of-balance-check-bugfix-review-2-2m-bounty.md); (b) out-of-range indices throw rather than substitute an empty hash [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-cwfq-rfcr-8hmp.md); (c) error returns from callbacks actually gate the consumer, and buffers are not read after a failed write [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-gq4h-3grw-2rhv.md). Diff the reference implementation's exception paths against the reimplementation's [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-cwfq-rfcr-8hmp.md).

## Variants seen
- Zero-address recovery accepted as a valid signer, enabling forged transfers [E2](https://bugbountylibrary.com/r/blog%3Aimmunefi-com-blog-bug-fix-reviews-polygon-lack-of-balance-check-bugfix-review-2-2m-bounty.md)
- Out-of-range sighash index filled with empty-outputs hash instead of failing [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-cwfq-rfcr-8hmp.md)
- Stale buffer reused after a `None` return, so an invalid hash type verifies against a prior digest [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-gq4h-3grw-2rhv.md)

## Why fixes fail
E3 is a fix that added a hash-type check on the Rust side but did not propagate the error across the FFI bridge; the C++ checker still read the buffer unconditionally, so the new validation was inert.

## Impact and severity
Critical: forged token transfers draining ~9.27B MATIC [E2](https://bugbountylibrary.com/r/blog%3Aimmunefi-com-blog-bug-fix-reviews-polygon-lack-of-balance-check-bugfix-review-2-2m-bounty.md), and consensus divergence between nodes on malformed transactions [E1](https://bugbountylibrary.com/r/ghsa%3AGHSA-cwfq-rfcr-8hmp.md)[E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-gq4h-3grw-2rhv.md). Severity rises when the check guards funds or consensus, and when the failure is silent (no revert, no log), so it is only caught by differential testing.

## Evidence
- E1: https://bugbountylibrary.com/r/ghsa%3AGHSA-cwfq-rfcr-8hmp.md
- E2: https://bugbountylibrary.com/r/blog%3Aimmunefi-com-blog-bug-fix-reviews-polygon-lack-of-balance-check-bugfix-review-2-2m-bounty.md
- E3: https://bugbountylibrary.com/r/ghsa%3AGHSA-gq4h-3grw-2rhv.md
