CVE-2026-102991Mako: Path traversal via drive-letter URI on Windows in TemplateLookup
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.
What to do
Fixed builds are available from PyPI: see the table below for the fixed version per release.
Ubuntu has not shipped a fix for every release yet.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 26.10 | mako | Fix pending | UBUNTU-CVE-2026-102991 | |
| Ubuntu 26.04 | mako | Fix pending | UBUNTU-CVE-2026-102991 | |
| Ubuntu 24.04 | mako | Fix pending | UBUNTU-CVE-2026-102991 | |
| Ubuntu 22.04 | mako | Fix pending | UBUNTU-CVE-2026-102991 | |
| Ubuntu 20.04 | mako | Fix pending | UBUNTU-CVE-2026-102991 | |
| Ubuntu 18.04 | mako | Fix pending | UBUNTU-CVE-2026-102991 | |
| Ubuntu 16.04 | mako | Fix pending | UBUNTU-CVE-2026-102991 | |
| PyPI library | mako | Fixed | 1.4.2 | GHSA-5639-2j2p-m4mx |
What the vendor says
As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.
- sqlalchemy mako: affected: < 1.4.2
References
- https://github.com/sqlalchemy/mako/security/advisories/GHSA-5639-2j2p-m4mx
- https://github.com/sqlalchemy/mako/issues/441
- https://github.com/sqlalchemy/mako/commit/000ed85e4e48771eff460bf4fc721fb43de80e08
- https://github.com/sqlalchemy/mako/releases/tag/rel_1_4_2
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.