🇰🇷 한글 설명
HAPI FHIR은 Java 기반 HL7 FHIR 표준의 완전한 구현체입니다. 6.9.9 및 6.9.4.2 이전 버전에서는 FHIRPathEngine이 입력 검증 없이 임의의 FHIRPath 표현식을 평가하며, matches(), matchesFull(), replaceMatches() 함수가 사용자 제어 정규식을 불완전한 타임아웃 유틸리티를 거쳐 Pattern.compile() 및 String.replaceAll()에 전달합니다. 이로 인해 공격자가 파국적 백트래킹을 유발하는 정규식을 포함한 리소스를 전송하여 CPU 자원을 고갈시키고 서비스 거부를 일으킬 수 있습니다.
💡 쉬운 설명
악의적으로 만든 검색 패턴을 보내면 서버가 그 패턴을 처리하느라 CPU를 모두 사용해 다른 요청을 처리하지 못하게 됩니다. 이 문제는 6.9.9 및 6.9.4.2 버전에서 수정되었습니다.
🇺🇸 원문 (English)
HAPI FHIR is a complete implementation of the HL7 FHIR standard for healthcare interoperability in Java. Prior to 6.9.9 and 6.9.4.2, all implementations of FHIRPathEngine accept arbitrary FHIRPath expressions and evaluate them without input validation, and the FHIRPath functions matches(), matchesFull(), and replaceMatches() pass user-controlled regular expressions to Java's Pattern.compile() and String.replaceAll() through an incomplete timeout utility. An attacker can send a resource containing an evil regex pattern that causes catastrophic backtracking, exhausting CPU resources and causing denial of service in the FHIR Validator HTTP endpoint and affected org.hl7.fhir.* modules. This issue is fixed in versions 6.9.9 and 6.9.4.2.
📍 영향받는 시스템
HAPI FHIR 6.9.9 미만 및 6.9.4.2 미만 버전의 FHIR Validator HTTP 엔드포인트 및 org.hl7.fhir.* 모듈을 사용하는 시스템
⚔️ 공격 벡터
공격자가 FHIR 리소스에 파국적 백트래킹을 유발하는 악성 정규식이 담긴 FHIRPath 표현식을 포함시켜 Validator 엔드포인트로 전송
🛡️ 대응 방법
HAPI FHIR을 6.9.9 또는 6.9.4.2 이상으로 업그레이드하고, 가능하면 Validator 엔드포인트에 요청 타임아웃 및 리소스 제한을 적용
🔧 검증 코드
출력된 JAR 파일명 또는 Manifest의 버전이 6.9.9 미만(6.9.x 계열은 6.9.4.2 미만)이면 취약하므로 업그레이드가 필요하며, 그 이상이면 패치된 버전입니다.
find / -name 'org.hl7.fhir*.jar' 2>/dev/null | xargs -I{} sh -c 'echo {}; unzip -p {} META-INF/MANIFEST.MF 2>/dev/null | grep -i version'