Read the docs

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

Priority MEDIUM 62CWE-22Published · Updated

Key facts

Attack vector
Network
Privileges required
None
User interaction
None
Attack complexity
High
Impact type
—
Confidentiality · integrity · availability
High · Low · None
Fix status
Partial Red Hat: 1 without a fix

Attack profile from CVSS 3.1 · CNA. Fix status from CNA, GitHub and Red Hat.

Summary

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.

Why it matters now

Exploitation Proof of concept CISA SSVC · not in CISA KEV
EPSS 0.00356 29th percentileScored 2026-11-07
Fix Partial mako (sqlalchemy): 1.4.2Mako (PyPI): 1.4.2Red Hat: 1 without a fix

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
Poc
Automatable
No
Technical impact
Partial

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
sqlalchemymakobefore 1.4.21.4.2Patch availableCNA
—Mako (PyPI)before 1.4.21.4.2Patch availableGHSA-5639-2j2p-m4mx
  • mako Vendorsqlalchemy Affected before 1.4.2 Fixed in 1.4.2 Patch available CNA
  • Mako (PyPI) Vendor— Affected before 1.4.2 Fixed in 1.4.2 Patch available GHSA-5639-2j2p-m4mx

Remediation

  • Fix · CNA mako (sqlalchemy) Fixed in 1.4.2
  • Fix · GHSA-5639-2j2p-m4mx Mako (PyPI) Fixed in 1.4.2 Advisory →

Vendor assessments

Red Hat

Red Hat rating: Moderate. Red Hat's page for this CVE →

ProductStatusPlan or fix
Red Hat OpenShift AI (RHOAI)AffectedNo fix yet: Fix deferred

Timeline

  1. 2026-10-02 Threatist record created from CVE-2026-102991
  2. 2026-10-06 Alias added: GHSA-5639-2j2p-m4mx
  3. 2026-10-06 Fix available: PyPI/[email protected] · GHSA-5639-2j2p-m4mx
  4. 2026-10-06 CVSS score added · GHSA-5639-2j2p-m4mx
  5. 2026-10-06 Weakness changed · GHSA-5639-2j2p-m4mx
  6. 2026-10-06 6 new references · GHSA-5639-2j2p-m4mx
  7. 2026-11-06 Affected versions changed · Red Hat
  8. 2026-11-06 CVSS score added · Red Hat
  9. 2026-11-06 Affected versions changed · Red Hat

References

  • TI-2019-05082 SQLAlchemy through 1.2.17 and 1.3.x through 1.3.0b2 allows SQL Injection via the order_by parameter. CVSS 3.1CRITICAL 9.8
  • TI-2026-32275 Mako: Path traversal via backslash URI on Windows in TemplateLookup CVSS 4.0HIGH 8.7
  • TI-2019-05329 SQLAlchemy 1.2.17 has SQL Injection when the group_by parameter can be controlled. CVSS 3.1HIGH 7.8
  • TI-2012-00742 Multiple SQL injection vulnerabilities in SQLAlchemy before 0.7.0b4, as used in Keystone… CVSS 2.0HIGH 7.5
  • TI-2022-18951 Sqlalchemy mako before 1.2.2 is vulnerable to Regular expression Denial of Service when… CVSS 3.1HIGH 7.5
  • TI-2026-29824 Mako: Path traversal via double-slash URI prefix in TemplateLookup CVSS 4.0HIGH 7.7

Sources