CVE-2026-102991 Details
Description
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.
A path traversal vulnerability has been identified in the Mako template library for Python, affecting versions prior to 1.4.2 on Windows. The issue arises in the TemplateLookup.get_template() method, which resolves template URIs using posixpath, while the Template.__init__() method validates them with os.path, leading to a mismatch. This discrepancy allows a URI starting with a drive designator to escape the configured template directory, potentially disclosing process-readable files on the same volume. Furthermore, if the accessed file contains Mako template syntax, it could be parsed and executed as a template. The vulnerability can be exploited through user-controlled template names or include paths, with the drive designator issue remaining unaddressed by previous fixes for similar traversal methods.
Users can update to Mako version 1.4.2, which normalizes URIs using posixpath to ensure consistent handling of drive designators.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed Sep 30, 2026CISA-ADP
Assessed Sep 30, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/sqlalchemy/mako/security/advisories/GHSA-5639-2j2p-m4mx | CISA-ADP | AdvisoryRemedyVendor |
| https://github.com/sqlalchemy/mako/commit/000ed85e4e48771eff460bf4fc721fb43de80e08 | [email protected] | Source CodeVendor |
| https://github.com/sqlalchemy/mako/issues/441 | [email protected] | ExploitIssue TrackingTechnical DescriptionVendor |
| https://github.com/sqlalchemy/mako/releases/tag/rel_1_4_2 | [email protected] | Release NotesVendor |
| https://github.com/sqlalchemy/mako/security/advisories/GHSA-5639-2j2p-m4mx | [email protected] | AdvisoryRemedyVendor |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-22 | Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| Mako | <= 1.4.1 (semver) |
CPE
Remediation
| |
Change History
2 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Sep 30, 2026 | New CVE Received | [email protected] |
| Sep 30, 2026 | CVE Modified | CISA-ADP |
Volerion