🇰🇷 한글 설명
PHP 7.3 이상용 DOMSanitizer 1.0.15 미만 버전에서 발생하는 입력값 검증 미흡 취약점입니다. data: 스킴을 검사할 때 'onload' 문자열의 존재 여부만 확인하므로, Base64로 인코딩된 악성 페이로드를 탐지하지 못하고 통과시킬 수 있습니다. 이로 인해 href 또는 xlink:href 속성에 악성 스크립트가 포함된 데이터 URL이 삽입될 수 있습니다.
💡 쉬운 설명
웹사이트의 보안 필터가 'data:'로 시작하는 데이터 주소를 검사할 때, 암호화된 형태의 악성 코드를 찾아내지 못하는 결함이 있습니다. 공격자는 이를 이용해 정상적인 데이터처럼 위장한 해킹 코드를 웹페이지에 심을 수 있습니다.
🇺🇸 원문 (English)
DOMSanitizer is a DOM/SVG/MathML Sanitizer for PHP 7.3+. Prior to version 1.0.15, the isDangerousUrl() method is responsible for rejecting dangerous URL values in the href and xlink:href attributes. The weakness is that "javascript:" is rejected as a scheme, while "data:" is rejected only when the literal substring onload appears in the URL value (/^data:.*onload/i). Because data: payloads are routinely Base64-encoded, the dangerous content (<script>, event handlers, etc.) is invisible to that substring test. A URL such as data:text/html;base64,… therefore survives in href / xlink:href, even though the decoded payload is active markup. This is an incomplete input-validation / sanitization defect in the sanitizer itself. This issue has been patched in version 1.0.15.
📍 영향받는 시스템
DOMSanitizer version < 1.0.15 (PHP 7.3+)
⚔️ 공격 벡터
Base64로 인코딩된 악성 스크립트가 포함된 data: URL을 href 또는 xlink:href 속성에 삽입하여 XSS 공격 수행
🛡️ 대응 방법
DOMSanitizer 라이브러리를 버전 1.0.15 이상으로 업데이트
🔧 검증 코드
출력된 버전 정보가 1.0.15 미만인지 확인
composer show dom-sanitizer 2>/dev/null | grep -E 'versions'