🔍 CVE-2026-102991

6.5
CVSS Score
MEDIUM
2026-09-30
2026-09-30 20:17
✅ 완료

🇰🇷 한글 설명

Python용 Mako 템플릿 라이브러리의 Windows 환경에서 경로 처리 방식의 불일치로 인해 발생하는 취약점입니다. 공격자가 조작된 템플릿 URI를 통해 설정된 디렉토리를 벗어나 시스템 파일을 읽거나, 악성 템플릿 구문이 포함된 파일을 실행할 수 있습니다.

💡 쉬운 설명

윈도우에서 파일 경로를 계산하는 방식이 서로 달라 발생하는 보안 구멍입니다. 이를 통해 해커가 허용되지 않은 컴퓨터 내부 파일을 몰래 훔쳐보거나 실행할 수 있습니다.

🇺🇸 원문 (English)

Mako is a template library written in Python. Prior to 1.4.2, on Windows, TemplateLookup.get_template() in mako/lookup.py resolves template URIs with posixpath, while Template.__init__() in mako/template.py validates them with os.path, which uses ntpath. A URI beginning with a drive designator causes ntpath to absorb the traversal segments before the leading dot-dot check, while posixpath resolution can escape the configured template directory. An application that passes attacker-controlled template names or include paths can disclose process-readable files on the same volume, and a targeted file containing Mako template syntax may also be parsed and executed as a template. Raw URL paths are generally normalized before reaching this form, but query strings, form or JSON bodies, route parameters, and dynamic include expressions can preserve it. This issue is fixed in version 1.4.2.

📍 영향받는 시스템

Mako template library version < 1.4.2 (Windows 환경)

⚔️ 공격 벡터

사용자 입력값(쿼리 스트링, JSON 바디 등)을 통해 조작된 템플릿 경로를 전달하여 경로 탐색(Path Traversal) 수행

🛡️ 대응 방법

Mako 라이브러리를 1.4.2 버전 이상으로 업데이트

🔧 검증 코드

출력된 Version 값이 1.4.2 미만이면 취약한 버전이 설치된 상태입니다.

Shell / Script
pip show mako | grep Version

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N

💻 영향받는 소프트웨어

Python