🇰🇷 한글 설명
Mistune 3.2.0 이하 버전의 render_figure() 함수는 figclass 및 figwidth 옵션을 이스케이프 없이 HTML 속성에 직접 연결하여 취약점을 유발합니다. 이로 인해 HTMLRenderer(escape=True) 설정 사용 시에도 속성 주입 및 XSS 공격이 가능해집니다.
💡 쉬운 설명
마크다운 변환 과정에서 사용자 입력이 제대로 검사되지 않아 악성 스크립트가 삽입될 수 있습니다. 이를 방지하려면 최신 버전으로 업데이트해야 합니다.
🇺🇸 원문 (English)
Mistune is a Python Markdown parser with renderers and plugins. In 3.2.0 and earlier, in src/mistune/directives/image.py, the render_figure() function concatenates figclass and figwidth options directly into HTML attributes without escaping. This allows attribute injection and XSS even when HTMLRenderer(escape=True) is used, because these values bypass the inline renderer. Version 3.2.1 contains a patch.
📍 영향받는 시스템
Mistune Python 패키지 버전 3.2.0 이하
⚔️ 공격 벡터
악의적으로 조작된 Markdown 입력을 통해 HTML 속성 주입 및 XSS 발생
🛡️ 대응 방법
Mistune 패키지를 3.2.1 이상으로 즉시 업그레이드하십시오.
🔧 검증 코드
출력된 버전 번호가 3.2.1보다 낮거나 같으면 취약한 버전입니다.
pip show mistune 2>/dev/null | grep -i version