Skip to content

Update dependency Mako to v1.3.11 [SECURITY]#12185

Open
renovate[bot] wants to merge 1 commit intodevelopfrom
renovate/pypi-mako-vulnerability
Open

Update dependency Mako to v1.3.11 [SECURITY]#12185
renovate[bot] wants to merge 1 commit intodevelopfrom
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.10==1.3.11 age confidence
mako (source) ==1.3.10==1.3.11 age confidence

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

CVE-2026-41205 / 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 the GitHub Advisory Database (CC-BY 4.0).


Configuration

📅 Schedule: (UTC)

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

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

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates 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 changed the title Update dependency Mako to v1.3.11 [SECURITY] Update dependency Mako to v1.3.11 [SECURITY] - abandoned Apr 27, 2026
@renovate
Copy link
Copy Markdown
Contributor Author

renovate Bot commented Apr 27, 2026

Autoclosing Skipped

This PR has been flagged for autoclosing. However, it is being skipped due to the branch being already modified. Please close/delete it manually or report a bug if you think this is in error.

@renovate renovate Bot changed the title Update dependency Mako to v1.3.11 [SECURITY] - abandoned Update dependency Mako to v1.3.11 [SECURITY] Apr 27, 2026
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.

0 participants