<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:webfeeds="http://webfeeds.org/rss/1.0"><channel><title>Cpe:2.3:a:follow-Redirects_project:follow-Redirects:*:*:*:*:*:node.js:*:* - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/cpes/cpe2.3afollow-redirects_projectfollow-redirectsnode.js/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Tue, 20 Oct 2026 23:56:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/cpes/cpe2.3afollow-redirects_projectfollow-redirectsnode.js/feed.xml" rel="self" type="application/rss+xml"/><image><url>https://feed.craftedsignal.io/favicon-32x32.png</url><title>CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/</link><width>32</width><height>32</height></image><webfeeds:icon>https://feed.craftedsignal.io/favicon.svg</webfeeds:icon><item><title>follow-redirects: Array-form header credential stripping bypass</title><link>https://feed.craftedsignal.io/briefs/2026-10-follow-redirects-bypass/</link><pubDate>Tue, 20 Oct 2026 23:56:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-10-follow-redirects-bypass/</guid><description>The follow-redirects library fails to strip sensitive headers when provided in array format, leading to the unauthorized disclosure of credentials during cross-origin or protocol-downgrade redirects.</description><content:encoded><![CDATA[<p>The <code>follow-redirects</code> library, a popular drop-in replacement for Node.js's native <code>http</code>/<code>https</code> modules, contains a vulnerability where sensitive header-stripping mechanisms fail when headers are provided as an array rather than a plain object. The internal <code>removeMatchingHeaders</code> function utilizes a <code>for...in</code> loop to iterate over the headers container. While this correctly matches keys in an object, it iterates over numeric indices when applied to an array, causing the header-matching regular expressions to consistently fail.</p>
<p>This flaw affects the security controls intended to protect credentials (Authorization, Cookie, Proxy-Authorization) and user-declared <code>sensitiveHeaders</code> (introduced in CVE-2026-40895) when a request is redirected to a different origin or a less secure protocol. Because the library silently fails to sanitize these headers, the credentials are forwarded verbatim to the attacker-controlled redirect destination. This vulnerability enables unauthenticated credential harvesting and persists in all versions of the library up to and including 1.16.0.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>The victim application is configured to use <code>follow-redirects</code> for outgoing HTTP/HTTPS requests.</li>
<li>The application initiates a request to a malicious or compromised server, providing credentials via array-form headers (e.g., <code>[&quot;Authorization&quot;, &quot;Bearer token&quot;, &quot;Cookie&quot;, &quot;session=id&quot;]</code>).</li>
<li>The malicious server responds with a 302 or similar redirect status code pointing to an attacker-controlled cross-origin host or a protocol-downgrade (HTTPS to HTTP) endpoint.</li>
<li><code>follow-redirects</code> intercepts the redirect and invokes <code>removeMatchingHeaders</code> to strip sensitive credentials and the original <code>Host</code> header.</li>
<li>The <code>removeMatchingHeaders</code> function iterates over the array-form headers using <code>for...in</code>, yielding numeric indices instead of header names, which results in zero matches.</li>
<li>The sanitization logic fails silently; the library retains the original credential headers and the stale <code>Host</code> header in the options object.</li>
<li>The library follows the redirect, sending the request to the attacker's server with the victim's credentials included in the headers.</li>
<li>The attacker logs the incoming request headers to harvest the victim's tokens, session cookies, or API keys.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>The vulnerability results in the unauthorized disclosure of sensitive authentication material to third-party servers. Any application utilizing <code>follow-redirects</code> that processes user-controllable or untrusted redirects is susceptible to credential harvesting. This impacts the confidentiality of session identifiers, API keys, and authorization tokens across any sector relying on the library for automated HTTP request handling.</p>
<h2 id="recommendation">Recommendation</h2>
<ol>
<li>Update to a version of <code>follow-redirects</code> that implements explicit validation for array-form headers, ensuring either proper sanitization or a clear <code>TypeError</code> if array-form input is detected.</li>
<li>Audit applications using <code>follow-redirects</code> to determine if outgoing requests are constructed using array-form headers (e.g., <code>[&quot;Name&quot;, &quot;Value&quot;]</code>).</li>
<li>Implement strict cross-origin checks or proxying for sensitive traffic if an immediate patch is not feasible.</li>
<li>Ensure all developers explicitly use object-form headers (<code>{ &quot;Authorization&quot;: &quot;value&quot; }</code>) until the library explicitly validates array-form header structures.</li>
</ol>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>credential-access</category><category>nodejs</category><category>web-application</category></item></channel></rss>