fastify/http-proxy - это плагин Fastify, который проксиирует трафик HTTP и WebSocket на вышестоящий сервер. In versions from 7.1.0 up to but not including 11.6.10, when the plugin is registered with websocket support enabled, it opens the upstream WebSocket connection with a header set built by the default header rewriter, which forwards the client cookie but never sets the upstream origin option, so the browser origin header is dropped while the authenticating cookie is forwarded. Многие серверы WebSocket защищаются от межсайтового угона, проверяя происхождение и рассматривая отсутствующее происхождение как доверенный не-браузерный клиент, поэтому за прокси-сервером, который проверяет, никогда не видит иностранного происхождения.
Таким образом, вредоносная страница, посещенная зарегистрированным пользователем, может открыть WebSocket через прокси-сервер, который аутентифицирует рукопожатие с помощью файла cookie и читает или отправляет сообщения от имени пользователя. Проблема исправлена в fastify/http-proxy 11.6.10, и пользователи должны обновиться до 11.6.10 или более поздней версии. В качестве обходного пути предоставьте перезапись заголовка, которая устанавливает правильное происхождение, или подтвердите происхождение перед прокси.
Показать оригинальное описание (EN)
@fastify/http-proxy is a Fastify plugin that proxies HTTP and WebSocket traffic to an upstream server. In versions from 7.1.0 up to but not including 11.6.10, when the plugin is registered with websocket support enabled, it opens the upstream WebSocket connection with a header set built by the default header rewriter, which forwards the client cookie but never sets the upstream origin option, so the browser origin header is dropped while the authenticating cookie is forwarded. Many WebSocket servers defend against cross-site hijacking by checking the origin and treat a missing origin as a trusted non-browser client, so behind the proxy that check never sees the foreign origin. A malicious page visited by a logged-in user can therefore open a WebSocket through the proxy to an upstream that authenticates the handshake with a cookie, and read or send messages on the user's behalf. The issue is fixed in @fastify/http-proxy 11.6.10, and users should upgrade to 11.6.10 or later. As a workaround, provide a header rewriter that sets a correct origin, or validate the origin before the proxy.
Характеристики атаки
Последствия
Строка CVSS v3.1