A path traversal vulnerability exists in the Mako template engine on Windows. Specifically, when using the `TemplateLookup` URI with a drive designator (e.g., `C:/../../secret.txt` or `C:..//..//secret.txt`), the directory traversal check in `Template.__init__` can be bypassed. This allows reads of files outside the configured template directory. The root cause is a mismatch between `posixpath` and `os.path` (which is `ntpath` on Windows) in the Mako template engine. The `posixpath` module is used for path resolution, while `os.path` is used for confinement checks. This discrepancy allows a drive-letter URI to bypass the directory traversal check, potentially allowing reads of The
A path traversal vulnerability exists in Mako, a Python template library, prior to version 1.3.11. The vulnerability resides in `TemplateLookup.get_template()` when processing URIs beginning with double slashes (`//`). An inconsistency between two slash-stripping implementations allows attackers to bypass path normalization and traverse outside intended template directories. When applications pass untrusted input directly to `TemplateLookup.get_template()`, arbitrary files readable by the process can be returned as rendered template content. This represents a confidentiality breach without integrity or availability impact. The vulnerability was disclosed on 2026-04-23 and last modified on 2026-05-20. A fix is available in Mako 1.3.11.