chore(deps): update dependency mako to v1.3.12 [security]#969
Merged
Conversation
Contributor
Test Results 48 files + 30 48 suites +30 1h 41m 49s ⏱️ + 1h 33m 7s For more details on these errors, see this check. Results for commit 5f0d6cb. ± Comparison against base commit 03987a7. ♻️ This comment has been updated with latest results. |
zhindes
approved these changes
May 7, 2026
Collaborator
|
build.yml validated that upgrading Mako didn't affect the codegen output. This system test failure is not caused by the Mako upgrade: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
1.3.11→1.3.12Mako vulnerable to path traversal via backslash URI on Windows in TemplateLookup
CVE-2026-44307 / GHSA-2h4p-vjrc-8xpq
More information
Details
Summary
On Windows, a URI using backslash traversal (e.g.
\..\..\ secret.txt) bypasses the directory traversal check inTemplate.__init__and theposixpath-based normalization inTemplateLookup.get_template(), allowing reads of files outside the configured template directory.Details
The root cause is a mismatch between
posixpath(used for URI normalization inget_template()) andos.path(used for file access viaos.path.isfile()and validation viaos.path.normpath()inTemplate.__init__). On Windows,os.pathisntpath, which treats\as a path separator, whileposixpathtreats it as a literal character.The vulnerability chain:
get_template()strips only leading/viare.sub(r"^\/+", "", uri)and normalizes withposixpath— backslash\is treated as a literal character, so\..\ secret.txtpasses through with..undetected.Template.__init__()validation usesos.path.normpath()— on Windows this resolves\..\ secret.txtto\secret.txt, which does not start with.., so thestartswith("..")check passes.os.path.isfile()on Windows interprets\as a path separator, resolving the..traversal and finding files outside the template directory.Affected code
mako/lookup.py:TemplateLookup.get_template()usesposixpath.normpath/posixpath.joinfor path construction butos.path.isfile()for existence checkmako/template.py:Template.__init__()URI validation usesos.path.normpath()which on Windows resolves backslash traversal to a form that passes thestartswith("..")guardImpact
If an application passes user-controlled template names or include paths to
TemplateLookup.get_template(), an attacker on Windows may be able to load and disclose readable files outside the configured template directory. The primary impact is local file disclosure. If the targeted file contains Mako/Python template syntax, it may also be parsed and executed as a template.Remediation
The fix should normalize backslashes to forward slashes early in the URI processing pipeline, before any path operations, to ensure consistent behavior across platforms.
Severity
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:NReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
Configuration
📅 Schedule: (in timezone US/Central)
🚦 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.
This PR was generated by Mend Renovate. View the repository job log.