CVE-2026-116689: follow-redirects: Cross-realm sensitiveHeaders arrays are discarded and custom credentials can follow redirects

Published Oct 27, 2026
·
Updated

Summary

follow-redirects 1.16.0 and 1.16.1 validate the documented sensitiveHeaders option with instanceof Array. An array created in another JavaScript realm is silently replaced with an empty list, so a caller-declared custom credential header can be forwarded to an attacker-controlled cross-origin redirect destination.

Details

Affected versions

The sensitiveHeaders option was introduced in 1.16.0. Published 1.16.0 and 1.16.1 both reproduced, giving a tested affected range of 1.16.0 through 1.16.1. The source checkout was pinned at revision 46301256333c90b7faac7aa126effe72ec16d16e; the exact npm 1.16.1 artifact reproduced independently.

Root cause

index.js resets options.sensitiveHeaders when its local isArray() helper returns false. That helper uses value instanceof Array, which depends on realm identity. The same file already uses Array.isArray(options.headers), which correctly recognizes arrays across realms.

Suggested remediation

Use Array.isArray(value) for sensitiveHeaders, then validate and normalize each member as a header-name string. Add same-realm and node:vm cross-realm tests for cross-origin redirects, including the array-form headers representation. Verify that custom sensitive names are removed while unrelated headers remain unchanged.

Duplicate review

The public advisory history contains other sensitive-header findings, including array-form headers and regular-expression handling, but focused repository searches found no report describing cross-realm validation as of 2026-10-25. A private or differently worded report may already exist.

Proof of concept

Start two loopback HTTP servers. The first returns a 302 redirect to the second. Send X-API-Key and list that name in sensitiveHeaders, then compare a normal array with a genuine cross-realm array created by:

js const vm = require('node:vm'); const sensitiveHeaders = vm.runInNewContext(['X-API-Key']);

Observed against both source and the exact npm 1.16.1 package:

- Same-realm ['X-API-Key']: the redirect target did not receive the key. - Cross-realm ['X-API-Key']: Array.isArray(value) was true, value instanceof Array was false, and the redirect target received X-API-Key. - An unrelated X-Harmless header remained present in both cases.

The complete 3.5 KB loopback-only harness and raw JSON output are available privately.

Impact

custom credential disclosure. Exploitation requires a direct caller or wrapper that preserves a cross-realm sensitiveHeaders array, a custom credential listed in that option, and an attacker-controlled or compromised endpoint that returns a cross-origin redirect. The directly demonstrated result is disclosure of the custom header value, potentially exposing an API key or service token until revocation.

Built-in Authorization, Proxy-Authorization, and Cookie protections remained effective. Exact Axios 1.20.0 with follow-redirects 1.16.1 did not reproduce because Axios normalized the array; this report does not claim that Axios is affected. No third-party service was tested.

Other sources

follow-redirects is a Node.js HTTP and HTTPS client wrapper that automatically follows redirects. From 1.16.0 until 1.16.2, the documented sensitiveHeaders option is checked with value instanceof Array, so an array created in another JavaScript realm is replaced with an empty list even though Array.isArray recognizes it. When a request then follows an attacker-controlled cross-origin redirect, a custom credential header named in that discarded list can be forwarded to the redirect destination. This issue is fixed in version 1.16.2.

— Ubuntu

Affected Software

13 affected componentsFixes available
npm/follow-redirects>=1.16.0<1.16.2
ubuntu/node-follow-redirects*
ubuntu/node-follow-redirects*
ubuntu/node-follow-redirects*
ubuntu/node-follow-redirects*
ubuntu/node-follow-redirects*
ubuntu/node-follow-redirects*
npm/follow-redirects>=1.16.0<=1.16.1
1.16.2
npm/follow-redirects>=1.16.0<1.16.2
1.16.2
debian/node-follow-redirects*
debian/node-follow-redirects*
debian/node-follow-redirects<1.16.3+~1.14.4-1
1.16.3+~1.14.4-1
debian/node-follow-redirects<=1.15.2+~1.14.1-1, <=1.15.9+~1.14.4-1
1.16.3+~1.14.4-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/follow-redirects to a version that resolves this vulnerability.

    Fixed in 1.16.2
  2. Upgrade

    Upgrade debian/node-follow-redirects to a version that resolves this vulnerability.

    Fixed in 1.16.3+~1.14.4-1
  3. Upgrade

    Upgrade follow-redirects to a version that resolves this vulnerability.

    Fixed in 1.16.2

Event History

Oct 27, 2026
CVE Published
via Ubuntu·12:00 AM
Data Sourced
via Ubuntu·12:00 AM
RemedyDescriptionSeverityAffected Software
CVE Published
via MITRE·07:38 PM
Data Sourced
via MITRE·07:38 PM
DescriptionSeverityWeakness
Data Sourced
via Red Hat·07:53 PM
DescriptionSeverityAffected Software
Data Sourced
via NVD·08:17 PM
DescriptionSeverityWeakness
Oct 28, 2026
Data Sourced
via OSV·08:17 PM
Affected Software
Oct 30, 2026
Advisory Published
via GitHub·10:59 PM
Data Sourced
via GitHub·10:59 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What conditions are required for credential exposure?

The application must supply sensitiveHeaders as an array created in another JavaScript realm, include a custom credential header in that list, and follow an attacker-controlled cross-origin redirect. Under those conditions, the header can be forwarded to the redirect destination.

2

Are applications using the documented sensitiveHeaders option automatically protected?

Not if the option is passed as an array from another JavaScript realm. The affected check discards that array, leaving the custom headers it named unprotected during redirects.

3

What is the recommended remediation?

Upgrade follow-redirects to version 1.16.2, which fixes the issue.

4

How can I identify potentially affected usage?

Review use of follow-redirects from version 1.16.0 until the 1.16.2 fix, especially code that passes sensitiveHeaders across JavaScript realm boundaries and sends custom credential headers to endpoints that may redirect across origins.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203