Filter Parameter Injection
Add a filter or query parameter the endpoint does not document and observe whether it narrows or widens the result set, because an unvalidated filter changes who sees which rows
Use when: an endpoint returns a filtered list and its parameter handling has not been exercised
Avoid when: a strict allow-list of parameters is enforced and a test confirms unlisted ones are rejected
Procedure
- Capture a baseline list response for a record set you are allowed to read, noting the count and field set.
- Add one undocumented filter parameter and record whether the result set changes.
- Try a filter that would widen access, such as one targeting a tenant or owner field.
- Record the status, the count delta and whether the parameter appears in the response or an error.
- Check whether the filter is applied in the query rather than after fetching, since that affects scale behaviour too.
- Record each parameter with accepted, rejected or ignored as its verdict.
Signals
- An undocumented filter parameter changes the returned count
- A filter targeting an ownership or tenant field is accepted
- The parameter is applied after rows are fetched rather than in the query
- An invalid filter value produces an error that echoes the query structure
Patterns
1. Parameter verdict
param | value | count before | count after | verdict
(sort unspecified) | default | 20 | 20 | baseline
include_internal | true | 20 | 27 | accepted, widened
owner_id | other | 20 | 0 | accepted, filtered by ownership
2. Widen-versus-narrow
record whether the parameter widened or narrowed the set; widening is the direction that changes who sees what
3. Application point
note whether filtering happens in the query or in application code, since a post-fetch filter has a scale consequence as well
Pitfalls
- Adding several parameters at once and losing which one changed the count
- Testing only narrowing filters when widening is the direction that matters
- Missing that a filter changed nothing because the parameter needs a different name
Done when
- Each undocumented parameter has an accepted, rejected or ignored verdict with count delta
- Whether the filter widens or narrows access is stated per parameter