CVE-2026-40895: follow-redirects: Custom Authentication Headers Leaked to Cross-Domain Redirect Targets
follow-redirects is an open source, drop-in replacement for Node's `http` and `https` modules that automatically follows redirects. Prior to 1.16.0, 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). Any custom authentication header (e.g., X-API-Key, X-Auth-Token, Api-Key, Token) is forwarded verbatim to the redirect target. This vulnerability is fixed in 1.16.0.
Security readout for executives and security teams
Plain-English summary
Applications using vulnerable follow-redirects can unintentionally send private custom authentication headers to a different domain after an HTTP redirect. This can expose API keys or tokens to a redirect target the application did not originally intend to trust.
Executive priority
Treat this as a high-priority dependency exposure issue for applications that use API keys or tokens in custom headers. Patch quickly where follow-redirects is present, especially in services calling third-party or user-controlled URLs.
Technical view
Before 1.16.0, follow-redirects stripped authorization, proxy-authorization, and cookie headers on cross-domain redirects, but forwarded custom authentication headers such as X-API-Key or X-Auth-Token. The issue affects follow-redirects versions below 1.16.0 and is fixed in 1.16.0.
Likely exposure
Exposure is most likely in Node.js applications or dependencies using follow-redirects below 1.16.0 while sending custom authentication headers to URLs that may redirect across domains.
Exploitation context
The supplied sources do not show KEV listing or active exploitation evidence. Abuse would require a request path where an application follows a cross-domain redirect while carrying sensitive custom headers.
Researcher notes
Key research question is whether the application can be induced to follow a cross-domain redirect while carrying non-standard secret headers. The public bundle names the fixed version but does not provide active exploitation evidence.
Mitigation direction
Upgrade follow-redirects to version 1.16.0 or later.
Review lockfiles for transitive follow-redirects versions below 1.16.0.
Check Red Hat advisories for affected packaged products and vendor-fixed builds.
Avoid sending custom secrets to URLs that may redirect across trust boundaries.
Rotate exposed API keys or tokens if logs show suspicious redirect paths.
Validation and detection
Inventory Node.js dependency manifests and lockfiles for follow-redirects below 1.16.0.
Identify outbound HTTP clients that send custom authentication headers.
Review redirect-handling paths for cross-domain redirects involving sensitive headers.
Confirm deployed artifacts include follow-redirects 1.16.0 or a vendor-fixed package.
Check proxy, application, and destination logs for unexpected redirected requests.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · medium confidence lookup
CWE-200: Information exposure and cloud metadata lookup
Information exposure and SSRF weaknesses can make discovery, cloud metadata, and credential material review relevant. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
The CVE wording references authentication or credential exposure, so valid-account and credential-access review may help. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-200 · source CWE mapping
Exposure of Sensitive Information to an Unauthorized Actor
Exposure of Sensitive Information to an Unauthorized Actor represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.
Improper Removal of Sensitive Information Before Storage or Transfer
Improper Removal of Sensitive Information Before Storage or Transfer represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.