The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-40895

CVE-2026-40895: Follow-redirects Information Disclosure

CVE-2026-40895 is an information disclosure vulnerability in Follow-redirects that leaks custom authentication headers during cross-domain redirects. This article covers technical details, affected versions, impact, and mitigation.

Published: April 23, 2026

CVE-2026-40895 Overview

CVE-2026-40895 is an information disclosure vulnerability in the follow-redirects Node.js package, a popular drop-in replacement for Node's native http and https modules that automatically handles HTTP redirects. The vulnerability exists in versions prior to 1.16.0 and allows custom authentication headers to be leaked to unauthorized third-party domains during cross-domain redirect scenarios.

When an HTTP request follows a cross-domain redirect (301/302/307/308 status codes), follow-redirects only strips the standard authorization-related headers (Authorization, Proxy-Authorization, and Cookie) using regex matching in index.js. However, any custom authentication headers commonly used in modern APIs—such as X-API-Key, X-Auth-Token, Api-Key, or Token—are forwarded verbatim to the redirect target, potentially exposing sensitive credentials to malicious or unintended recipients.

Critical Impact

Custom API keys and authentication tokens can be leaked to arbitrary third-party domains when applications using follow-redirects follow cross-domain redirects, potentially allowing unauthorized access to protected resources.

Affected Products

  • follow-redirects versions prior to 1.16.0 for Node.js
  • Applications and packages that depend on follow-redirects for HTTP redirect handling
  • Popular packages like axios that use follow-redirects as a dependency

Discovery Timeline

  • April 21, 2026 - CVE-2026-40895 published to NVD
  • April 23, 2026 - Last updated in NVD database

Technical Details for CVE-2026-40895

Vulnerability Analysis

The vulnerability stems from an incomplete header sanitization implementation in the follow-redirects package. When the library processes HTTP redirect responses across domain boundaries, it implements security measures to prevent credential leakage by stripping certain sensitive headers before forwarding the request to the new location. However, the implementation only accounts for standard authentication headers defined in RFC specifications.

Modern web applications and APIs frequently utilize custom headers for authentication purposes. These custom headers—commonly prefixed with X- or using application-specific naming conventions—are not recognized by the existing sanitization logic. As a result, when a request containing such headers encounters a cross-domain redirect, the sensitive authentication data is transmitted to the redirect target without any filtering.

This creates a significant security risk in scenarios where an attacker can control or influence redirect destinations. By setting up a malicious endpoint that issues redirects to attacker-controlled servers, threat actors can harvest API keys and tokens from vulnerable applications.

Root Cause

The root cause is an incomplete allowlist/blocklist approach to header sanitization in the redirect handling logic. The code in index.js uses regex pattern matching to identify and remove sensitive headers, but the patterns only cover the three standard authorization headers (Authorization, Proxy-Authorization, and Cookie). The design fails to account for the widespread use of custom authentication headers in contemporary API implementations, leaving a significant gap in credential protection during redirect scenarios.

Attack Vector

The attack vector is network-based and requires no authentication or user interaction. An attacker can exploit this vulnerability by:

  1. Setting up a malicious server that responds with redirect status codes (301, 302, 307, or 308)
  2. Pointing the redirect Location header to an attacker-controlled endpoint
  3. Waiting for victim applications to make requests to the initial malicious server with custom authentication headers
  4. Collecting the leaked credentials from incoming requests to the redirect target

The vulnerability can be exploited through supply chain attacks, DNS hijacking, or compromised third-party services that applications integrate with. Since the redirect is followed automatically by the library, no user intervention is required for the credential leak to occur.

The vulnerability manifests in the header sanitization logic within index.js where cross-domain redirect handling is implemented. The existing regex patterns fail to match custom authentication header formats. For detailed technical analysis, see the GitHub Security Advisory.

Detection Methods for CVE-2026-40895

Indicators of Compromise

  • Unexpected outbound connections from applications to unknown or suspicious domains following API calls
  • Authentication tokens or API keys appearing in logs of third-party services
  • Unusual activity on API accounts suggesting credential compromise
  • Network traffic showing HTTP requests with sensitive custom headers being sent to unexpected destinations

Detection Strategies

  • Monitor outbound HTTP traffic for cross-domain redirects that carry custom authentication headers
  • Implement network-level inspection to detect authentication headers being transmitted to untrusted domains
  • Review application dependencies using npm audit or similar tools to identify vulnerable follow-redirects versions
  • Deploy runtime application security monitoring to detect credential leakage patterns

Monitoring Recommendations

  • Enable verbose logging for HTTP client libraries to track redirect chains and header transmission
  • Implement alerting for unusual API key usage patterns that may indicate credential theft
  • Monitor for dependency updates and security advisories related to follow-redirects
  • Establish baseline network behavior to identify anomalous redirect patterns

How to Mitigate CVE-2026-40895

Immediate Actions Required

  • Update follow-redirects to version 1.16.0 or later immediately
  • Audit applications for custom authentication header usage with HTTP client libraries
  • Rotate any API keys or tokens that may have been exposed through this vulnerability
  • Review application logs for evidence of cross-domain redirects that may have leaked credentials

Patch Information

The vulnerability has been fixed in follow-redirects version 1.16.0. The patch extends the header sanitization logic to properly handle custom authentication headers during cross-domain redirects. Update using your package manager:

For npm: npm update follow-redirects
For yarn: yarn upgrade follow-redirects

If follow-redirects is a transitive dependency (common with axios), ensure your top-level dependencies are updated to versions that include the patched follow-redirects. For additional details, refer to the GitHub Security Advisory.

Workarounds

  • Configure HTTP clients to disable automatic redirect following and handle redirects manually with proper header sanitization
  • Implement application-level middleware to strip custom authentication headers before requests that may result in cross-domain redirects
  • Use network-level controls to restrict outbound redirects to trusted domains only
  • Consider implementing request interceptors that validate redirect destinations before following them
bash
# Check your current follow-redirects version
npm list follow-redirects

# Update to the patched version
npm install follow-redirects@1.16.0

# Verify the update
npm list follow-redirects

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeInformation Disclosure

  • Vendor/TechFollow Redirects

  • SeverityMEDIUM

  • CVSS Score6.9

  • EPSS Probability0.05%

  • Known ExploitedNo
  • CVSS Vector
  • 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
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-200

  • NVD-CWE-noinfo
  • Vendor Resources
  • GitHub Security Advisory
  • Related CVEs
  • CVE-2024-28849: Follow-redirects Credential Leak Flaw

  • CVE-2023-26159: Follow-redirects Information Disclosure

  • CVE-2022-0536: Follow-redirects Information Disclosure Flaw

  • CVE-2022-0155: Follow-redirects Information Disclosure
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English