# 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

- Skill: `wsh7ash/error-surface-authorization-leak` (Agent Skill)
- Install (CLI): `npx get-skill add wsh7ash/error-surface-authorization-leak`
- Raw SKILL.md: https://api.skillmd.com/api/skills/wsh7ash/error-surface-authorization-leak/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: Wsh7Ash (https://skillmd.com/u/wsh7ash)
- Updated: 2026-11-22
- Page: https://skillmd.com/skills/wsh7ash/error-surface-authorization-leak

---


# 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

1. Collect every error response shape the API produces during earlier phases, bucketed by status code and message family.
2. For each shape, check what it distinguishes: object existence, object type, ownership state, tenant, internal path or user identity.
3. Compare the same error across identities: unknown object versus peer-owned versus publicly visible and anonymous.
4. Check validation errors for echo of the request's sensitive fields, since reflection sometimes keeps authorization out-of-band.
5. Inspect stack traces or debug fields in preview and staging environments, which often exist as error variations unavailable in production.
6. 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**

```text
id=unknown -> 404 object-not-found
id=peer-owned -> 403 forbidden-for-owner -> existence leaked per own-profile
```

**2. Reflection check**

```text
payload includes secrets echoes input with credentials -> echo-background needed to distinguish
```

**3. Result row**

```text
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.

## References

- [OWASP - error handling cheat sheet](https://cheatsheetseries.owasp.org/cheatsheets/Error_Handling_Cheat_Sheet.html)
- [OWASP API Security Top 10](https://owasp.org/www-project-api-security/)

