How to fix: Response header points at an internal host
A Location, Content-Location or Link response header contains a URL on an internal hostname. That means a loopback or RFC1918 address, or a private-use suffix such as .internal, .local or .corp.
Why it matters
The header names a host that exists behind the proxy: an internal service name, a pod address, an admin origin. That is free reconnaissance for anyone who later reaches the network another way, and where the URL is a pagination Link, it also tells a client to fetch an address it cannot resolve, which turns into a hard failure rather than a graceful one.
This is nearly always a backend building absolute URLs from its own request context rather than from the public origin, so the internal hostname survives the trip through the proxy. The fix is to construct outward-facing URLs from a configured public base, not from the incoming Host header or the container's own name. Relative URLs sidestep the problem entirely where the header allows them.
How to fix it
- 1Build absolute URLs in responses from an explicit PUBLIC_BASE_URL setting, not from req.headers.host or the local hostname.
- 2Prefer relative references in Location and Link where the specification allows them.
- 3Add a response filter at the edge that rejects or rewrites headers containing private hostnames, as a backstop.
Code examples
Build links from a configured public origin
const PUBLIC_BASE = new URL(process.env.PUBLIC_BASE_URL);
function pageLink(page) {
const u = new URL('/v1/items', PUBLIC_BASE);
u.searchParams.set('page', String(page));
return u.toString();
}
res.set('Link', `<${pageLink(next)}>; rel="next"`);Nginx: keep redirects on the public origin
proxy_redirect http://app-internal:3000/ https://api.example.com/;
absolute_redirect off;References
Detected automatically by VulnRadar. The check id is api-response-header-internal-host, stable across every scan so you can filter or diff on it.
More api checks
- LowTRACE method referenced in API response body
- InfoREST endpoint allows DELETE
- LowGraphQL introspection field suggestions
- MediumGraphQL endpoint has no rate-limit headers
- LowOpenAPI server URL leaks internal host
- LowCORS preflight result not cached
- HighBearer token in URL query string
- MediumJSONP callback parameter accepted
Questions
- How severe is Response header points at an internal host?
- VulnRadar rates this low severity in the api 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 api-response-header-internal-host, which stays the same between runs so you can filter, diff, or gate CI on it.
- Which standards does Response header points at an internal host map to?
- It maps to CWE-200. In the OWASP Top 10 it falls under A05:2021.
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.