Skip to content
Skills Library
Security · Review & audit

header-privilege-resistance

/header-privilege-resistance

Confirm the API derives privilege from tokens it verifies, not from client-supplied headers that announce who they claim to be. Use when requests travel through proxies or internal layers that may forward X-Forwarded-For, X-User, X-Roles or X-Tenant headers

Repository
authzmap ↗
Licence
MIT
Last repository change
28.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
2
Deprecation

No signals detected. Repository changed on 28.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Confirm the API derives privilege from tokens it verifies, not from client-supplied headers that announce who they claim to be. Use when requests travel through proxies or internal layers that may forward X-Forwarded-For, X-User, X-Roles or X-Tenant headers

Original author description

Confirm the API derives privilege from tokens it verifies, not from client-supplied headers that announce who they claim to be. Use when requests travel through proxies or internal layers that may forward X-Forwarded-For, X-User, X-Roles or X-Tenant headers

How it works

  1. Procedure
  2. Signals
  3. Patterns
  4. Pitfalls
  5. Done when
  6. References
Original SKILL.md headings · 61 lines, 382 words
SKILL.md preview
---
name: header-privilege-resistance
description: "Confirm the API derives privilege from tokens it verifies, not from client-supplied headers that announce who they claim to be. Use when requests travel through proxies or internal layers that may forward X-Forwarded-For, X-User, X-Roles or X-Tenant headers"
pack: authzmap
version: 1.0.0
category: api-security
tags: [headers, privilege, trust]
---

# Header Privilege Resistance

> Confirm the API derives privilege from tokens it verifies, not from client-supplied headers that announce who they claim to be

**Use when:** requests travel through proxies or internal layers that may forward X-Forwarded-For, X-User, X-Roles or X-Tenant headers

**Avoid when:** no privilege decision involves a client-malleable header, and platform review documents the exact header set

## Procedure

1. Enumerate every inbound header that influences identities, tenants, privileges or routing decisions.
2. Send identical requests with and without each such header to map how behavior changes for your own account.
3. Repeat with each of your two test accounts to find headers that substitute for the other account's identity.
4. Check the shared-product cases: tracing, debug, admin-impersonation and internal-service headers that may be widely honored.
5. Confirm gateway overwrites rather than appends values, so a forged header cannot be smuggled past a controlled proxy.
6. Record which headers the production edge strips, keeps and forwards, since only that set influences real tests.

## Signals

- Supplying a forwarded-user header adopts another identity even though the session cookie still identifies you.
- Deprecation or debug headers unlock alternative outputs that behave like an elevated-call shortcut.
- The gateway appends to rather than overwrites forwarding values, letting client-supplied entries persist behind your proxy.
- A tenant header steers per-tenant routing so calls land in a context the credential never settled in.

## Patterns

**1. Identity header**

```text
as alice + X-User: bob1 -> response material for bob1 -> identity taken from request
```

**2. Gateway merge**

```text
arrivals: X-Forwarded-For kept-appended -> gateway must overwrite, not append
```

**3. Result row**

```text
header=X-User trusted=directly privileged-reachable=yes finding=yes
```

## Pitfalls

- Testing only the pretty header names documented publicly, missing internal variants that steer routing too.
- Ignoring forwarded-protocol style headers that shift not just IP but secure-cookies and TLS-driven decisions.
- Assuming the gateway sanitizes headers because it sits in front, when internal services may consume both.

## Done when

- Every identity-influencing header has been probed with your own two accounts and the substitution outcome recorded.
- Production header handling is documented, and no privilege decision remains that a client-controlled header can steer.

## References

- [OWASP - request forgery and header trust](https://cheatsheetseries.owasp.org/)
- [MDN - HTTP headers security checklist](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers)

Versions

The database has no other skills named header-privilege-resistance.

Database snapshot: 13.11.2026 · package version a9ec720ef176 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100privilege-change-session-hygiene
    Verify role, tenant and scope changes invalidate or reissue sessions, so stale credentials never outlive the privilege they once expressed. Use when administrators demote, suspend or change accounts' roles and the system promises control over materialized privileges
  • 90least-privilege-and-mediation
    Enforce least privilege and complete mediation in access control design. Use when reviewing authorization models, RBAC configurations, API access controls, or evaluating whether every request is authorized before access is granted.
  • 100delivery-metadata-header-trust
    Establish which delivery metadata the handler treats as authoritative, since a client-controlled event identifier or tenant claim redirects the effect of an otherwise valid delivery. Use when the receiver derives account, tenant or event identity from headers or top-level fields…
  • 100role-and-claim-catalog
    Catalog the roles and claims your test identities actually carry, so privilege tests target real system state rather than documentation. Use when roles, scopes or tenant claims drive access decisions and you need ground truth for each test identity
  • 100mcp-security-least-privilege-scoping
    Use this skill when scoping MCP server filesystem roots, database credentials, and cloud API tokens to minimum required access.
  • 100http-header-security-audit
    Execute http header security audit operations. Auto-activating skill for Security Fundamentals. Triggers on: http header security audit, http header security audit Part of the Security Fundamentals skill category. Use when analyzing or auditing http header security audit.…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.