🇰🇷 한글 설명
http4k 라이브러리의 XML 파서에서 <!DOCTYPE> 선언을 차단하지 않아 내부 엔티티 확장을 통한 서비스 거부(DoS) 공격이 가능했습니다. 이전 수정으로 외부 엔티티 참조는 차단되었으나, 도큐먼트 타입 선언 자체는 허용되어 잔여 취약점이 존재했습니다. v6.50.0.0에서는 <!DOCTYPE> 선언을 파싱 단계에서 완전히 거부하여 이 문제를 해결했습니다.
💡 쉬운 설명
이 취약점은 악의적인 XML 파일이 서버의 자원을 고갈시켜 서비스를 마비시키는 공격을 가능하게 합니다. 개발자는 http4k 라이브러리를 v6.50.0.0 이상으로 업데이트하여 이 문제를 해결해야 합니다.
🇺🇸 원문 (English)
http4k is a functional toolkit for Kotlin HTTP applications. Prior to version 6.50.0.0, there is a potential XXE (XML External Entity Injection) vulnerability when http4k handling malicious XML contents within requests, which might allow attackers to read local sensitive information on server, trigger Server-side Request Forgery and even execute code under some circumstances. The original fix shipped in v5.41.0.0 / v4.50.0.0 closed the documented external-entity attack class (SSRF, local-file disclosure, code execution) by setting `ACCESS_EXTERNAL_DTD=""`, `ACCESS_EXTERNAL_SCHEMA=""`, and `isExpandEntityReferences=false` on the default `DocumentBuilderFactory`. A residual gap remained: the parser still accepted documents containing `<!DOCTYPE>` declarations even though external entity resolution was blocked. This left open billion-laughs-style internal entity expansion DoS attacks against any application using `Body.xml()` or `Document.asXmlDocument()` on untrusted XML. v6.50.0.0 closes this residual by adding `disallow-doctype-decl=true` and `FEATURE_SECURE_PROCESSING=true` to `defaultXmlParsingConfig`. Any document containing a `<!DOCTYPE>` is now rejected at parse time.
📍 영향받는 시스템
http4k version < 6.50.0.0
⚔️ 공격 벡터
신뢰할 수 없는 XML 입력을 파싱할 때 <!DOCTYPE> 선언을 이용한 내부 엔티티 확장 DoS 공격
🛡️ 대응 방법
http4k 라이브러리를 v6.50.0.0 이상으로 업그레이드하십시오.
🔧 검증 코드
스크립트 실행 결과 'VULNERABLE'이 출력되면 취약한 버전이므로 업그레이드가 필요하며, 'PATCHED'가 출력되면 안전한 버전입니다.
grep -r 'implementation.*http4k' build.gradle | grep -oP 'http4k-\w+:\K[\d.]+' | awk -F. '{if ($1 < 6 || ($1 == 6 && $2 < 50)) print "VULNERABLE"; else print "PATCHED"}'
📊 CVSS Vector String
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
💻 영향받는 소프트웨어
IBM WebSphere Application Server