CVE-2026-40895
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 · uneditedfollow-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 confidenceThe 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.
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< 1.16.0CVSS 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 checksWork through these to decide whether this CVE applies to you.
-
Identify follow-redirects installation and versionRun 'npm list follow-redirects' in your project directory, or inspect package.json dependencies and package-lock.json for the installed versionAffected if The installed version is less than 1.16.0
-
Locate all JavaScript/TypeScript files that import or require follow-redirectsSearch your codebase for require('follow-redirects') or import ... from 'follow-redirects', and review the files where it is usedAffected if follow-redirects is imported and used in your codebase
-
Identify HTTP requests using custom authentication headersSearch 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 requestsAffected if Custom authentication headers are sent in HTTP requests using follow-redirects
-
Determine if automatic redirect following is enabledInspect 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 enabledAffected if Redirects are being followed (the default behavior of follow-redirects) and custom auth headers are present in the request
-
Check for cross-domain redirect scenariosReview the redirect targets your application encounters by logging response headers (Location header) or using verbose logging to identify if requests ever redirect to different domainsAffected 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.
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 · scoped1.16.0
Upgrade follow-redirects to version 1.16.0 or later, which implements proper stripping of custom authentication headers during cross-domain redirects.
1.16.0
- Check current version of follow-redirects by running: npm list follow-redirects
- Update follow-redirects to version 1.16.0 by running: npm install [email protected]
- Verify the installation was successful by running: npm list follow-redirects and confirming version 1.16.0 is installed
- 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.
- Consultation2.0 h
- Implementation1.0 h
- Testing2.0 h
- Review / QA1.0 h
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 locallyCheck 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- github.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- access.redhat.com
- bugzilla.redhat.com
- security.access.redhat.com
- nvd.nist.gov
Practitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2026-40895 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
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.
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.
- 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