CVE-2026-111755
follow-redirects sensitiveHeaders regex escaping can expose credential headers
Archived. This CVE has left SubZer0's live 30-day window. Signals below are as of 2026-11-19; check the references for anything newer.
- Severity: High
- CVSS 8.2
- EPSS 0.47%
- Public exploit
- P2 · This week
Why P2: this week.
Description
### Summary follow-redirects 1.16.0 introduced the `sensitiveHeaders` option (the fix for CVE-2026-40895 / GHSA-r4q5-vmmm-2653), which lets an application declare extra header names that must be removed when a redirect crosses to a different host or downgrades protocol. The filter is a single case-insensitive regular expression built by concatenating the declared header names into an alternation after passing each through `escapeRegex`. `escapeRegex` escapes only a partial set of metacharacters and leaves `^`, `|`, `[`, `{`, and `}` unescaped. Header names may legitimately contain `^` and `|` (both are valid RFC 9110 token characters that Node accepts and sends), and for a declared name containing either, the generated pattern can never match the intended header. As a result, an application that adopts this option to protect a custom credential header, then follows an attacker-controlled cross-origin redirect, forwards that credential to the attacker with no error or warning, while believing it is protected. The failure is silent: the protection simply does not exist for the affected names. The built-in list (Authorization, Proxy-Authorization, Cookie) contains no metacharacters and is not affected by this defect. ### Details The filter is constructed once, in the `RedirectableRequest` constructor at `index.js:118-120`: ```js this._headerFilter = new RegExp("^(?:" + sensitiveHeaders.concat(options.sensitiveHeaders).map(escapeRegex).join("|") + ")$", "i"); ``` `escap…
Affected products
- npm follow-redirects >= 1.16.0, < 1.16.1; first patched: 1.16.1
References
- GitHub security advisory GitHub
- Advisory reference GitHub
- Advisory reference GitHub
- Advisory reference GitHub
- Advisory reference GitHub