cve.bz

CVE-2026-102991 sqlalchemy mako: Path traversal

6.5 mediumEPSS 0.4%Fix available

Medium (6.5) in sqlalchemy mako. EPSS 0.4% estimated probability of exploitation activity in the next 30 days. Fixed in mako 1.4.2.

On this page
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.

Severity

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
EPSS
0.4% (unchanged from 0.4% a week ago; 0.4% 30 days ago) estimated probability of exploitation activity in the next 30 days; 30th percentile. Scored 2026-11-17. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: PoC · Automatable: no · Technical impact: partial, assessed 2026-09-30. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-22 Improper Limitation of a Pathname to a Restricted Directory (Path traversal)
OWASP Top 10
A01:2025 Broken Access Control
Published
Modified
NVD analysis
Deferred: the NVD does not plan to analyze it
Record from
the NVD, synced

Fix and patched versions

  • mako (PyPI): fixed in 1.4.2

Ask an AI about this CVE

Show the promptExplain CVE-2026-102991 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-102991?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-102991?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-102991 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
sqlalchemy mako< 1.4.2

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-5639-2j2p-m4mxPyPImako<1.4.21.4.2
PYSEC-2026-4243PyPImako<1.4.21.4.2

Linux distributions

DistributionReleasePackageFixed inAdvisory
Ubuntu22.04:LTS, 24.04:LTS, 26.04:LTS and 4 moremakono fix listedUBUNTU-CVE-2026-102991
Azure Linux3python-makono fix listedAZL-105645

From the distributions' data via OSV.dev: Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Microsoft's Azure Linux vulnerability data, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Ubuntu.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

A moderate severity path traversal flaw was found in Mako, a Python template library. On Windows systems, Mako resolves template URIs using posixpath while validating them using os.path (ntpath on Windows), so a TemplateLookup URI beginning with a drive-letter designator (for example C:/../../secret.txt) bypasses the directory-confinement check and can resolve to files outside the configured template directory anywhere on the same storage volume. A remote attacker who can influence template names or include paths used by an application running Mako on Windows, for example through query strings, form or JSON bodies, route parameters, or dynamic include expressions, could use this flaw to disclose sensitive files readable by the application process on the same volume. If an accessible file contains Mako template syntax, it may also be parsed and executed as a template, potentially leading to unauthorized code execution. The Red Hat severity of Moderate (CVSS 6.5) is consistent with the upstream rating, and exposure is limited to applications running Mako on Windows that pass attacker-controlled values to template lookup or include paths. No Red Hat products are currently listed as affected by this flaw.

Red Hat's mitigation

Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base, or stability. The upstream project has released a fixed version, Mako 1.4.2.

ProductPackageStateAdvisory
Red Hat OpenShift AI (RHOAI)rhoai/odh-mlflow-rhel9Fix deferred

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-102991.

Attack patterns (CAPEC)

  • CAPEC-64 Using Slashes and URL Encoding Combined to Bypass Validation Logic Likelihood: High · Severity: High
  • CAPEC-76 Manipulating Web Input to File System Calls Likelihood: High · Severity: Very High
  • CAPEC-78 Using Escaped Slashes in Alternate Encoding Likelihood: High · Severity: High
  • CAPEC-79 Using Slashes in Alternate Encoding Likelihood: High · Severity: High
  • CAPEC-126 Path Traversal Likelihood: High · Severity: Very High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON