Every CVE Search/ Get API key

CVE-2026-40895

follow-redirects: Custom Authentication Headers Leaked to Cross-Domain Redirect Targets

6.9 MediumFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
Low
Integrity
None
Availability
None

Exploit likelihood

0.49%Up 0.4 points since Apr 22, 2026
90%50%10%1%

What each source reports

CVE List Score used 6.9

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.

Record
CVE-2026-40895
CVSS 4.0
6.9 MediumCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Weakness
CWE-200, CWE-212
Updated
2026-11-02
EUVDEUVD-2026-24472 6.9

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.

Record
EUVD-2026-24472
CVSS 4.0
6.9 MediumCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N
Updated
2026-11-03
GitHub AdvisoriesGHSA-r4q5-vmmm-2653 6.9

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

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.

Record
GHSA-r4q5-vmmm-2653
CVSS 4.0
6.9 MediumCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N
Weakness
CWE-200
Updated
2026-11-03
NVD 6.9

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.

Record
CVE-2026-40895
CVSS 4.0
6.9 MediumCVSS: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
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Weakness
CWE-200, CWE-212
Updated
2026-11-03
OSV 6.9

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.

Record
CVE-2026-40895
CVSS 4.0
6.9 MediumCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N
Weakness
CWE-200
Updated
2026-11-04
OSVDEBIAN-CVE-2026-40895 7.5

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.

Record
DEBIAN-CVE-2026-40895
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Updated
2026-11-03
Show 15 moreShow less
OSVGHSA-r4q5-vmmm-2653 6.9

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

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.

Record
GHSA-r4q5-vmmm-2653
CVSS 4.0
6.9 MediumCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N
Weakness
CWE-200
Updated
2026-11-03
OSVUBUNTU-CVE-2026-40895 6.9

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.

Record
UBUNTU-CVE-2026-40895
CVSS 4.0
6.9 MediumCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Updated
2026-11-02
OSVCLSA-2026-1777163888 No score

TuxCare security update for follow-redirects (2 CVEs)

TuxCare rebuilt follow-redirects to address 2 CVEs. Fixed in 1.15.11-tuxcare.2.

Record
CLSA-2026-1777163888
Updated
2026-11-02
OSVCLSA-2026-1778805975 No score

TuxCare security update for follow-redirects (1 CVE)

TuxCare rebuilt follow-redirects to address 1 CVE. Fixed in 0.0.3-tuxcare.2.

Record
CLSA-2026-1778805975
Updated
2026-11-02
OSVCLSA-2026-1782176274 No score

TuxCare security update for follow-redirects (5 CVEs)

TuxCare rebuilt follow-redirects to address 5 CVEs. Fixed in 1.5.10-tuxcare.1.

Record
CLSA-2026-1782176274
Updated
2026-11-02
OSVCLSA-2026-1782262689 No score

TuxCare security update for follow-redirects (2 CVEs)

TuxCare rebuilt follow-redirects to address 2 CVEs. Fixed in 1.15.9-tuxcare.1.

Record
CLSA-2026-1782262689
Updated
2026-11-02
OSVCLSA-2026-1782262690 No score

TuxCare security update for follow-redirects (3 CVEs)

TuxCare rebuilt follow-redirects to address 3 CVEs. Fixed in 1.15.5-tuxcare.1.

Record
CLSA-2026-1782262690
Updated
2026-11-02
OSVCLSA-2026-1782262692 No score

TuxCare security update for follow-redirects (4 CVEs)

TuxCare rebuilt follow-redirects to address 4 CVEs. Fixed in 1.15.3-tuxcare.1.

Record
CLSA-2026-1782262692
Updated
2026-11-02
OSVCLSA-2026-1782262693 No score

TuxCare security update for follow-redirects (4 CVEs)

TuxCare rebuilt follow-redirects to address 4 CVEs. Fixed in 1.15.2-tuxcare.1.

Record
CLSA-2026-1782262693
Updated
2026-11-02
OSVCLSA-2026-1782262694 No score

