🇰🇷 한글 설명
sanitize-html 2.17.5 미만 버전은 HTML URI 속성 목록이 불완전하여 'javascript:' 스킴을 차단하지 못하는 XSS 취약점이 있습니다. 개발자가 action, formaction 등 URI를 허용하는 속성을 구성할 경우 공격자가 악성 스크립트를 삽입할 수 있습니다.
💡 쉬운 설명
웹사이트의 HTML 정적 라이브러리에 보안 구멍이 있어 해커가 악성 스크립트를 숨길 수 있습니다. 이 구멍을 통해 공격자가 사용자의 브라우저를 조종하거나 데이터를 탈취할 수 있습니다.
🇺🇸 원문 (English)
ApostropheCMS is an open-source Node.js content management system, and sanitize-html provides a simple HTML sanitizer with a clear API. Versions of sanitize-html prior to 2.17.5 use `allowedSchemesAppliedToAttributes` (default: `['href', 'src', 'cite']`) to gate the `naughtyHref()` function that blocks dangerous URI schemes like `javascript:` and `vbscript:`. The HTML specification defines 10+ attributes that accept URIs (`action`, `formaction`, `data`, `poster`, `background`, `ping`, `xlink:href`, `dynsrc`, `lowsrc`), but none of these are included in the default gate list. When a developer allows any of these attributes in their configuration, `javascript:` URIs pass through completely unmodified, enabling XSS. Version 2.17.5 patches the issue.
📍 영향받는 시스템
sanitize-html < 2.17.5
⚔️ 공격 벡터
악의적인 HTML 콘텐츠에 javascript: URI를 포함한 속성을 삽입하여 XSS를 유발
🛡️ 대응 방법
sanitize-html 패키지를 2.17.5 이상 버전으로 즉시 업그레이드
🔧 검증 코드
출력된 버전 번호가 2.17.5보다 낮으면 취약하며, 2.17.5 이상이면 안전합니다.
npm list sanitize-html 2>/dev/null | grep -E 'sanitize-html@'