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

Medium 6.5 Published Updated

Attackers can exploit path traversal in Mako on Windows to read arbitrary files or execute code via crafted template URIs.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2026-102991?

CVE-2026-102991 is a medium-severity path traversal vulnerability in sqlalchemy mako, published on 30 Sep 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official 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.

Weakness: CWE-22

Which versions are affected by CVE-2026-102991?

3 open source packages ship an affected version, including mako and Mako.

PackageAffectedFixed in
mako PyPIAll versions1.4.2
mako PyPIAll versions1.4.2
Mako PyPIAll versions1.4.2

How do I fix CVE-2026-102991?

Upgrade mako to 1.4.2 or later.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2026-102991 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-102991 exists.

Sources

Also known as AZL-105645, CLEANSTART-2026-RY75386, CLEANSTART-2026-XA70442, ECHO-ad96-000e-33ae, GHSA-5639-2j2p-m4mx, MINI-56m4-2j5m-wh29 and 8 more.

Is CVE-2026-102991 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free