🇰🇷 한글 설명
Litestar 2.17.0 버전에서 X-Forwarded-For 헤더를 조작하여 속도 제한(Rate Limit)을 완전히 우회할 수 있는 취약점이 발견되었습니다. RateLimitMiddleware가 헤더의 값을 무조건적으로 신뢰하여 클라이언트 식별자로 사용하기 때문에, 공격자가 IP를 위조하여 제한을 피할 수 있습니다.
💡 쉬운 설명
공격자가 자신의 IP 주소를 계속해서 가짜로 바꿔치기함으로써, 웹사이트가 설정한 접속 횟수 제한을 무력화할 수 있는 문제입니다. 이를 통해 공격자는 차단되지 않고 무차별 대입 공격 등을 지속할 수 있습니다.
🇺🇸 원문 (English)
Litestar is an Asynchronous Server Gateway Interface (ASGI) framework. In version 2.17.0, rate limits can be completely bypassed by manipulating the X-Forwarded-For header. This renders IP-based rate limiting ineffective against determined attackers. Litestar's RateLimitMiddleware uses `cache_key_from_request()` to generate cache keys for rate limiting. When an X-Forwarded-For header is present, the middleware trusts it unconditionally and uses its value as part of the client identifier. Since clients can set arbitrary X-Forwarded-For values, each different spoofed IP creates a separate rate limit bucket. An attacker can rotate through different header values to avoid hitting any single bucket's limit. This affects any Litestar application using RateLimitMiddleware with default settings, which likely includes most applications that implement rate limiting. Version 2.18.0 contains a patch for the vulnerability.
📍 영향받는 시스템
Litestar 2.17.0 버전 (RateLimitMiddleware 사용 시)
⚔️ 공격 벡터
X-Forwarded-For 헤더에 임의의 IP 주소를 번갈아 입력하여 요청 전송
🛡️ 대응 방법
Litestar를 보안 패치가 적용된 2.18.0 버전 이상으로 업데이트
🔧 검증 코드
출력된 버전이 2.17.0이거나 그보다 낮은 버전이면 취약한 상태입니다.
pip show litestar | grep Version