Skip to main content
Vulnerability Database/CVE-2026-111755

CVE-2026-111755: follow-redirects Header Leak Vulnerability

CVE-2026-111755 is an information disclosure flaw in the follow-redirects Node.js library that exposes sensitive headers during redirects. This post covers the technical details, affected versions, and mitigation strategies.

Published:

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

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-111755 Overview

CVE-2026-111755 affects follow-redirects, a widely used Node.js HTTP and HTTPS client wrapper that automatically follows redirects. Version 1.16.0 contains a flaw in the escapeRegex function that leaves regular-expression metacharacters ^ and | unescaped when building the sensitiveHeaders filter. When an application declares a sensitive header name containing either character and follows a cross-origin or HTTPS-to-HTTP redirect, the filter fails to match the header. The library then forwards the credential header to an attacker-controlled redirect target. The issue is fixed in version 1.16.1.

Critical Impact

Credential headers declared as sensitive can leak to attacker-controlled hosts across redirects, exposing authentication tokens, API keys, and cookies.

Affected Products

  • follow-redirects npm package version 1.16.0
  • Node.js applications depending on follow-redirects 1.16.0 directly or transitively
  • HTTP client libraries bundling follow-redirects 1.16.0 (for example, Axios)

Discovery Timeline

  • 2026-10-19 - CVE-2026-111755 published to NVD
  • 2026-10-19 - Last updated in NVD database

Technical Details for CVE-2026-111755

Vulnerability Analysis

The follow-redirects library maintains a sensitiveHeaders list to strip authentication-bearing headers when a redirect sends the request to a different origin or downgrades HTTPS to HTTP. To match headers case-insensitively, the library compiles the list into a regular expression using an internal escapeRegex helper. In 1.16.0 that helper escaped most RegExp metacharacters but omitted ^ and |.

When a developer registered a sensitive header name containing ^ or |, those characters were interpreted by the RegExp engine as anchors and alternation instead of literal characters. The generated filter therefore did not match the declared header name, and the library preserved the header through the redirect chain. An attacker who controls or influences the redirect target receives the credential.

The weakness is categorized as [CWE-185] Incorrect Regular Expression. Exploitation requires an application that both declares a non-standard sensitive header name and performs redirects to attacker-reachable destinations.

Root Cause

The escapeRegex function used an incomplete character class in its replacement pattern. It escaped ], \, /, (, ), *, +, ?, ., and $, but omitted ^ and |. Any header name containing those two metacharacters produced an invalid filter expression that silently failed to match.

Attack Vector

An attacker needs an application that uses follow-redirects 1.16.0, declares a sensitive header name containing ^ or |, and issues a request to a URL that redirects cross-origin or from HTTPS to HTTP. The target of the final redirect receives the credential header verbatim. The attack is network-reachable and requires no authentication, though it depends on the victim application's header configuration.

javascript
// Patch: Escape all RegExp modifiers in escapeRegex (index.js)
 function escapeRegex(regex) {
-  return regex.replace(/[\]\\/()*+?.$]/g, "\\$&");
+  return regex.replace(/[[\]\\/()*+?.^$|]/g, "\\$&");
 }
// Source: https://github.com/follow-redirects/follow-redirects/commit/080a76d0e125b37bf81717368a61d5dc37aa56c8

The fix adds [, ^, and | to the escaped character class so every header name is treated as a literal string in the generated filter.

Detection Methods for CVE-2026-111755

Indicators of Compromise

  • Outbound HTTP requests to unexpected hosts carrying Authorization, Cookie, or custom API-key headers after a 3xx redirect.
  • Access logs on third-party endpoints showing credential headers that should have been stripped mid-redirect.
  • Dependency manifests (package-lock.json, yarn.lock) pinning follow-redirects at 1.16.0.

Detection Strategies

  • Run npm ls follow-redirects across repositories and CI pipelines to enumerate direct and transitive uses of version 1.16.0.
  • Add Software Composition Analysis (SCA) rules that flag follow-redirects@1.16.0 as vulnerable to CVE-2026-111755.
  • Instrument HTTP client wrappers to log cases where a redirect changes origin or scheme while sensitive headers remain attached.

Monitoring Recommendations

  • Alert on egress traffic from application servers to domains outside an allowlist, especially traffic containing bearer tokens or API keys.
  • Monitor web application firewalls and forward proxies for redirect chains that cross trust boundaries.
  • Track dependency drift so new builds cannot regress to the vulnerable version.

How to Mitigate CVE-2026-111755

Immediate Actions Required

  • Upgrade follow-redirects to version 1.16.1 or later across all applications and container images.
  • Audit header names registered in sensitiveHeaders for ^ or | characters that would have bypassed the filter.
  • Rotate credentials for any sensitive header name that could have leaked through a redirect to a non-trusted host.

Patch Information

The fix landed in follow-redirects 1.16.1. See the GitHub Security Advisory GHSA-8r9p-f939-6h3c, the GitHub Release v1.16.1, and the GitHub Commit 080a76d for the patched escapeRegex implementation.

Workarounds

  • Avoid registering sensitive header names containing RegExp metacharacters until the upgrade is deployed.
  • Disable automatic redirect following in HTTP clients that handle credentialed requests, and inspect 3xx responses manually.
  • Restrict outbound HTTP egress from application servers to an explicit allowlist of trusted hosts.
bash
# Upgrade follow-redirects to the patched version
npm install follow-redirects@1.16.1 --save

# Verify no vulnerable version remains in the dependency tree
npm ls follow-redirects | grep 1.16.0

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

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.