🇰🇷 한글 설명
@fastify/rate-limit 11.2.0 미만 버전은 클라이언트 IP를 문자열 그대로 사용하여 속도 제한을 적용합니다. 이로 인해 IPv6 클라이언트가 주소를 변경하거나 형식을 변형하여 속도 제한을 우회할 수 있는 취약점이 존재합니다. 이는 인증이나 OTP 전송과 같은 중요한 엔드포인트를 보호하는 기능을 무력화할 수 있습니다.
💡 쉬운 설명
공격자가 IPv6 주소를 아주 조금씩 바꿔가며 접속하면, 시스템이 이를 서로 다른 사람으로 착각하여 차단하지 못하는 문제입니다. 이로 인해 비밀번호 찾기나 로그인 시도 등을 무제한으로 시도할 수 있습니다.
🇺🇸 원문 (English)
@fastify/rate-limit before 11.2.0 keys rate-limit buckets by the verbatim client IP string returned from request.ip. Because a single IPv6 client can control a large address range (a /64 holds 2^64 distinct addresses) and the same address has multiple valid textual representations, an IPv6 capable client can defeat the rate-limit boundary by rotating addresses or by rewriting the same address in different forms. Applications that use @fastify/rate-limit to protect endpoints such as authentication, password reset, OTP delivery, or expensive API calls can be bypassed by IPv6 clients behind a proxy that surfaces IPv6 to the origin when trustProxy is enabled. The issue is fixed in @fastify/rate-limit 11.2.0, where the default key generator normalizes IPv6 addresses to their canonical form, collapses IPv4 mapped IPv6 to IPv4, and applies a configurable prefix mask (default /64) via a new ipv6Subnet option.
📍 영향받는 시스템
@fastify/rate-limit < 11.2.0
⚔️ 공격 벡터
IPv6 주소의 형식을 변형하거나 /64 대역 내의 다양한 주소를 순환 사용하여 속도 제한 우회
🛡️ 대응 방법
@fastify/rate-limit 버전을 11.2.0 이상으로 업데이트
🔧 검증 코드
출력된 버전이 11.2.0 미만인지 확인
npm list @fastify/rate-limit