🇰🇷 한글 설명
Fastify 프레임워크에서 trustProxy 설정이 숫자로 지정된 경우, 연결된 주소를 검증하지 못하는 취약점이 발견되었습니다. 공격자가 프록시를 우회하여 직접 서버에 접속할 경우, forwarded-header를 조작하여 호스트 주입, HTTPS 강제 적용 우회, CSRF 및 쿠키 보안 우회 등의 공격을 수행할 수 있습니다.
💡 쉬운 설명
웹 서버가 '믿을 수 있는 통로'를 확인하는 과정에서 숫자로 된 설정값의 허점을 이용해 가짜 정보를 전달할 수 있는 문제입니다. 이를 통해 공격자는 서버가 마치 안전한 연결인 것처럼 착각하게 만들어 보안 설정을 무력화할 수 있습니다.
🇺🇸 원문 (English)
fastify is a fast and low overhead web framework for Node.js. Impact: the fix for CVE-2026-3635 added a guard on the forwarded-header reads used to derive the request host, protocol, hostname, ip, and ips values, checking the connecting address. That guard closes the IP, CIDR, and custom-function forms of trustProxy correctly, because those forms compile to predicates that inspect the connecting address. The hop-count form, where trustProxy is set to a number, compiles to a predicate that structurally ignores the address, so the guard is always satisfied for any hop count of one or more. Applications configured with a numeric trustProxy value, such as trustProxy set to 1 for a single reverse proxy, remain vulnerable: an attacker who can reach the Fastify origin directly, bypassing the front-facing proxy, can spoof the forwarded request fields exactly as in the unpatched version. The impact class matches the parent CVE-2026-3635, including host injection in generated URLs, HTTPS-enforcement bypass, secure-cookie and CSRF-origin bypass, and host-based routing and cache poisoning. Affected versions are fastify from 5.8.3 up to but not including 5.12.1. Patches: patched in fastify 5.12.1, where the numeric form of trustProxy is disabled at runtime and removed from the TypeScript type union. Workarounds: migrate to an IP, CIDR, or custom-function trustProxy value that validates the connecting address, and ensure the Fastify origin is only reachable through the trusted proxy chain.
📍 영향받는 시스템
fastify versions 5.8.3 up to (but not including) 5.12.1
⚔️ 공격 벡터
프록시를 우회하여 Fastify 서버에 직접 접속한 후, 조작된 forwarded-header를 전송하여 요청 정보를 스푸핑함
🛡️ 대응 방법
fastify를 5.12.1 이상 버전으로 업데이트하거나, trustProxy 설정을 숫자 대신 IP, CIDR 또는 사용자 정의 함수 방식으로 변경함
🔧 검증 코드
출력된 fastify의 버전이 5.8.3 이상 5.12.1 미만인지 확인합니다.
npm list fastify | grep fastify