🇰🇷 한글 설명
probe-image-size 라이브러리의 SVG 파싱 과정에서 정규 표현식 처리 오류로 인해 발생하는 서비스 거부(DoS) 취약점입니다. 공격자가 닫는 괄호가 없는 '<' 문자를 대량으로 포함한 데이터를 전송하면, CPU 사용량이 급증하며 Node.js 이벤트 루프가 차단될 수 있습니다.
💡 쉬운 설명
이미지 크기를 확인하는 프로그램이 특수하게 조작된 이미지 파일을 처리할 때, 계산을 무한히 반복하느라 컴퓨터가 멈추는 현상입니다. 나쁜 의도를 가진 파일 하나로 서버 전체를 마비시킬 수 있습니다.
🇺🇸 원문 (English)
probe-image-size gets image dimensions without downloading the entire file. Prior to 7.4.0, lib/parse_sync/svg.js and lib/parse_stream/svg.js use the searching regular expression /<[-_.:a-zA-Z0-9][^>]*>/, which repeatedly scans to the end of input when attacker-controlled data contains many less-than characters without a closing greater-than character. The synchronous parser converts and scans the full supplied buffer without an input cap, while the streaming parser reparses the complete accumulated SVG prefix for every received chunk. The probe.sync(), probe(stream), and probe(url) entry points can therefore block the Node.js event loop at full CPU, and attacker-controlled chunking can amplify the streaming cost. This issue is fixed in version 7.4.0.
📍 영향받는 시스템
probe-image-size version 7.4.0 미만
⚔️ 공격 벡터
공격자가 조작된 SVG 데이터를 포함한 URL 또는 스트림을 제공하여 서버의 CPU 자원을 고갈시킴
🛡️ 대응 방법
probe-image-size 라이브러리를 7.4.0 이상 버전으로 업데이트
🔧 검증 코드
출력된 버전 정보가 7.4.0 미만인지 확인
npm list probe-image-size