CVE-2026-44307

Mako: Path traversal via backslash URI on Windows in TemplateLookup

Published May 12, 2026 CVSS 4.0 · 8.7 High EPSS < 1% KEV · Not listed
Description
Mako is a template library written in Python. Prior to 1.3.12, on Windows, a URI using backslash traversal (e.g. \..\..\ secret.txt) bypasses the directory traversal check in Template.__init__ and the posixpath-based normalization in TemplateLookup.get_template(), allowing reads of files outside the configured template directory. This vulnerability is fixed in 1.3.12.

Analysis

AI-generated

Technical impact

Mako, a Python template library, contains a directory traversal flaw that can be triggered on Windows systems by providing a URI that includes backslash traversal sequences (for example, "\\..\\..\\secret.txt"). The vulnerability bypasses the traversal check performed in Template.__init__ and the subsequent posixpath-based normalization in TemplateLookup.get_template(), allowing unauthorized reading of files outside the intended template directory. This flaw is a classic file inclusion attack and can lead to disclosure of sensitive system files or other confidential data managed by the application.

Affected Systems

The issue affects all installations of Mako older than version 1.3.12 that are deployed on Windows platforms. The library is distributed by SQLAlchemy. Users running a version prior to 1.3.12 are vulnerable.

Risk and Exploitability

The flaw carries a CVSS score of 8.7, indicating a high severity level. No EPSS score is available, and the vulnerability is not listed in the CISA KEV catalog, but the lack of an EPSS score does not diminish the potential for exploitation. Attackers can invoke the vulnerability remotely through web applications or services that accept user-supplied template names; the backslash path traversal technique exploits a Windows-specific limitation in the library's path handling logic. Given the high CVSS score and the possibility of remote exploitation, this vulnerability requires prompt remediation.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to Mako version 1.3.12 or later, which implements proper traversal checks and path normalization.
  • Configure the application to restrict template rendering to explicit, whitelisted file names and directories to eliminate unintended access.
  • Sanitize all user-supplied template URIs by removing backslash characters and rejecting any traversal patterns before passing them to Mako's TemplateLookup.

Generated by OpenCVE AI on May 12, 2026 at 23:39 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-2h4p-vjrc-8xpq Mako vulnerable to path traversal via backslash URI on Windows in TemplateLookup
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Sqlalchemy
Sqlalchemy mako
Vendors & Products Sqlalchemy
Sqlalchemy mako
Type Values Removed Values Added
Description Mako is a template library written in Python. Prior to 1.3.12, on Windows, a URI using backslash traversal (e.g. \..\..\ secret.txt) bypasses the directory traversal check in Template.__init__ and the posixpath-based normalization in TemplateLookup.get_template(), allowing reads of files outside the configured template directory. This vulnerability is fixed in 1.3.12.
Title Mako: Path traversal via backslash URI on Windows in TemplateLookup
Weaknesses CWE-22
References
Metrics cvssV4_0

{'score': 8.7, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
May 13, 2026, 3:00 PM
Reserved
May 5, 2026, 7:00 PM
Status
Deferred
Published
May 12, 2026, 10:16 PM
Modified
Oct 26, 2026, 2:10 PM