🇰🇷 한글 설명
Ring은 Python의 WSGI와 Ruby의 Rack에서 영감을 받은 Clojure 웹 애플리케이션 라이브러리입니다. 1.15.5 이전 버전의 wrap-nested-params 미들웨어는 백트래킹 정규식으로 파라미터 이름을 처리하여, 공격자가 조작된 파라미터 이름으로 O(n^2) 연산을 유발해 정규식 서비스 거부(ReDoS)를 일으킬 수 있습니다. Ring-Defaults 사용자도 기본 활성화 상태여서 영향을 받습니다.
💡 쉬운 설명
웹 요청의 이름표를 처리하는 부품이 특정 악성 입력을 만나면 과도하게 오래 작업해서 서버가 느려지거나 멈출 수 있습니다. 해당 미들웨어를 쓰지 않는 앱은 영향을 받지 않습니다.
🇺🇸 원문 (English)
Ring is a Clojure web applications library inspired by Python's WSGI and Ruby's Rack. Prior to 1.15.5, `wrap-nested-params` in the `ring.middleware.nested-params` namespace uses a backtracking regular expression to match parameter names from URL query strings and HTTP request bodies. An attacker can craft a parameter name that drives quadratic O(n^2) matching work, causing regular-expression denial of service in applications using the middleware. `Ring-Defaults` users are also exposed because nested-params is enabled by default. Applications omitting the middleware do not expose this parsing path. This issue is fixed in version 1.15.5.
📍 영향받는 시스템
Clojure Ring 라이브러리 1.15.5 미만 버전을 사용하는 애플리케이션 (Ring-Defaults 포함)
⚔️ 공격 벡터
URL 쿼리스트링이나 HTTP 요청 본문에 특수하게 구성된 파라미터 이름을 보내 정규식 처리 시간을 기하급수적으로 늘림
🛡️ 대응 방법
ring-core 의존성을 1.15.5 이상으로 업그레이드하거나, 필요 없다면 wrap-nested-params 미들웨어를 제거
🔧 검증 코드
출력된 버전 번호가 1.15.5 미만이면 취약하며, 1.15.5 이상이면 패치가 적용된 것입니다. 결과가 없으면 해당 라이브러리를 사용하지 않는 것입니다.
grep -rE 'ring/(ring-core|ring-defaults)' ~/.m2 ~/.lein project.clj deps.edn 2>/dev/null | grep -E 'ring-core|ring-defaults'