Skip to main content

How to fix: X-Request-Id header exposed to clients

The X-Request-Id header is returned in the response and exposes internal request tracking identifiers.

Why it matters

Internal request IDs may leak details about infrastructure, help attackers correlate requests across systems, or reveal predictable ID schemes that enable enumeration or replay attacks.

Request IDs used for internal logging can be stripped from client-facing responses.

How to fix it

  1. 1Remove X-Request-Id from client responses while keeping it in internal logs
  2. 2If needed for debugging, only return it to authenticated users

Code examples

Strip in Nginx

nginx
proxy_hide_header X-Request-Id;

References

Detected automatically by VulnRadar. The check id is x-request-id-exposed, stable across every scan so you can filter or diff on it.

See every headers check

Questions

How severe is X-Request-Id header exposed to clients?
VulnRadar rates this info severity in the headers category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
Does VulnRadar check for this automatically?
Yes. It runs as part of every scan under the check id x-request-id-exposed, which stays the same between runs so you can filter, diff, or gate CI on it.

Missing a check?

The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.

Propose a checkHow a check is built

Scan your own site for x-request-id header exposed to clients

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

X-Request-Id header exposed to clients fix | VulnRadar