Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
📦 npm
Not in CISA KEV

GHSA-r4q5-vmmm-2653 follow-redirects

Fix: follow-redirects/follow-redirects@844c4d3

GHSA-r4q5-vmmm-2653 is a Information Exposure vulnerability in follow-redirects. A fix is available for follow-redirects — see the affected versions and patch details below.

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

Also known asCVE-2026-40895
Published
Apr 14, 2026
Updated
Sep 10, 2026
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Sep 18, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

No confirmed exploitation observed yet

  • CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.

Exploitation and automatability from CISA’s SSVC triage for GHSA-r4q5-vmmm-2653.

EPSS Exploitation Probability

via FIRST.org ↗
0.5%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs41th percentile — riskier than 41% of all scored CVEsHighest risk

EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.

Real-World Exposure

1 pkg affected

How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.

2Kother npm packages depend on this — each one inherits the vulnerability until it's patched upstream
follow-redirectsnpm
73.1Mdownloads / week

Description

Summary

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

Impact

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

Suggested Fix

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

Disclosure

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

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
📦npmfollow-redirectsall versions1.16.0npm install follow-redirects@1.16.0

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for follow-redirects, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update follow-redirects to 1.16.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-r4q5-vmmm-2653 is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like GHSA-r4q5-vmmm-2653 can be triaged on real exposure rather than presence alone.

Tailored to GHSA-r4q5-vmmm-2653. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Fixing This On Your OS

If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.

Red HatImportant

This Important impact information disclosure vulnerability in the follow-redirects npm package allows custom authentication headers (such as X-API-Key or X-Auth-Token) to be forwarded verbatim when HTTP requests follow cross-domain redirects. Applications that pass sensitive authentication headers while using…

ProductFixed inAdvisory
Cryostat 4 on RHEL 9cryostat/cryostat-openshift-console-plugin-rhel9:4.2.0-9RHSA-2026:17789
Cluster Observability Operator 1.5.0cluster-observability-operator/distributed-tracing-console-plugin-pf4-rhel9:1781116645RHSA-2026:26010
multicluster engine for Kubernetes 2.1multicluster-engine/console-mce-rhel9:1780917531RHSA-2026:24536
multicluster engine for Kubernetes 2.11multicluster-engine/console-mce-rhel9:1780910888RHSA-2026:25271
multicluster engine for Kubernetes 2.6multicluster-engine/console-mce-rhel9:1778511348RHSA-2026:17657
multicluster engine for Kubernetes 2.8multicluster-engine/console-mce-rhel9:1778383863RHSA-2026:17699
multicluster engine for Kubernetes 2.9multicluster-engine/console-mce-rhel9:1778532610RHSA-2026:19109
Network Observability (NETOBSERV) 1.11.0network-observability/network-observability-console-plugin-compat-rhel9:1778508956RHSA-2026:16874

Frequently Asked Questions

## Summary 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: ```javascript if (redirectUrl.protocol !== currentUrlPar
O3 Security · Impact-Aware SCA

Is GHSA-r4q5-vmmm-2653 in your dependencies?

O3 Security finds GHSA-r4q5-vmmm-2653 across npm dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.

GHSA-r4q5-vmmm-2653: follow-redirects | O3 Security