Follow RedirectsApplication · Follow Redirects Project

CVE-2026-40895

HIGH · 7.5 CVSS v3.1 Published 2026-04-21
Fix available
A fix is available. Upgrade to 1.16.0 or later.
See remediation →
84/100
Remediation priority · High
Remotely reachable No privileges Zero-click

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
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.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

The follow-redirects library (a drop-in replacement for Node.js http/https modules) prior to version 1.16.0 fails to strip custom authentication headers during cross-domain HTTP redirects (301/302/307/308). While the library correctly removes authorization, proxy-authorization, and cookie headers, custom headers like X-API-Key, X-Auth-Token, Api-Key, and Token are forwarded verbatim to the redirect target domain, potentially exposing sensitive credentials to untrusted third-party domains.

MitigationUpgrade follow-redirects to version 1.16.0 or later, which implements proper stripping of custom authentication headers during cross-domain redirects.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
Follow RedirectsApplication
Affected:< 1.16.0

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Identify follow-redirects installation and version
    Run 'npm list follow-redirects' in your project directory, or inspect package.json dependencies and package-lock.json for the installed version
    Affected if The installed version is less than 1.16.0
  2. Locate all JavaScript/TypeScript files that import or require follow-redirects
    Search your codebase for require('follow-redirects') or import ... from 'follow-redirects', and review the files where it is used
    Affected if follow-redirects is imported and used in your codebase
  3. Identify HTTP requests using custom authentication headers
    Search your codebase for requests that include custom headers such as X-API-Key, X-Auth-Token, X-Access-Token, Authorization, or other custom authentication headers passed via the 'headers' option in follow-redirects requests
    Affected if Custom authentication headers are sent in HTTP requests using follow-redirects
  4. Determine if automatic redirect following is enabled
    Inspect how follow-redirects is configured in your code - by default it follows redirects automatically; check if maxRedirects option is set or if the redirect handling is explicitly enabled
    Affected if Redirects are being followed (the default behavior of follow-redirects) and custom auth headers are present in the request
  5. Check for cross-domain redirect scenarios
    Review the redirect targets your application encounters by logging response headers (Location header) or using verbose logging to identify if requests ever redirect to different domains
    Affected if HTTP requests using follow-redirects can result in redirects to different domains (301/302/307/308 responses with Location pointing to another domain)

You are affected if follow-redirects version < 1.16.0 is installed AND your code uses custom authentication headers in requests that may be redirected to a different domain.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to 1.16.0 or later
Fixed in 1.16.0
Interim mitigation

Upgrade follow-redirects to version 1.16.0 or later, which implements proper stripping of custom authentication headers during cross-domain redirects.

Recommended fix High confidence

1.16.0

  1. Check current version of follow-redirects by running: npm list follow-redirects
  2. Update follow-redirects to version 1.16.0 by running: npm install [email protected]
  3. Verify the installation was successful by running: npm list follow-redirects and confirming version 1.16.0 is installed
  4. Regenerate any API keys or tokens that may have been previously exposed through redirect headers as a precaution

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Follow Redirects Scoped from the published advisory
  • Consultation2.0 h
  • Implementation1.0 h
  • Testing2.0 h
  • Review / QA1.0 h
6.0 hours of engineering $1,060
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $1,696.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2026-40895 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2026-40895 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data