🇰🇷 한글 설명
Mistune은 Python 마크다운 파서로, 3.2.1 이전 버전의 HTMLRenderer.heading() 함수에서 id 속성값을 이스케이프하지 않습니다. 이로 인해 큰따옴표(
💡 쉬운 설명
마크다운을 HTML로 변환하는 Mistune 도구에서 특수문자를 제대로 처리하지 않아, 악의적인 HTML 코드를 삽입할 수 있습니다. 이를 통해 사용자의 브라우저에서 원치 않는 코드가 실행될 수 있습니다.
🇺🇸 원문 (English)
Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.2.1, HTMLRenderer.heading() builds the opening <hN> tag by string-concatenating the id attribute value directly into the HTML — with no call to escape(), safe_entity(), or any other sanitisation function. A double-quote character " in the id value terminates the attribute, allowing an attacker to inject arbitrary additional attributes (event handlers, src=, href=, etc.) into the heading element. This vulnerability is fixed in 3.2.1.
📍 영향받는 시스템
Mistune < 3.2.1 (Python 패키지)
⚔️ 공격 벡터
Markdown heading의 id 속성에 큰따옴표(
🛡️ 대응 방법
Mistune을 3.2.1 이상으로 업그레이드 (pip install --upgrade mistune)
🔧 검증 코드
설치된 Mistune 버전이 3.2.1 이상이면 안전하며, 3.2.1 미만이면 즉시 업그레이드 필요
python3 -c "import mistune; print('Mistune version:', mistune.__version__)" || pip show mistune | grep Version