Register for the AI for Security Summit: Join Figma, Perplexity & Wiz

CVE-2026-41205
Python vulnerability analysis and mitigation

Overview

CVE-2026-41205 is a path traversal vulnerability in the Mako Python template library affecting all versions prior to 1.3.11. The flaw exists in TemplateLookup.get_template(), which can be bypassed using a URI starting with // (e.g., //../../../secret.txt) to read arbitrary files outside the intended template directory. It was disclosed on April 23, 2026, with the fix released on April 14, 2026 in Mako 1.3.11. The vulnerability carries a CVSS v3.1 base score of 7.5 (High) and a CVSS v4.0 base score of 7.7 (High) (GitHub Advisory, Feedly).

Technical details

The root cause (CWE-22: Path Traversal) is an inconsistency between two slash-stripping implementations within Mako. TemplateLookup.get_template() strips all leading slashes using re.sub(r"^\/+", "", ...), while Template.__init__ previously stripped only a single leading slash via an if/slice operation. When a URI like //../../../../etc/passwd is passed, get_template() reduces it to ../../../../etc/passwd and resolves the file via posixpath.join(dir_, u), but Template.__init__ strips only one slash, yielding /../../../../etc/passwd, which after normpath becomes /etc/passwd — a path that does not start with .. and thus bypasses the traversal check. The fix changes Template.__init__ to use lstrip("/") so both code paths handle leading slashes consistently (GitHub Advisory, Fix Commit). Exploitation requires that an application passes untrusted user input directly to TemplateLookup.get_template() without prior sanitization; HTTP-based exploitation may be partially mitigated by Python's BaseHTTPRequestHandler, which normalizes double-slash prefixes, but applications using other HTTP servers remain at risk (GitHub Advisory).

Impact

Successful exploitation allows an unauthenticated remote attacker to read any file accessible to the process running the Mako-based application, including sensitive configuration files, credentials, private keys, or application source code. The vulnerability has a high confidentiality impact with no integrity or availability impact. Exposed file contents are returned as rendered Mako template content, meaning template syntax within the file may also be executed (GitHub Advisory, Feedly).

Exploitability

No public proof-of-concept exploit or evidence of active in-the-wild exploitation has been reported as of the time of disclosure (Feedly). The CVSS v4.0 exploit maturity is rated "Proof of Concept," suggesting a PoC may exist in limited form. The EPSS score is approximately 0.046%, indicating a low probability of exploitation in the near term. The vulnerability is not listed in CISA's Known Exploited Vulnerabilities (KEV) catalog. The vulnerability was reported by researcher 0xHunSec (GitHub Advisory).

Exploitation steps

  1. Identify target: Locate a web application or service that uses Mako's TemplateLookup.get_template() and passes user-controlled input (e.g., a URL path parameter or query string) directly to this function without sanitization.
  2. Craft malicious URI: Construct a URI beginning with // followed by directory traversal sequences, such as //../../../../etc/passwd or //../../../app/config/secrets.py.
  3. Submit the request: Send the crafted URI to the application endpoint that invokes TemplateLookup.get_template(). This may be via an HTTP request parameter, API call, or any other input vector accepted by the application.
  4. Receive file contents: The application returns the contents of the targeted file rendered as a Mako template. If the file contains Mako template syntax, it may also be executed server-side.
  5. Escalate: Use exposed credentials, API keys, or configuration data to pivot to further system access or lateral movement (GitHub Advisory, Fix Commit).

Indicators of compromise

  • Network: HTTP requests containing URI parameters with double-slash prefixes and directory traversal sequences (e.g., //../../, //../); unusual requests to template-rendering endpoints with paths referencing system files like /etc/passwd, /etc/shadow, or application config files.
  • Logs: Application or web server access logs showing requests with encoded or literal // followed by ../ sequences in path or query parameters; error logs showing TemplateLookupException for blocked traversal attempts (indicating probing activity).
  • File System: No direct file system artifacts are created by this read-only vulnerability, but access timestamps on sensitive files (e.g., /etc/passwd, credential files) may be updated if the OS tracks atime.
  • Process: Unusual template rendering output containing contents of system files rather than expected HTML/template responses.

Mitigation and workarounds

Upgrade Mako to version 1.3.11 or later, which fixes the inconsistency by using lstrip("/") in Template.__init__ (Mako Release, Fix Commit). As a workaround where immediate upgrade is not possible, applications should validate and sanitize all user-supplied input before passing it to TemplateLookup.get_template(), rejecting URIs that begin with / or contain .. sequences. IBM Cloudera Data Platform Private Cloud Base users should refer to the IBM advisory for platform-specific remediation guidance (IBM Advisory). OpenSUSE and Ubuntu users should apply the distribution-provided package updates for python-Mako.

Community reactions

The vulnerability was disclosed via a GitHub Security Advisory by Mako maintainer zzzeek on April 15, 2026, crediting researcher 0xHunSec for the report (GitHub Advisory). The advisory notes an important nuance: HTTP-based exploitation is partially mitigated by Python's BaseHTTPRequestHandler normalizing double-slash prefixes, limiting real-world HTTP attack surface for some deployments. Multiple Linux distributions including openSUSE, Ubuntu, and Amazon Linux 2 issued security updates for the affected package, indicating broad ecosystem awareness and response.

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Affected

bookworm

mako

Affected

sid

mako

Affected

trixie

mako

Affected

SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-66455CRITICAL9.8
  • Python logoPython
  • lmdeploy
NoYesSep 18, 2026
CVE-2026-63374CRITICAL9.3
  • Python logoPython
  • python-anyio
NoYesSep 18, 2026
CVE-2026-59163CRITICAL9.1
  • Python logoPython
  • mnemosyne-memory
NoYesSep 18, 2026
CVE-2026-33625HIGH8.8
  • Python logoPython
  • lmdeploy
NoYesSep 18, 2026
CVE-2026-64847MEDIUM6.8
  • Python logoPython
  • litellm-1.90
NoYesSep 18, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management