🔍 CVE-2026-61784

6.1
CVSS Score
MEDIUM
2026-09-24
2026-09-30 17:32
✅ 완료

🇰🇷 한글 설명

xhtml-purifier Node.js 라이브러리의 0.4.3 미만 버전에서 속성 값을 직렬화할 때 HTML 엔티티 인코딩을 수행하지 않는 취약점이 발견되었습니다. 공격자가 허용된 속성에 큰따옴표를 삽입하여 속성을 탈출하고 자바스크립트 이벤트 핸들러를 주입함으로써 교차 사이트 스크립팅(XSS) 공격을 수행할 수 있습니다.

💡 쉬운 설명

웹사이트의 위험한 코드를 걸러주는 도구가 특정 문자를 제대로 처리하지 못하는 문제입니다. 이를 통해 해커가 악성 스크립트를 몰래 끼워 넣어 사용자의 정보를 훔칠 수 있습니다.

🇺🇸 원문 (English)

xhtml-purifier is a Node.js library to take in raw/unknown/untrusted HTML and output cleaned, purified, trusted HTML. Versions prior to 0.4.3 do not HTML-entity-encode attribute values when serializing its sanitized output. In attributeString() (XHTMLPurifier.js, around line 148) the attribute value is concatenated directly into a double-quoted attribute without encoding. As a result, an attacker-controlled value in any allowed attribute (class, style, title, alt, src, href) can include a double-quote character to break out of the attribute and inject an additional attribute, such as a JavaScript event handler (for example onmouseover or onerror). The injected handler survives sanitization and executes when the output is rendered, which is a sanitizer bypass leading to cross-site scripting. The fix in version 0.4.3 HTML-entity-encodes attribute values before serialization.

📍 영향받는 시스템

xhtml-purifier versions prior to 0.4.3

⚔️ 공격 벡터

허용된 HTML 속성 값에 큰따옴표(")를 포함시켜 기존 속성을 닫고 새로운 이벤트 핸들러(onmouseover 등)를 주입하는 방식

🛡️ 대응 방법

xhtml-purifier 라이브러리를 0.4.3 버전 이상으로 업데이트하십시오.

🔧 검증 코드

출력 결과가 있으면 취약한 버전이 설치된 것이며, 아무것도 출력되지 않으면 안전한 버전입니다.

Shell / Script
npm list xhtml-purifier | grep -E 'xhtml-purifier@([0-9]\.[0-9]\.[0-9])' | awk -F'@' '{print $2}' | awk -F. '$1 < 0 || ($1 == 0 && $2 < 4) || ($1 == 0 && $2 == 4 && $3 < 3)'

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

💻 영향받는 소프트웨어

Node.js