🇰🇷 한글 설명
Mistune는 렌더러와 플러그인을 포함한 Python Markdown 파서입니다. 3.2.1 이전 버전의 render_admonition() 함수는 :class: 옵션을 HTML 클래스 속성에 이스케이프 처리 없이 결합하여, HTMLRenderer의 이스케이프 모드가 활성화되어 있더라도 속성 주입 및 교차 사이트 스크립팅(XSS) 공격을 허용합니다.
💡 쉬운 설명
마크다운 문서를 HTML로 변환할 때 특정 옵션에 악성 코드를 숨겨 넣을 수 있는 보안 결함입니다. 이를 통해 공격자가 사용자의 브라우저에서 원치 않는 스크립트를 실행할 수 있습니다.
🇺🇸 원문 (English)
Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.2.1, render_admonition() in src/mistune/directives/admonition.py concatenates the Admonition directive :class: option into the HTML class attribute without escaping, allowing attribute injection and cross-site scripting even when HTMLRenderer escape mode is enabled. This issue is fixed in version 3.2.1.
📍 영향받는 시스템
Mistune Python 패키지 3.2.1 미만 버전
⚔️ 공격 벡터
Admonition 지시문의 :class: 옵션에 특수 문자를 포함한 악성 속성 값을 주입하여 XSS 공격 수행
🛡️ 대응 방법
Mistune 패키지를 3.2.1 이상의 최신 버전으로 업데이트
🔧 검증 코드
출력된 버전 번호가 3.2.1보다 낮으면 취약한 상태이며, 3.2.1 이상이면 안전합니다.
pip show mistune | grep Version