Middleware Header Analysis
Read response headers as a map of the middleware chain in front of the application, from cache layers to security controls
Use when: you want to know which intermediate layers process a request before the application itself does
Avoid when: a single response already shows a trivial stack and you have no reason to compare multiple paths
Procedure
- Capture full response headers from several representative paths: static asset, dynamic page and API endpoint.
- Order the observed layers from edge inward: proxy, cache, application server, framework, application.
- Note security control headers such as content security policy, frame protection, referrer policy and permissions policy.
- Identify cache participation from age, cache-control, vary and any edge-specific cache headers.
- Look for headers that leak internal details such as internal request ids, backend names or trace identifiers.
- Record the header profile per path type so later changes after a configuration update show up as diffs.
Signals
- Age and cache headers appear on dynamic pages, meaning responses may be shared between users.
- Internal-sounding request identifiers or backend names appear in headers sent to every client.
- Security headers exist on one path but are missing on another, indicating inconsistent middleware application.
- The vary header changes between paths, showing where content negotiation and caching split.
Patterns
1. Header profile
static: cache-control=public,max-age=31536000, age=4211
dynamic: cache-control=no-store, vary=Cookie, set-cookie=...; HttpOnly
2. Layer order
edge proxy -> cache -> app server -> framework -> handler
evidence: server header, age, x-request-id, framework cookie
3. Control checklist
content-security-policy, x-frame-options or frame-ancestors,
referrer-policy, permissions-policy, cross-origin policies
Pitfalls
- Reading headers from one path and generalizing to the whole application, where middleware often differs by route.
- Ignoring the vary header, which changes whether a cached response can leak between users.
- Treating the presence of a security header as proof it is correctly configured; directives matter more than existence.
Done when
- You have a per-path header profile with the middleware order and cache participation recorded.
- Missing or inconsistent security controls are listed per path type with the evidence captured.
References
1---2name: middleware-header-analysis3description: "Read response headers as a map of the middleware chain in front of the application, from cache layers to security controls. Use when you want to know which intermediate layers process a request before the application itself does"4pack: reconcraft5version: 1.0.06category: bug-bounty-tooling7tags: [headers, middleware, http]8metadata:9 source: https://skillmd.com/skills/wsh7ash/middleware-header-analysis10---1112# Middleware Header Analysis1314> Read response headers as a map of the middleware chain in front of the application, from cache layers to security controls1516**Use when:** you want to know which intermediate layers process a request before the application itself does1718**Avoid when:** a single response already shows a trivial stack and you have no reason to compare multiple paths1920## Procedure21221. Capture full response headers from several representative paths: static asset, dynamic page and API endpoint.232. Order the observed layers from edge inward: proxy, cache, application server, framework, application.243. Note security control headers such as content security policy, frame protection, referrer policy and permissions policy.254. Identify cache participation from age, cache-control, vary and any edge-specific cache headers.265. Look for headers that leak internal details such as internal request ids, backend names or trace identifiers.276. Record the header profile per path type so later changes after a configuration update show up as diffs.2829## Signals3031- Age and cache headers appear on dynamic pages, meaning responses may be shared between users.32- Internal-sounding request identifiers or backend names appear in headers sent to every client.33- Security headers exist on one path but are missing on another, indicating inconsistent middleware application.34- The vary header changes between paths, showing where content negotiation and caching split.3536## Patterns3738**1. Header profile**3940```text41static: cache-control=public,max-age=31536000, age=421142dynamic: cache-control=no-store, vary=Cookie, set-cookie=...; HttpOnly43```4445**2. Layer order**4647```text48edge proxy -> cache -> app server -> framework -> handler49evidence: server header, age, x-request-id, framework cookie50```5152**3. Control checklist**5354```text55content-security-policy, x-frame-options or frame-ancestors,56referrer-policy, permissions-policy, cross-origin policies57```5859## Pitfalls6061- Reading headers from one path and generalizing to the whole application, where middleware often differs by route.62- Ignoring the vary header, which changes whether a cached response can leak between users.63- Treating the presence of a security header as proof it is correctly configured; directives matter more than existence.6465## Done when6667- You have a per-path header profile with the middleware order and cache participation recorded.68- Missing or inconsistent security controls are listed per path type with the evidence captured.6970## References7172- [RFC 9111 - HTTP caching](https://www.rfc-editor.org/rfc/rfc9111)73- [securityheaders.com reference](https://securityheaders.com/)