Skip to content

chore(deps): update dependency mako to v1.3.11 [security]#1301

Merged
bkeryan merged 1 commit intomainfrom
users/renovate/pypi-mako-vulnerability
Apr 17, 2026
Merged

chore(deps): update dependency mako to v1.3.11 [security]#1301
bkeryan merged 1 commit intomainfrom
users/renovate/pypi-mako-vulnerability

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate Bot commented Apr 17, 2026

This PR contains the following updates:

Package Change Age Confidence
Mako (source) 1.3.101.3.11 age confidence

GitHub Vulnerability Alerts

GHSA-v92g-xgxw-vvmm

Summary

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/passwdnormpath/etc/passwd
  3. /etc/passwd.startswith(..) → Falsecheck bypassed

Impact

Arbitrary file read: any file readable by the process can be returned as rendered template content when an application passes untrusted input directly to TemplateLookup.get_template().

Note: this is exploitable at the library API level. HTTP-based exploitation is mitigated by Python's BaseHTTPRequestHandler which normalizes double-slash prefixes since CPython gh-87389. Applications using other HTTP servers that do not normalize paths may be affected.

Fix

Changed Template.__init__ to use lstrip("/") instead of stripping only a single leading slash, so both code paths handle leading slashes consistently.

Severity
  • CVSS Score: 6.3 / 10 (Medium)
  • Vector String: CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N

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

GHSA-v92g-xgxw-vvmm

More information

Details

Summary

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/passwdnormpath/etc/passwd
  3. /etc/passwd.startswith(..) → Falsecheck bypassed
Impact

Arbitrary file read: any file readable by the process can be returned as rendered template content when an application passes untrusted input directly to TemplateLookup.get_template().

Note: this is exploitable at the library API level. HTTP-based exploitation is mitigated by Python's BaseHTTPRequestHandler which normalizes double-slash prefixes since CPython gh-87389. Applications using other HTTP servers that do not normalize paths may be affected.

Fix

Changed Template.__init__ to use lstrip("/") instead of stripping only a single leading slash, so both code paths handle leading slashes consistently.

Severity

  • CVSS Score: 6.3 / 10 (Medium)
  • Vector String: CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N

References

This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).


Configuration

📅 Schedule: (in timezone US/Central)

  • Branch creation
    • ""
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot requested review from bkeryan, csjall and dixonjoel as code owners April 17, 2026 00:04
@bkeryan bkeryan enabled auto-merge (squash) April 17, 2026 01:42
@bkeryan bkeryan merged commit cfa6d55 into main Apr 17, 2026
25 checks passed
@bkeryan bkeryan deleted the users/renovate/pypi-mako-vulnerability branch April 17, 2026 22:54
@github-actions
Copy link
Copy Markdown
Contributor

Test Results

    52 files  ±0      52 suites  ±0   1h 15m 51s ⏱️ -19s
   689 tests ±0     689 ✅ ±0      0 💤 ±0  0 ❌ ±0 
20 700 runs  ±0  19 644 ✅ ±0  1 056 💤 ±0  0 ❌ ±0 

Results for commit 8369c4e. ± Comparison against base commit d8979b4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant