CVE-2026-44307
NoneCVSS
—
EPSS
0.9%
Published
May 12, 2026
CISA due date
—
Cloudanix analysis
A flaw in a Python templating component can let attackers read files they should not be able to access on Windows-based applications that accept unsafe template paths.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Data Exposure
- Component
- Library
- Class
- Path Traversal
- Remediation
- Upgrade
- Effort
- Low
- Patch risk
- Low
What it actually does
This is a Windows-specific path traversal flaw in the Mako Python template library before version 1.3.12. When an application passes user-controllable template names or URIs into Mako's Template or TemplateLookup APIs, backslash-based traversal sequences can bypass path normalization and directory boundary checks that are based on POSIX-style path handling. As a result, an attacker may cause the application to read files outside the intended template directory. The primary impact is unauthorized file disclosure; integrity and availability are not directly affected by the described flaw.
Why it matters to the business
Applications using vulnerable Mako versions on Windows may expose sensitive local files if template paths are reachable through web requests, APIs, plugins, or other user-controlled inputs. Depending on what the application can access, this could reveal configuration files, application source, secrets, credentials, service account data, or other sensitive business information. Although exploitation is not currently listed in CISA KEV and the EPSS score is low, the vulnerability has been public for over 90 days and is straightforward to test where user-controlled template loading exists, so affected Windows deployments should be upgraded during the next normal security maintenance cycle or sooner for internet-facing systems.
How an attack unfolds
An attacker first identifies an application feature that causes Mako to load a template based on a supplied name, path, theme, view, include, or similar parameter. If the application runs on Windows and uses a vulnerable Mako version, the attacker submits a template identifier containing Windows backslash traversal sequences such as nested `\..\` components. Because vulnerable versions do not correctly normalize those backslashes when enforcing the configured template directory boundary, Mako can resolve the request to a file outside the intended template directory. If the target file is readable by the application process and Mako attempts to load or return it in a way visible to the attacker, the attacker can disclose file contents. The exploit does not require authentication in applications where the vulnerable template lookup path is exposed to unauthenticated users, but the real-world exploitability depends on how the application wires user input into Mako.
How to fix it
Upgrade Mako to version 1.3.12 or later wherever it is used, including transitive and vendored copies in Python applications. If immediate upgrade is not possible, prevent user-controlled input from being passed directly to `Template`, `TemplateLookup.get_template()`, template include paths, or similar APIs. Enforce an allowlist of valid template names, reject absolute paths and any path containing `..`, `/`, `\`, URL-encoded slash or backslash variants, or drive-letter syntax, and canonicalize paths using Windows-aware path handling before opening files. Run applications with least-privilege filesystem access so the process cannot read secrets or unrelated directories. For internet-facing applications, consider temporary WAF or reverse-proxy rules blocking suspicious path traversal sequences using backslashes until all affected components are upgraded.
How to confirm the fix worked
Confirm installed Mako versions with package inventory tools such as `pip show Mako`, `python -m pip show Mako`, `pip list`, `pip freeze`, lockfiles, SBOMs, container image scans, and dependency manifests. Validate that all runtime environments, virtual environments, containers, build artifacts, and vendored dependencies use Mako 1.3.12 or later. On Windows systems, test any route or interface that accepts template names with benign backslash traversal payloads and verify the application rejects the request without reading outside the template directory. Review application code for calls to `mako.template.Template`, `mako.lookup.TemplateLookup`, and `get_template()` where arguments can be influenced by users. After remediation, repeat the traversal tests and confirm that requests containing backslash traversal sequences are blocked, normalized safely, or constrained to an explicit allowlist.
Typical attack path
- Identify a web route, API parameter, plugin mechanism, theme selector, or template include path that influences a Mako template name or URI.
- Confirm the target application is likely using Mako before version 1.3.12 and is running on Windows.
- Submit path traversal payloads using Windows backslashes rather than forward slashes, such as `\..\..\filename`.
- Iteratively adjust traversal depth and target filenames to escape the configured template directory.
- Read files that are accessible to the application process, such as configuration files, source files, logs, or local secrets.
- Use any disclosed secrets or configuration data to support follow-on access, credential theft, or lateral movement.
How to detect it
Look for evidence of attempted Windows-style path traversal in HTTP access logs, application logs, WAF logs, reverse-proxy logs, and error traces from services that use Mako. Focus on requests to endpoints that load templates, themes, views, reports, documents, includes, previews, or localized pages based on request parameters. Search for raw and URL-encoded backslash traversal patterns, repeated parent-directory components, Windows drive-letter paths, and attempts to read common sensitive files. In application logs, investigate Mako exceptions, template lookup failures, or unexpected successful reads involving paths outside the configured template directory. On Windows hosts, correlate suspicious requests with file access telemetry from EDR, Sysmon, or audit logs showing the application process reading files outside expected template and application directories shortly after the request. If exploitation is suspected, review whether files containing secrets or credentials were accessed, rotate exposed credentials, and examine follow-on authentication or network activity using those secrets.
- \\..\\
- ..\\
- %5c..%5c
- %5C..%5C
- %255c..%255c
- %255C..%255C
- %2e%2e%5c
- %2E%2E%5C
- ..%5c..%5c
- ..%5C..%5C
- \\..\\..\\
- ..\\..\\
- C:\\Windows\\win.ini
- C:%5cWindows%5cwin.ini
- C:\\Windows\\System32\\drivers\\etc\\hosts
- C:%5cWindows%5cSystem32%5cdrivers%5cetc%5chosts
- boot.ini
- secret.txt
- TemplateLookup.get_template
- mako.lookup
- mako.template
- TopLevelLookupException
- TemplateLookupException
What your security team should do
- Inventory Python applications and services using Mako, prioritizing Windows-hosted and internet-facing deployments.
- Upgrade Mako to 1.3.12 or later across production, staging, CI/CD build images, containers, and developer dependency baselines.
- Search application code for user-controlled template loading through Mako APIs and replace dynamic path construction with allowlisted template identifiers.
- Add input validation and logging for rejected template names containing traversal patterns, backslashes, encoded slashes, encoded backslashes, drive letters, or absolute paths.
- Review web, application, and reverse-proxy logs for historical requests containing Windows-style traversal payloads.
- Reduce blast radius by ensuring application service accounts cannot read secrets, configuration files, user data, or operating system files outside the application’s required directories.
- Add regression tests for Windows path traversal cases so future dependency or code changes do not reintroduce unsafe template resolution.
The record
Mako is a template library written in Python. Prior to 1.3.12, on Windows, a URI using backslash traversal (e.g. \..\..\ secret.txt) bypasses the directory traversal check in Template.__init__ and the posixpath-based normalization in TemplateLookup.get_template(), allowing reads of files outside the configured template directory. This vulnerability is fixed in 1.3.12.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|
Related vulnerabilities
- CVE-2026-81163 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')… CWE-22
- CVE-2026-112049 Vita3K before build 4187 contains a path traversal (zip slip) vulnerability in… CWE-22
- CVE-2026-112005 WhoDB 0.104.0 before 0.135.0 contains a path traversal vulnerability that allows remote… CWE-22
- CVE-2026-61702 OpenPrinting CUPS is an open source printing system for Linux and other Unix-like… CWE-22
- CVE-2026-104871 The Angular SSR is a server-rise rendering tool for Angular applications. CWE-22
- CVE-2026-102991 Mako is a template library written in Python. CWE-22
- CVE-2026-101894 The decompress package for Node.js extracts archives. CWE-22
- CVE-2026-100689 GitPython before 3.1.62 does not validate the `path` field read from an untrusted… CWE-22