Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. Mako
  4. ›
  5. CVE-2026-41205

CVE-2026-41205: Mako: Path traversal via double-slash URI prefix in TemplateLookup

April 16, 2026 (updated June 5, 2026)

TemplateLookup.get_template() is vulnerable to path traversal when a URI starts with // (e.g., //../../../secret.txt). The root cause is an inconsistency between two slash-stripping implementations:

  • Template.__init__ strips one leading / using if/slice
  • TemplateLookup.get_template() strips all leading / using re.sub(r"^\/+", "")

When a URI like //../../../../etc/passwd is passed:

  1. get_template() strips all / → ../../../../etc/passwd → file found via posixpath.join(dir_, u)
  2. Template.__init__ strips one / → /../../../../etc/passwd → normpath → /etc/passwd
  3. /etc/passwd.startswith(..) → False → check bypassed

References

  • github.com/advisories/GHSA-v92g-xgxw-vvmm
  • github.com/pypa/advisory-database/tree/main/vulns/mako/PYSEC-2026-88.yaml
  • github.com/sqlalchemy/mako/commit/e05ac61989a7fb9dd7dcde6cfd72dc48328719a3
  • github.com/sqlalchemy/mako/releases/tag/rel_1_3_11
  • github.com/sqlalchemy/mako/security/advisories/GHSA-v92g-xgxw-vvmm
  • nvd.nist.gov/vuln/detail/CVE-2026-41205

Code Behaviors & Features

Detect and mitigate CVE-2026-41205 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 1.3.11

Fixed versions

  • 1.3.11

Solution

Upgrade to version 1.3.11 or above.

Impact 7.5 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Learn more about CVSS

Weakness

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Source file

pypi/Mako/CVE-2026-41205.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:17:27 +0000.