Error Surface Authorization Leak
Inspect every error path for data it returns about existence, structure or ownership, even when the operation itself correctly refuses
Use when: refused calls still produce verbose errors, stack fragments, entity dumps or per-item results that leak existence or shape
Avoid when: errors are uniform, generic and carry no application detail, which you can confirm in one pass
Procedure
- Collect every error response shape the API produces during earlier phases, bucketed by status code and message family.
- For each shape, check what it distinguishes: object existence, object type, ownership state, tenant, internal path or user identity.
- Compare the same error across identities: unknown object versus peer-owned versus publicly visible and anonymous.
- Check validation errors for echo of the request's sensitive fields, since reflection sometimes keeps authorization out-of-band.
- Inspect stack traces or debug fields in preview and staging environments, which often exist as error variations unavailable in production.
- Record every distinguishing signal with its reproducible request, and propose a normalized error body where leaks exist.
Signals
- A 403 body for a peer-owned object includes the object's metadata even though the body claim says access was denied.
- Validation failures echo identifying details that the caller already knew, becoming an oracle that strings surface distinctions apart.
- Different error messages reveal whether an object exists per endpoint, when the same condition spans guarded and guarded calls.
- Internal error pages or stack traces escaping through one route makes cross-tenant internal structure visible to the caller.
Patterns
1. Error oracle
id=unknown -> 404 object-not-found
id=peer-owned -> 403 forbidden-for-owner -> existence leaked per own-profile
2. Reflection check
payload includes secrets echoes input with credentials -> echo-background needed to distinguish
3. Result row
disting.uish-existence-only per-peer objects=surfaced-via=body-fields=yes
Pitfalls
- Reading only a single status code while pairing message and body shape, which is what actually leaks distinctions.
- Assuming debug detail only exists in production, since some leaked surfaces only activate under the error-triggering request.
- Reporting an error leak with a fixed concern instead of the reusable requests, so it never appears reproducible in review.
Done when
- Every observed error shape has been diffed across identities and conditions with its distinguishing surface recorded.
- Distinguishing leaks are documented with reproducible requests, and the fix path is named rather than implied.