CVE-2026-41205: SQLAlchemy Mako path traversal in TemplateLookup

CVE-2026-41205 · Severity: high · CVSS 7.5 · Published 2026-04-23

Mako is a Python library used by developers to generate dynamic web pages and documents from templates. A security flaw allows attackers to bypass directory restrictions and access sensitive files on the server that should be private. This could lead to the exposure of system configuration files, credentials, or other confidential data if the application uses user-provided input to select templates.

Technologies: Mako (PyPI). Vendors: PyPI.

Quick answers

Is CVE-2026-41205 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-41205 being exploited in the wild.
How severe is CVE-2026-41205?
High severity, with a CVSS score of 7.5, published 23 April 2026.
Which products and versions are affected?
Mako (PyPI) <= 1.3.10, ECOSYSTEM:introduced=0,fixed=1.3.11.
Is there a fix for CVE-2026-41205?
Yes. Mako (PyPI): upgrade to 1.3.11 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-41205 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-41205?
Check whether you run Mako (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • Mako (PyPI): upgrade to 1.3.11 or later
    pip install "Mako>=1.3.11"

Technical details

A path traversal vulnerability exists in Mako's TemplateLookup.get_template() due to inconsistent URI normalization. While TemplateLookup.get_template() strips all leading slashes using a regular expression, the Template class initialization only stripped a single leading slash. By providing a URI starting with a double slash (e.g., //../../etc/passwd), an attacker can bypass the directory traversal check because the resulting path is normalized to an absolute path that does not start with the expected parent directory. This allows for arbitrary file reads of any file accessible to the Python process. The issue is resolved in version 1.3.11 by using lstrip("/") to ensure consistent slash removal across both components.

Affected products

  • SQLAlchemy Mako < 1.3.11

Identifiers

  • CVE-2026-41205
  • GHSA-v92g-xgxw-vvmm
  • PYSEC-2026-88

Timeline

  • 2026-04-14: patched: Version 1.3.11 released
  • 2026-04-15: advisory: GitHub Security Advisory published
  • 2026-04-23: disclosed: CVE-2026-41205 published to NVD

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.