CVE-2026-102991
CVE-2026-102991 · Mako: Path traversal via drive-letter URI on Windows in TemplateLookup
This page contains facts from public vulnerability sources. Check the original advisory before updating.
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.
CVSS 6.5 · Medium · EPSS 0.4% · Fix available
- Published
- Updated
Affected products and versions
mako
- Versions
- < 1.4.2: Affected
No fix published
mako PyPI
- Versions
- 0.1.0
- 0.1.1
- 0.1.10
- 0.1.2
- 0.1.3
- 0.1.4
- 0.1.5
- 0.1.6
- 0.1.7
- 0.1.8
- 0.1.9
- 0.2.0
- 0.2.1
- 0.2.2
- 0.2.3
- 0.2.4
- 0.2.5
- 0.3.0
- 0.3.1
- 0.3.2
- 0.3.3
- 0.3.4
- 0.3.5
- 0.3.6
- 0.4.0
- 0.4.1
- 0.4.2
- 0.5.0
- 0.6.0
- 0.6.1
- 0.6.2
- 0.7.0
- 0.7.1
- 0.7.2
- 0.7.3
- 0.8.0
- 0.8.1
- 0.9.0
- 0.9.1
- 1.0.0
- 1.0.1
- 1.0.10
- 1.0.11
- 1.0.12
- 1.0.13
- 1.0.14
- 1.0.2
- 1.0.3
- 1.0.4
- 1.0.5
- 1.0.6
- 1.0.7
- 1.0.8
- 1.0.9
- 1.1.0
- 1.1.1
- 1.1.2
- 1.1.3
- 1.1.4
- 1.1.5
- 1.1.6
- 1.2.0
- 1.2.1
- 1.2.2
- 1.2.3
- 1.2.4
- 1.3.0
- 1.3.1
- 1.3.10
- 1.3.11
- 1.3.12
- 1.3.2
- 1.3.3
- 1.3.4
- 1.3.5
- 1.3.6
- 1.3.7
- 1.3.8
- 1.3.9
- 1.4.0
- 1.4.1
- Affected ranges
- ECOSYSTEM: < 1.4.2
Update to 1.4.2
mako Ubuntu:Pro:16.04:LTS
- Versions
- 1.0.2+ds1-1
- 1.0.3+ds1-1
- 1.0.3+ds1-1ubuntu1
- 1.0.3+ds1-1ubuntu1+esm1
- 1.0.3+ds1-1ubuntu1+esm2
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
mako Ubuntu:Pro:18.04:LTS
- Versions
- 1.0.7+ds1-1
- 1.0.7+ds1-1ubuntu0.2
- 1.0.7+ds1-1ubuntu0.2+esm1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
mako Ubuntu:Pro:20.04:LTS
- Versions
- 1.0.7+ds1-1
- 1.1.0+ds1-1
- 1.1.0+ds1-1ubuntu1
- 1.1.0+ds1-1ubuntu2
- 1.1.0+ds1-1ubuntu2.1
- 1.1.0+ds1-1ubuntu2.1+esm1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
mako Ubuntu:22.04:LTS
- Versions
- 1.1.3+ds1-2
- 1.1.3+ds1-2ubuntu0.1
- 1.1.3+ds1-2ubuntu0.2
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
mako Ubuntu:24.04:LTS
- Versions
- 1.2.4+ds-2
- 1.3.1-1
- 1.3.2-1
- 1.3.2-1ubuntu0.1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
mako Ubuntu:26.10
- Versions
- 1.3.10-3build1
- 1.3.10-3ubuntu0.1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
mako Ubuntu:26.04:LTS
- Versions
- 1.3.9-1
- 1.3.10-3
- 1.3.10-3build1
- 1.3.10-3ubuntu0.1
- Affected ranges
- ECOSYSTEM: (−∞, +∞)
No fix published
Original sources
- 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
- https://nvd.nist.gov/vuln/detail/CVE-2026-102991