GHSA-R4Q5-VMMM-2653

GHSA-R4Q5-VMMM-2653 is a medium-severity security vulnerability in follow-redirects (npm), affecting versions <= 1.15.11. It is fixed in 1.16.0.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

follow-redirects leaks Custom Authentication Headers to Cross-Domain Redirect Targets

When an HTTP request follows a cross-domain redirect (301/302/307/308), follow-redirects only strips authorization, proxy-authorization, and cookie headers (matched by regex at index.js:469-476). Any custom authentication header (e.g., X-API-Key, X-Auth-Token, Api-Key, Token) is forwarded verbatim to the redirect target.

Since follow-redirects is the redirect-handling dependency for axios (105K+ stars), this vulnerability affects the entire axios ecosystem.

Affected Code

index.js, lines 469-476:

if (redirectUrl.protocol !== currentUrlParts.protocol &&
   redirectUrl.protocol !== "https:" ||
   redirectUrl.host !== currentHost &&
   !isSubdomain(redirectUrl.host, currentHost)) {
  removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers);
}

The regex only matches authorization, proxy-authorization, and cookie. Custom headers like X-API-Key are not matched.

Attack Scenario

  1. App uses axios with custom auth header: headers: { 'X-API-Key': 'sk-live-secret123' }
  2. Server returns 302 Location: https://evil.com/steal
  3. follow-redirects sends X-API-Key: sk-live-secret123 to evil.com
  4. Attacker captures the API key

Disclosure

Source code review, manually verified. Found 2026-03-20.

Impact

Any custom auth header set via axios leaks on cross-domain redirect. Extremely common pattern. Affects all axios users in Node.js.

Affected versions

follow-redirects (<= 1.15.11)

Security releases

follow-redirects → 1.16.0 (npm)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

Add a sensitiveHeaders option that users can extend, or strip ALL non-standard headers on cross-domain redirect.

Frequently Asked Questions

  1. What is GHSA-R4Q5-VMMM-2653? GHSA-R4Q5-VMMM-2653 is a medium-severity security vulnerability in follow-redirects (npm), affecting versions <= 1.15.11. It is fixed in 1.16.0.
  2. Which versions of follow-redirects are affected by GHSA-R4Q5-VMMM-2653? follow-redirects (npm) versions <= 1.15.11 is affected.
  3. Is there a fix for GHSA-R4Q5-VMMM-2653? Yes. GHSA-R4Q5-VMMM-2653 is fixed in 1.16.0. Upgrade to this version or later.
  4. Is GHSA-R4Q5-VMMM-2653 exploitable, and should I be worried? Whether GHSA-R4Q5-VMMM-2653 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  5. What actually determines whether GHSA-R4Q5-VMMM-2653 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  6. How do I fix GHSA-R4Q5-VMMM-2653? Upgrade follow-redirects to 1.16.0 or later.

Other vulnerabilities in follow-redirects

Stop the waste.
Protect your environment with Kodem.