🇰🇷 한글 설명
xmldom 라이브러리의 0.9.0-beta.9부터 0.9.11 버전 사이에서 처리 지침(processing-instruction) 파싱 시 정규식 백트래킹 문제가 발생합니다. 공격자가 특수하게 조작된 XML 입력을 제공하면 Node.js 이벤트 루프를 중단시켜 서비스 거부(DoS)를 유발할 수 있습니다.
💡 쉬운 설명
XML 파일을 읽는 과정에서 특정 규칙을 처리할 때 컴퓨터가 너무 많은 계산을 반복하게 만드는 버그가 있습니다. 이를 이용해 아주 작은 크기의 파일을 보내 서버를 멈추게 만들 수 있습니다.
🇺🇸 원문 (English)
xmldom is a pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module. From 0.9.0-beta.9 until 0.9.11, the processing-instruction production in lib/grammar.js lets the greedy S+ separator and lazy Char*? data group repeatedly repartition a long whitespace tail when the required closing ?> is absent. Both parsePI and parseProcessingInstruction apply the expression to the entire remaining source, causing quadratic backtracking during DOMParser.parseFromString() under default options and allowing a small unauthenticated XML input to stall the Node.js event loop. This issue is fixed in @xmldom/xmldom version 0.9.11.
📍 영향받는 시스템
xmldom (0.9.0-beta.9 ~ 0.9.11)
⚔️ 공격 벡터
인증되지 않은 사용자가 조작된 XML 데이터를 DOMParser.parseFromString() 함수로 전송
🛡️ 대응 방법
@xmldom/xmldom 버전을 0.9.11 이상으로 업데이트
🔧 검증 코드
명령어 결과에 취약한 버전 범위가 출력되면 해당 라이브러리가 설치되어 있는 상태입니다.
npm list @xmldom/xmldom 2>/dev/null | grep -E '@xmldom/xmldom@0\.(0\.[0-9]|9\.[0-1][0-1])'