🔍 CVE-2026-40186

6.1
CVSS Score
MEDIUM
2026-04-15
2026-10-26 21:10
✅ 완료

🇰🇷 한글 설명

sanitize-html 2.17.1 버전에서 textarea와 option 요소 내 HTML 엔티티 디코딩 처리 실패로 인해 allowedTags 필터가 우회되는 XSS 취약점. htmlparser2가 엔티티를 디코딩한 후 전달하지만 코드가 이를 간과하여 디코딩된 HTML이 직접 출력됨. ApostropheCMS 4.28.0이 영향을 받음.

💡 쉬운 설명

웹사이트 텍스트 입력 필드에서 위험한 코드가 제대로 걸러지지 않습니다. 공격자가 특수한 방식으로 악성 코드를 주입하면 사용자의 브라우저에서 실행될 수 있습니다.

🇺🇸 원문 (English)

ApostropheCMS is an open-source Node.js content management system. A regression introduced in commit 49d0bb7, included in versions 2.17.1 of the ApostropheCMS-maintained sanitize-html package bypasses allowedTags enforcement for text inside nonTextTagsArray elements (textarea and option). ApostropheCMS version 4.28.0 is affected through its dependency on the vulnerable sanitize-html version. The code at packages/sanitize-html/index.js:569-573 incorrectly assumes that htmlparser2 does not decode entities inside these elements and skips escaping, but htmlparser2 10.x does decode entities before passing text to the ontext callback. As a result, entity-encoded HTML is decoded by the parser and then written directly to the output as literal HTML characters, completely bypassing the allowedTags filter. An attacker can inject arbitrary tags including XSS payloads through any allowed option or textarea element using entity encoding. This affects non-default configurations where option or textarea are included in allowedTags, which is common in form builders and CMS platforms. This issue has been fixed in version 2.17.2 of sanitize-html and 4.29.0 of ApostropheCMS.

📍 영향받는 시스템

sanitize-html 2.17.1, ApostropheCMS 4.28.0

⚔️ 공격 벡터

allowedTags에 포함된 option/textarea 요소 내에 HTML 엔티티로 인코딩된 XSS 페이로드 주입

🛡️ 대응 방법

sanitize-html을 2.17.2 이상, ApostropheCMS를 4.29.0 이상으로 업그레이드

🔧 검증 코드

sanitize-html 버전이 2.17.2 이상이면 패치된 것으로 확인되며, 그 이하 버전이면 즉시 업그레이드 필요

Shell / Script
npm list sanitize-html 2>/dev/null | grep -E '@.*2\.(17\.[2-9]|1[8-9]\.|[2-9][0-9])'

📊 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