🇰🇷 한글 설명
Mistune 3.3.0 미만 버전의 Include.parse() 함수는 사용자 제공 포함 경로를 정규화할 때 의도된 디렉토리 외부의 파일에 접근할 수 있는 검증 결함이 있습니다. 이로 인해 마크다운 파일을 처리할 때 공격자가 조작된 경로를 사용하여 시스템의 임의 파일에 접근할 수 있습니다.
💡 쉬운 설명
마크다운 파일을 읽어주는 프로그램에서 파일 경로를 제대로 확인하지 않아 발생하는 문제입니다. 공격자가 특수하게 만든 경로를 입력하면 원래 보여주면 안 되는 컴퓨터 내부의 중요한 파일들을 몰래 읽어갈 수 있습니다.
🇺🇸 원문 (English)
Mistune is a Python Markdown parser with renderers and plugins. Prior to 3.3.0, Include.parse() joins and normalizes user-supplied include paths without verifying that the result remains within the intended markdown directory, allowing crafted include paths to access files outside that directory when markdown files are processed using md.read(). This issue is fixed in version 3.3.0.
📍 영향받는 시스템
Mistune Python 패키지 3.3.0 미만 버전
⚔️ 공격 벡터
조작된 include 경로를 포함한 마크다운 파일을 제공하여 디렉토리 트래버설(Directory Traversal) 공격 수행
🛡️ 대응 방법
Mistune 패키지를 3.3.0 버전 이상으로 업데이트
🔧 검증 코드
출력된 Version 값이 3.3.0보다 낮으면 취약한 상태이며, 3.3.0 이상이면 안전합니다.
pip show mistune | grep Version