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

- Severity: Medium 6.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.36%, higher than 31% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-09-30T19:47:07.128Z
- Modified: 2026-10-15T14:55:45.473Z
- Also known as: GHSA-5639-2j2p-m4mx, PYSEC-2026-4243
- Weaknesses: CWE-22
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: GitHub_M

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

(As written by CVE List.)

## Affected

- sqlalchemy mako: < 1.4.2
- mako (PyPI): before 1.4.2

## Every score

- GitHub_M: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N`
- GitHub: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N`
- PyPA Advisory Database: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N`

## References

- <https://github.com/sqlalchemy/mako/security/advisories/GHSA-5639-2j2p-m4mx> (exploit, web)
- <https://github.com/sqlalchemy/mako/issues/441> (web)
- <https://github.com/sqlalchemy/mako/commit/000ed85e4e48771eff460bf4fc721fb43de80e08> (web)
- <https://github.com/sqlalchemy/mako/releases/tag/rel_1_4_2> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-102991> (advisory)
- <https://github.com/sqlalchemy/mako> (package)
- <https://pypi.org/project/mako> (package)
- <https://github.com/advisories/GHSA-5639-2j2p-m4mx> (advisory)

## Sources

- CVE List: [CVE-2026-102991](https://www.cve.org/CVERecord?id=CVE-2026-102991), CVE Terms of Use, modified 2026-09-30
- GitHub Advisory Database: [GHSA-5639-2j2p-m4mx](https://github.com/advisories/GHSA-5639-2j2p-m4mx), CC-BY-4.0, modified 2026-10-15
- NVD: [CVE-2026-102991](https://nvd.nist.gov/vuln/detail/CVE-2026-102991), Public domain, modified 2026-09-30
- PyPA Advisory Database: [PYSEC-2026-4243](https://osv.dev/vulnerability/PYSEC-2026-4243), CC-BY-4.0, modified 2026-10-15

---

Page: https://cve.day/CVE-2026-102991 · Whole record: https://cve.day/CVE-2026-102991.json · Rebuilt by cve.day 2026-11-25T22:59:41.747Z
