KEVWire

Security intelligence, with context.

Response snapshot Nov 3, 2026, 01:01 UTC

Back to the wire
Permalink
VulnerabilityCVE-2026-40895

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.

At a glance

Exploited
Not known
Severity
6.9 Medium (CVSS 4.0)
Chance of exploitation
Not estimated
Sources
2 independent sources

What to do

GitHub lists first patched versions: follow-redirects: 1.16.0. Confirm the affected range and upgrade guidance in the exact advisory.

Read GitHub-reviewed advisory GHSA-r4q5-vmmm-2653 (opens a new tab)

What happened

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

Continue reading

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 package ranges reported by GitHub: follow-redirects: <= 1.15.11

Scores and how they were measured

CVSS base severity

6.9

Version 4.0As of

CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

Measurement source (opens a new tab)

How bad it is if exploited. Not a prediction of exploitation or proof you are exposed.

EPSS probability

Not available

A model's estimate of exploitation in the next 30 days, not certainty or your own risk.

Related technology

Sources

  1. Primary source

    GitHub-reviewed advisory GHSA-r4q5-vmmm-2653 (opens a new tab)

    The public advisory supplies the description, affected package/version ranges, and any listed CVSS metric. GitHub review is not local review.

    Published Checked

  2. Primary source

    GitHub public advisory API page (opens a new tab)

    The API page supplied GHSA-r4q5-vmmm-2653, its actual identifiers, source dates, and structured metrics.

    Published Date not suppliedChecked

  3. Primary source

    NVD CVE-2026-40895 (opens a new tab)

    NVD record: description, CVSS (the CNA score is preferred), affected products, and publication date. Not evidence of exploitation.

    Published Checked

  4. Primary source

    Vendor advisory (via NVD references) (opens a new tab)

    The vendor advisory referenced by the CVE record, for affected versions and fixes.

    Published Date not suppliedChecked

  5. Primary source

    NVD CVE API 2.0 (opens a new tab)

    The NVD API page that supplied this CVE record.

    Published Date not suppliedChecked

  6. Primary source

    NVD CVE API 2.0 (opens a new tab)

    The NVD API page that supplied this CVE record.

    Published Date not suppliedChecked

Cite this record

For factual claims, cite the primary sources above; cite KEVWire for its compilation, dates, and classifications.

APA

KEVWire. (2026, November 3). follow-redirects leaks Custom Authentication Headers to Cross-Domain Redirect Targets (CVE-2026-40895). https://kevwire.com/record/CVE-2026-40895

MLA

"follow-redirects leaks Custom Authentication Headers to Cross-Domain Redirect Targets (CVE-2026-40895)." KEVWire, 3 Nov. 2026, kevwire.com/record/CVE-2026-40895.

Chicago

KEVWire. "follow-redirects leaks Custom Authentication Headers to Cross-Domain Redirect Targets (CVE-2026-40895)." Last modified November 3, 2026. https://kevwire.com/record/CVE-2026-40895.

Evidence summary (plain text)

follow-redirects leaks Custom Authentication Headers to Cross-Domain Redirect Targets (Apr 14, 2026).
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.

index.js, lines 469-476:

The regex only matches authorization, proxy-authorization, and cookie.
CVSS 6.9 (version 4.0; evidence as of Nov 3, 2026; https://nvd.nist.gov/vuln/detail/CVE-2026-40895).
Sources:
GitHub-reviewed advisory GHSA-r4q5-vmmm-2653: https://github.com/advisories/GHSA-r4q5-vmmm-2653
GitHub public advisory API page: https://api.github.com/advisories?type=reviewed&per_page=100&sort=updated&direction=desc
NVD CVE-2026-40895: https://nvd.nist.gov/vuln/detail/CVE-2026-40895
Vendor advisory (via NVD references): https://github.com/follow-redirects/follow-redirects/security/advisories/GHSA-r4q5-vmmm-2653
NVD CVE API 2.0: https://services.nvd.nist.gov/rest/json/cves/2.0?lastModStartDate=2026-11-02T23:30:59.849Z&lastModEndDate=2026-11-03T01:00:58.169Z&resultsPerPage=500&startIndex=0
NVD CVE API 2.0: https://services.nvd.nist.gov/rest/json/cves/2.0?lastModStartDate=2026-11-02T22:55:57.382Z&lastModEndDate=2026-11-03T00:30:56.885Z&resultsPerPage=500&startIndex=0
Record ID: CVE-2026-40895.
Record origin: Ingested record.
AI evidence: Not assessed.
Known exploitation: Not assessed.
Zero-day status: Not assessed. KEV membership alone does not establish zero-day status.
About this data

This record was ingested from a data source. Retrieved: Nov 3, 2026, 01:00 UTC. Ingestion is not an independent editorial investigation.

A CISA KEV listing documents known exploitation, not necessarily a zero-day; absence from the catalog does not prove a vulnerability has never been exploited.

Technology tags indicate possible relevance, not verified exposure. Confirm the affected product, version, and configuration against your own inventory; KEVWire does not scan your systems.

A personal reading checklist on this device, not verified remediation.

Record JSON

Your account

Email alerts

Email alerts are coming as part of KEVWire Premium: join the waitlist. To follow your stack today, use its RSS feed, which honors your filters, or connect an AI agent through the API.

Suggest an improvement

Ideas, missing sources, corrections, and bugs are all welcome. No account needed. Suggestions are reviewed by a person before anything changes.

Record details

Record detail