<?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/"><channel><title>Header Stripping — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/header-stripping/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata — refreshed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Thu, 16 Apr 2026 01:02:59 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/header-stripping/feed.xml" rel="self" type="application/rss+xml"/><item><title>Fastify Proxy Header Stripping Vulnerability</title><link>https://feed.craftedsignal.io/briefs/2026-04-fastify-header-strip/</link><pubDate>Thu, 16 Apr 2026 01:02:59 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-04-fastify-header-strip/</guid><description>The `@fastify/reply-from` and `@fastify/http-proxy` libraries process the client's `Connection` header after adding headers, allowing attackers to strip proxy-added headers via the `Connection` header, leading to potential bypass of security controls.</description><content:encoded><![CDATA[<p>The <code>@fastify/reply-from</code> and <code>@fastify/http-proxy</code> libraries are vulnerable to a header stripping attack. This vulnerability stems from the incorrect processing order of the <code>Connection</code> header. The client&rsquo;s <code>Connection</code> header is processed <em>after</em> the proxy has added custom headers via the <code>rewriteRequestHeaders</code> function. This allows an attacker to retroactively remove headers added by the proxy by simply listing them in the <code>Connection</code> header. This affects any application leveraging these plugins where custom headers are injected for routing, access control, or other security purposes. All versions of both <code>@fastify/reply-from</code> and <code>@fastify/http-proxy</code> are affected. The vulnerability can be exploited without any special configuration. This undermines the intended function of a proxy as a trusted intermediary.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>A client crafts a request containing a <code>Connection</code> header.</li>
<li>The client sends the crafted request to a Fastify proxy server using <code>@fastify/reply-from</code> or <code>@fastify/http-proxy</code>.</li>
<li>The proxy receives the request and copies all client headers, including the <code>Connection</code> header.</li>
<li>The proxy, using <code>rewriteRequestHeaders</code>, adds custom headers (e.g., <code>x-forwarded-by</code>) to the request.</li>
<li>The proxy&rsquo;s transport handler processes the <code>Connection</code> header from the client.</li>
<li>Headers listed in the client&rsquo;s <code>Connection</code> header, including proxy-added headers, are stripped from the upstream request.</li>
<li>The modified request, with stripped headers, is forwarded to the upstream server.</li>
<li>The upstream server receives the request with missing headers, potentially bypassing security checks.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation allows attackers to bypass security controls implemented by the proxy. This includes bypassing proxy identification, circumventing access control mechanisms, and removing arbitrary headers. For example, an attacker can strip headers like <code>x-forwarded-by</code> to avoid detection, or remove authentication headers like <code>authorization</code> or custom access control headers like <code>x-internal-auth</code> to gain unauthorized access to resources. The number of victims depends on the prevalence of vulnerable Fastify deployments.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade to patched versions of <code>@fastify/reply-from</code> and <code>@fastify/http-proxy</code> when available.</li>
<li>As a workaround, avoid using <code>rewriteRequestHeaders</code> to inject security-critical headers into requests.</li>
<li>Implement input validation to sanitize or reject requests containing a <code>Connection</code> header that attempts to remove security-sensitive headers.</li>
<li>Monitor web server logs for requests containing <code>Connection</code> headers listing custom or security-related headers as a sign of potential exploitation (see Sigma rule below).</li>
</ul>
]]></content:encoded><category domain="severity">critical</category><category domain="type">advisory</category><category>fastify</category><category>header stripping</category><category>proxy vulnerability</category></item></channel></rss>