TuxCare security update for follow-redirects (1 CVE)

TuxCare rebuilt follow-redirects to address 1 CVE. Fixed in 1.15.6-tuxcare.1.

Record
CLSA-2026-1782262694
Updated
2026-11-02
OSVCLSA-2026-1787663318 No score

TuxCare security update for follow-redirects (1 CVE)

TuxCare rebuilt follow-redirects to address 1 CVE. Fixed in 0.0.3-tuxcare.3.

Record
CLSA-2026-1787663318
Updated
2026-11-02
OSVCLSA-2026-1787664257 No score

TuxCare security update for follow-redirects (1 CVE)

TuxCare rebuilt follow-redirects to address 1 CVE. Fixed in 1.5.10-tuxcare.2.

Record
CLSA-2026-1787664257
Updated
2026-11-02
OSVCLSA-2026-1792074325 No score

TuxCare security update for follow-redirects (4 CVEs)

TuxCare rebuilt follow-redirects to address 4 CVEs. Fixed in 1.2.6-tuxcare.2.

Record
CLSA-2026-1792074325
Updated
2026-11-02
OSVROOT-APP-NPM-GHSA-r4q5-vmmm-2653 No score

GHSA-r4q5-vmmm-2653 in @rootio/follow-redirects - Patched by Root

Root has patched GHSA-r4q5-vmmm-2653 in the @rootio/follow-redirects package for Root:npm. Multiple fixed versions available.

Record
ROOT-APP-NPM-GHSA-r4q5-vmmm-2653
Updated
2026-11-02
OSVUSN-8632-1 No score

node-follow-redirects vulnerability

Dennis Sepede discovered that follow-redirects did not properly remove custom authentication headers when following cross-domain redirects. An attacker could possibly use this issue to obtain sensitive authentication information, resulting in credential disclosure.

Record
USN-8632-1
Updated
2026-11-02

Affected products

Show 71 moreShow less

Affected packages

