Advisories for Pypi/Mako package

2026

Mako: Path traversal via drive-letter URI on Windows in TemplateLookup

On Windows, a TemplateLookup URI beginning with a drive designator (e.g. C:/../../secret.txt or C:....\secret.txt) bypasses the directory traversal check in Template.init, allowing reads of files outside the configured template directory. This is a third, independent instance of the root cause behind CVE-2026-41205 (the // prefix) and CVE-2026-44307 (the backslash form). Both of those fixes normalized a separator spelling. Neither addressed the other way posixpath and ntpath disagree: the drive designator. …

Mako: Path traversal via double-slash URI prefix in TemplateLookup

TemplateLookup.get_template() is vulnerable to path traversal when a URI starts with // (e.g., //../../../secret.txt). The root cause is an inconsistency between two slash-stripping implementations: Template.init strips one leading / using if/slice TemplateLookup.get_template() strips all leading / using re.sub(r"^/+", "") When a URI like //../../../../etc/passwd is passed: get_template() strips all / → ../../../../etc/passwd → file found via posixpath.join(dir_, u) Template.init strips one / → /../../../../etc/passwd → normpath → /etc/passwd /etc/passwd.startswith(..) → …

Mako: Path traversal via double-slash URI prefix in TemplateLookup

TemplateLookup.get_template() is vulnerable to path traversal when a URI starts with // (e.g., //../../../secret.txt). The root cause is an inconsistency between two slash-stripping implementations: Template.init strips one leading / using if/slice TemplateLookup.get_template() strips all leading / using re.sub(r"^/+", "") When a URI like //../../../../etc/passwd is passed: get_template() strips all / → ../../../../etc/passwd → file found via posixpath.join(dir_, u) Template.init strips one / → /../../../../etc/passwd → normpath → /etc/passwd /etc/passwd.startswith(..) → …

2022

Mako contains Cross-site Scripting vulnerability

Mako before 0.3.4 relies on the cgi.escape function in the Python standard library for cross-site scripting (XSS) protection, which makes it easier for remote attackers to conduct XSS attacks via vectors involving single-quote characters and a JavaScript onLoad event handler for a BODY element.