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

Published Sep 30, 2026
·
Updated

Mako is a template library written in Python. Prior to 1.4.2, on Windows, TemplateLookup.gettemplate() 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.

Affected Software

1 affected component
pypi/mako<1.4.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade Mako to a version that resolves this vulnerability.

    Fixed in 1.4.2

Event History

Sep 30, 2026
CVE Published
via MITRE·07:47 PM
Data Sourced
via MITRE·07:47 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·08:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are exposed?

Windows deployments using Mako versions before 1.4.2 are exposed when an application passes attacker-controlled template names or include paths to TemplateLookup.get_template(). Inputs from query strings, form or JSON bodies, route parameters, and dynamic include expressions may preserve the required path form.

2

What does an attacker need to provide?

The attacker needs to control a template URI or include path that begins with a drive designator. Raw URL paths are generally normalized before reaching this form, so exploitation depends on an application accepting the value through another input path or preserving it in a dynamic include expression.

3

What is the practical impact?

An attacker may escape the configured template directory and disclose files readable by the process on the same volume. If a targeted file contains Mako template syntax, it may also be parsed and executed as a template.

4

How can this be remediated?

Upgrade Mako to version 1.4.2, which fixes the issue. Review application code that passes externally controlled values as template names or include paths.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203