# Parameter manipulation bypassing validation

Duplicate, malformed or type-confused params that skip checks, strip filters, or reach a sink unvalidated

_Area: Web business logic and race conditions. Seen in 2 disclosed reports; one confirmed bounty: $500; latest 2018-05-28. Updated 2026-11-14._

## How it works
Validation assumes the value it checks is the value the sink uses. That assumption breaks when the parser and the consumer disagree: a duplicate key, a `[nil]`/empty-hash JSON value, or a key that matches no validator branch. The check sees one thing; the query builder, API, or store acts on another. The root cause is a parser differential or a silent default, not a missing check.

## Where it shows up
- URLs built by string concatenation with user input placed before a trusted parameter (e.g. `secret`) [E1](https://bugbountylibrary.com/r/blog%3Aandresriancho-com-recaptcha-bypass-via-http-parameter-pollution.md)
- APIs that tolerate duplicate query keys and pick first vs last inconsistently [E1](https://bugbountylibrary.com/r/blog%3Aandresriancho-com-recaptcha-bypass-via-http-parameter-pollution.md)
- JSON/XML/YAML param parsing feeding Active Record or similar query builders; `nil?` guards on params that can be arrays or hashes [E2](https://bugbountylibrary.com/r/h1%3A139321.md)
- Validators that dispatch on a key namespace and `return` success for keys matching none [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-32mq-hpph-xfvr.md)
- Read loops that reset an inactivity timeout per message with no per-stream count or byte budget [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-32mq-hpph-xfvr.md)

## How to review
Trace the exact value from parser to sink and confirm the checked value is the used value. Invariants:
- No user-controlled parameter may appear before a trusted one in a concatenated query string; use a structured client that cannot emit duplicates.
- Every param reaching a query builder is a scalar of expected type; reject arrays/hashes where a scalar is required, and never let `nil`/empty collapse a WHERE clause.
- Every validator branch either validates or rejects; no silent success for unmatched keys [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-32mq-hpph-xfvr.md).
- Read loops enforce a per-stream message/byte budget independent of timeout resets [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-32mq-hpph-xfvr.md).

## How finders spotted it
- Reasoned about HPP in URL construction, noticed Google's siteverify tolerated duplicate `secret` params using the first, and that a published test secret disables verification; combined the three [E1](https://bugbountylibrary.com/r/blog%3Aandresriancho-com-recaptcha-bypass-via-http-parameter-pollution.md)
- Variant analysis: took prior unsafe-query CVEs and retested the same sink against a newer input parser (JSON) added since the patch [E2](https://bugbountylibrary.com/r/h1%3A139321.md)
- Code review of `validators.ts` spotted a silent early-return for keys with <3 slash-parts; reading `rpc/index.ts` revealed per-message timeout reset with no budget; compared against go-libp2p-kad-dht which rejects unknown namespaces at the RPC layer [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-32mq-hpph-xfvr.md)

## Variants seen
- Duplicate-parameter injection overriding a trusted secret in a concatenated URL [E1](https://bugbountylibrary.com/r/blog%3Aandresriancho-com-recaptcha-bypass-via-http-parameter-pollution.md)
- Type confusion via JSON arrays/empty hashes bypassing `nil?` and stripping WHERE clauses [E2](https://bugbountylibrary.com/r/h1%3A139321.md)
- Namespace-dispatch validator returning success for unmatched keys, storing unvalidated records [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-32mq-hpph-xfvr.md)
- Unbounded per-message processing enabling resource exhaustion [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-32mq-hpph-xfvr.md)

## Impact and severity
CAPTCHA fully bypassed, enabling automated abuse [E1](https://bugbountylibrary.com/r/blog%3Aandresriancho-com-recaptcha-bypass-via-http-parameter-pollution.md). Query-filter stripping chained with a password-reset token flow reached account takeover [E2](https://bugbountylibrary.com/r/h1%3A139321.md). Unvalidated records filled the datastore until disk exhaustion; a shared backend (IPFS repo) also blocked peer store and other writes, taking down the whole node [E3](https://bugbountylibrary.com/r/ghsa%3AGHSA-32mq-hpph-xfvr.md). Impact rose with chaining and shared-resource reach.

## Seen in real software
Open-source packages and projects, and products, where this pattern was found. If the target runs one, compare the version it runs with the fix.
- **Ruby on Rails**: Unsafe Query Generation (CVE-2012-2660, CVE-2012-2694 and CVE-2013-0155) mitigation bypass (CVE-2016-6317, CVE-2012-2660). Report: https://bugbountylibrary.com/r/h1%3A139321.md

## Evidence
- E1: https://bugbountylibrary.com/r/blog%3Aandresriancho-com-recaptcha-bypass-via-http-parameter-pollution.md
- E2: https://bugbountylibrary.com/r/h1%3A139321.md
- E3: https://bugbountylibrary.com/r/ghsa%3AGHSA-32mq-hpph-xfvr.md