Affected packages
PackageAffectedFixed
follow-redirects
npm
through 1.15.11
1.16.0
follow-redirects
TuxCare:npm
1.15.11-tuxcare.0 up to 1.15.11-tuxcare.2, plus listed versions
1.15.111.15.11-tuxcare.1
1.15.11-tuxcare.2
follow-redirects
TuxCare:npm
0.0.3-tuxcare.0 up to 0.0.3-tuxcare.2, plus listed versions
0.0.30.0.3-tuxcare.1
0.0.3-tuxcare.2
follow-redirects
TuxCare:npm
From an advisory covering 4 CVEs
1.5.10-tuxcare.0 up to 1.5.10-tuxcare.1, plus listed versions
1.5.10
1.5.10-tuxcare.1
follow-redirects
TuxCare:npm
1.15.9-tuxcare.0 up to 1.15.9-tuxcare.1, plus listed versions
1.15.9
1.15.9-tuxcare.1
follow-redirects
TuxCare:npm
From an advisory covering 2 CVEs
1.15.5-tuxcare.0 up to 1.15.5-tuxcare.1, plus listed versions
1.15.5
1.15.5-tuxcare.1
follow-redirects
TuxCare:npm
From an advisory covering 3 CVEs
1.15.3-tuxcare.0 up to 1.15.3-tuxcare.1, plus listed versions
1.15.3
1.15.3-tuxcare.1
follow-redirects
TuxCare:npm
From an advisory covering 3 CVEs
1.15.2-tuxcare.0 up to 1.15.2-tuxcare.1, plus listed versions
1.15.2
1.15.2-tuxcare.1
follow-redirects
TuxCare:npm
1.15.6-tuxcare.0 up to 1.15.6-tuxcare.1, plus listed versions
1.15.6
1.15.6-tuxcare.1
follow-redirects
TuxCare:npm
0.0.3-tuxcare.0 up to 0.0.3-tuxcare.3, plus listed versions
0.0.30.0.3-tuxcare.10.0.3-tuxcare.2
0.0.3-tuxcare.3
Show 14 moreShow less
Affected packages
PackageAffectedFixed
follow-redirects
TuxCare:npm
1.5.10-tuxcare.0 up to 1.5.10-tuxcare.2, plus listed versions
1.5.101.5.10-tuxcare.1
1.5.10-tuxcare.2
follow-redirects
TuxCare:npm
From an advisory covering 4 CVEs
1.2.6-tuxcare.0 up to 1.2.6-tuxcare.2, plus listed versions
1.2.61.2.6-tuxcare.1
1.2.6-tuxcare.2
node-follow-redirects
Debian:12
All versions, plus listed versions
1.15.11+~1.14.4-11.15.11+~1.14.4-21.15.2+~1.14.1-11.15.3+~1.14.2-11.15.6+~1.14.4-1
Show 5 moreShow less
1.15.6+~1.14.4-21.15.9+~1.14.4-11.16.0+~1.14.4-11.16.0+~1.14.4-21.16.1+~1.14.4-1
None known
node-follow-redirects
Debian:13
All versions, plus listed versions
1.15.11+~1.14.4-11.15.11+~1.14.4-21.15.9+~1.14.4-11.16.0+~1.14.4-11.16.0+~1.14.4-21.16.1+~1.14.4-1
None known
node-follow-redirects
Debian:14
before 1.16.0+~1.14.4-1, plus listed versions
1.15.11+~1.14.4-11.15.11+~1.14.4-21.15.9+~1.14.4-1
1.16.0+~1.14.4-1
follow-redirects
npm
before 1.16.0
1.16.0
@rootio/follow-redirects
Root:npm
before 1.15.11-root.io.1
1.15.11-root.io.11.15.6-root.io.11.15.11-root.io.21.15.6-root.io.21.15.9-root.io.1
follow-redirects
Root:npm
before 1.15.11-aikido.2
1.15.11-aikido.21.15.6-aikido.21.15.9-aikido.1
node-follow-redirects
Ubuntu:Pro:18.04:LTS
before 1.2.4-1ubuntu0.18.04.1~esm2, plus listed versions
1.2.4-11.2.4-1ubuntu0.18.04.1~esm1
1.2.4-1ubuntu0.18.04.1~esm2
node-follow-redirects
Ubuntu:Pro:20.04:LTS
before 1.2.4-1ubuntu0.20.04.1~esm2, plus listed versions
1.2.4-11.2.4-1ubuntu0.20.04.1~esm1
1.2.4-1ubuntu0.20.04.1~esm2
node-follow-redirects
Ubuntu:Pro:22.04:LTS
before 1.14.9+~1.14.1-1ubuntu0.1~esm2, plus listed versions
1.13.1-11.14.5-11.14.7+~1.13.1-11.14.8+~1.14.0-11.14.9+~1.14.1-11.14.9+~1.14.1-1ubuntu0.1~esm1
1.14.9+~1.14.1-1ubuntu0.1~esm2
node-follow-redirects
Ubuntu:Pro:24.04:LTS
before 1.15.6+~1.14.4-1ubuntu0.1~esm1, plus listed versions
1.15.2+~1.14.1-11.15.3+~1.14.2-11.15.6+~1.14.4-1
1.15.6+~1.14.4-1ubuntu0.1~esm1
node-follow-redirects
Ubuntu:25.10
All versions, plus listed versions
1.15.9+~1.14.4-1
None known
node-follow-redirects
Ubuntu:Pro:26.04:LTS
before 1.15.11+~1.14.4-1ubuntu0.1~esm1, plus listed versions
1.15.9+~1.14.4-11.15.11+~1.14.4-1build1
1.15.11+~1.14.4-1ubuntu0.1~esm1

History

History
RecordedChangedSources
affected
factsOSV
referencesOSV
affectedEUVD, NVD, OSV
referencesGitHub Advisories, OSV
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2026-40895 is a medium vulnerability (CVSS 6.9) in Follow-redirects, published April 14, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.49%, the 42nd percentile. Fixed in follow-redirects 1.16.0.

References

Show 52 moreShow less
MoveEnter Open