🇰🇷 한글 설명
SVG 최적화 라이브러리인 SVGO의 removeScripts 플러그인이 네임스페이스가 지정된 스크립트 요소나 대소문자가 다른 JavaScript URI를 제대로 제거하지 못하는 취약점입니다. 이로 인해 최적화된 SVG 파일 내에 실행 가능한 코드가 남을 수 있으며, 신뢰할 수 없는 파일을 처리하는 애플리케이션에서 사용자 세션 탈취 등의 위험을 초래할 수 있습니다.
💡 쉬운 설명
이미지 파일(SVG)을 깨끗하게 만드는 과정에서 악성 코드를 완벽히 지우지 못하는 결함이 발견되었습니다. 공격자가 이 결함을 이용해 특수하게 제작된 이미지를 보내면, 사용자의 쿠키나 개인 정보를 훔쳐갈 수 있습니다.
🇺🇸 원문 (English)
SVGO, short for SVG Optimizer, is a Node.js library and command-line application for optimizing SVG files. From version 1.0.0 until versions 2.8.3, 3.3.4, and 4.0.2, the removeScripts plugin, named removeScriptElement in versions 1 through 3, can leave executable content in optimized SVGs because it does not remove namespaced or prefixed script elements such as <svg:script> and, in versions 3 and 4, matches JavaScript URIs case sensitively. Applications that process untrusted SVG input with this plugin enabled and serve the result can allow scripts to execute when another user opens the SVG, exposing local storage or cookies. This issue is fixed in versions 2.8.3, 3.3.4, and 4.0.2.
📍 영향받는 시스템
SVGO 1.0.0 ~ 2.8.3 미만, 3.3.4 미만, 4.0.2 미만 버전
⚔️ 공격 벡터
네임스페이스가 포함된 <svg:script> 태그나 대소문자를 변형한 JavaScript URI를 포함한 악성 SVG 파일을 업로드하여 실행 유도
🛡️ 대응 방법
SVGO를 최신 패치 버전인 2.8.3, 3.3.4 또는 4.0.2 이상으로 업데이트
🔧 검증 코드
출력된 svgo의 버전이 취약 버전 범위(1.0.0~2.8.3, 3.3.4, 4.0.2 미만)에 해당하는지 확인