@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.
The proxy adds its own headers to the request (e.g., security, authorization, or routing headers) through the rewriteRequestHeaders function. Next, before the request reaches the upstream server, the Connection header provided by the client is processed. By standard, the Connection header indicates which headers are hop-by-hop and should be removed — an attacker can therefore place the names of headers added by the proxy in its value, causing their removal from the request before forwarding it further. As a result, the upstream never receives the headers added by the proxy.
An attacker can selectively remove headers responsible for access control, authentication, or security, which may lead to unauthorized access to upstream resources or bypass of security mechanisms enforced by the proxy.
Update @fastify/reply-from to version 12.6.2 or later and @fastify/http-proxy to version 11.4.4 or later.
@fastify/reply-from in version 12.6.1 and earlier and @fastify/http-proxy in version 11.4.3 and earlier
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:XFastify Fastify\/http Proxy
APPFastify< 11.4.4Fastify Reply From
APPFastify< 12.6.2
Related vulnerabilities
Pominięcie rewrite prefiksu URL w @fastify/http-proxy – dostęp do ukrytych zasobów
Path traversal w @fastify/http-proxy — ucieczka poza prefix WebSocket
fastify-reply-from to plugin Fastify do przekazywania bieżącego żądania HTTP na inny serwer. Przed wersją 12.5...
fastify-reply-from is a Fastify plugin to forward the current HTTP request to another server. A reverse proxy ...
Fastify/Middie: pominięcie middleware przez zakodowany slash w URL