Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. Mako
  4. ›
  5. GHSA-v92g-xgxw-vvmm

GHSA-v92g-xgxw-vvmm: Mako: Path traversal via double-slash URI prefix in TemplateLookup

April 16, 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/sqlalchemy/mako
  • github.com/sqlalchemy/mako/security/advisories/GHSA-v92g-xgxw-vvmm

Code Behaviors & Features

Detect and mitigate GHSA-v92g-xgxw-vvmm with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 1.3.11

Fixed versions

  • 1.3.11

Solution

Upgrade to version 1.3.11 or above.

Impact 5.3 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/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/GHSA-v92g-xgxw-vvmm.yml

Spotted a mistake? Edit the file on GitLab.

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

Page generated Sat, 09 May 2026 12:18:38 +0000.