CVE-2026-41205

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

Published Apr 23, 2026 CVSS 4.0 · 7.7 High EPSS < 1% KEV · Not listed
Description
Mako is a template library written in Python. Prior to 1.3.11, 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. Any file readable by the process can be returned as rendered template content when an application passes untrusted input directly to TemplateLookup.get_template(). This vulnerability is fixed in 1.3.11.

Analysis

AI-generated

Technical impact

Mako, a Python template library, contains a path traversal flaw in TemplateLookup.get_template() before version 1.3.11. When a template URI begins with a double slash (//), two different slash‑stripping mechanisms diverge, allowing an attacker to craft a URI such as //../../../secret.txt that resolves outside the configured template directory. Any file readable by the running process can be retrieved and rendered as template content, exposing sensitive data to unauthenticated users. The weakness is a classic directory traversal (CWE‑22) and can lead to confidentiality compromise at a system level.

Affected Systems

The vulnerability affects the Mako library distributed by the SQLAlchemy group. Any installation of Mako prior to version 1.3.11 is affected. Administrators should verify whether their applications depend on Mako and determine the exact version in use. The fix is implemented in Mako 1.3.11 and newer releases.

Risk and Exploitability

The CVSS score of 7.7 indicates a high severity impact. The EPSS score of less than 1% suggests that current exploitation activity is low but still possible. The vulnerability is not listed in the CISA KEV catalog. Attackers are likely to exploit this flaw from a remote web application that trusts user-supplied URIs and forwards them to TemplateLookup.get_template(); the attack does not require elevated privileges and can retrieve any file readable by the application process.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Mako to version 1.3.11 or later
  • Validate or sanitize any user input that is passed to TemplateLookup.get_template() to prevent double‑slash prefixes
  • Configure TemplateLookup to restrict allowed directories and deny access to files outside the intended template path

Generated by OpenCVE AI on April 28, 2026 at 07:31 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-v92g-xgxw-vvmm Mako: Path traversal via double-slash URI prefix in TemplateLookup
Ubuntu USN Ubuntu USN USN-8234-1 Mako vulnerability
History
Type Values Removed Values Added
CPEs cpe:2.3:a:sqlalchemy:mako:*:*:*:*:*:*:*:*
Metrics cvssV3_1

{'score': 5.9, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N'}

cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N'}

Type Values Removed Values Added
First Time appeared Sqlalchemy
Sqlalchemy mako
Vendors & Products Sqlalchemy
Sqlalchemy mako
Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

{'score': 5.9, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N'}

threat_severity

Moderate

Type Values Removed Values Added
Metrics ssvc

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

Type Values Removed Values Added
Description Mako is a template library written in Python. Prior to 1.3.11, 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. Any file readable by the process can be returned as rendered template content when an application passes untrusted input directly to TemplateLookup.get_template(). This vulnerability is fixed in 1.3.11.
Title Mako: Path traversal via double-slash URI prefix in TemplateLookup
Weaknesses CWE-22
References
Metrics cvssV4_0

{'score': 7.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/E:P'}

Weaknesses
  • CWE-22

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

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
May 20, 2026, 1:32 AM
Reserved
Apr 18, 2026, 2:51 AM
Status
Modified
Published
Apr 23, 2026, 7:17 PM
Modified
Oct 26, 2026, 9:10 PM
Severity
Moderate
Public date
Apr 23, 2026, 6:52 PM