Skip to content

Update dependency mako to v1.3.12 [SECURITY]#1323

Merged
JAVGan merged 1 commit into
masterfrom
renovate/pypi-mako-vulnerability
May 13, 2026
Merged

Update dependency mako to v1.3.12 [SECURITY]#1323
JAVGan merged 1 commit into
masterfrom
renovate/pypi-mako-vulnerability

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate Bot commented May 8, 2026

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
mako (source) ==1.3.11==1.3.12 age adoption passing confidence

Mako 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 in Template.__init__ and the posixpath-based normalization in TemplateLookup.get_template(), allowing reads of files outside the configured template directory.

Details

The root cause is a mismatch between posixpath (used for URI normalization in get_template()) and os.path (used for file access via os.path.isfile() and validation via os.path.normpath() in Template.__init__). On Windows, os.path is ntpath, which treats \ as a path separator, while posixpath treats it as a literal character.

The vulnerability chain:

  1. get_template() strips only leading / via re.sub(r"^\/+", "", uri) and normalizes with posixpath — backslash \ is treated as a literal character, so \..\ secret.txt passes through with .. undetected.
  2. Template.__init__() validation uses os.path.normpath() — on Windows this resolves \..\ secret.txt to \secret.txt, which does not start with .., so the startswith("..") check passes.
  3. 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() uses posixpath.normpath/posixpath.join for path construction but os.path.isfile() for existence check
  • mako/template.py: Template.__init__() URI validation uses os.path.normpath() which on Windows resolves backslash traversal to a form that passes the startswith("..") guard
Impact

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 Score: 8.7 / 10 (High)
  • Vector String: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/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 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 a review from a team May 8, 2026 17:36
@JAVGan JAVGan force-pushed the renovate/pypi-mako-vulnerability branch from c17675b to 06b7ea6 Compare May 13, 2026 18:02
@renovate renovate Bot force-pushed the renovate/pypi-mako-vulnerability branch from 06b7ea6 to c62e42d Compare May 13, 2026 18:02
@JAVGan JAVGan merged commit e7656da into master May 13, 2026
2 checks passed
@JAVGan JAVGan deleted the renovate/pypi-mako-vulnerability branch May 13, 2026 18:11
JAVGan added a commit that referenced this pull request May 13, 2026
Changes:

* Update dependency urllib3 to v2.7.0 [SECURITY] by @renovate[bot] in #1324
* Update dependency mako to v1.3.12 [SECURITY] by @renovate[bot] in #1323
* Update dependency python-qpid-proton to v0.40.0 by @renovate[bot] in #1318
* Update python Docker tag to v3.14.5 by @renovate[bot] in #1271
* Update dependency coverage to v7.14.0 by @renovate[bot] in #1326
* Update dependency googleapis-common-protos to v1.75.0 by @renovate[bot] in #1327

Refers to CLOUDDST-32605

Signed-off-by: Jonathan Gangi <jgangi@redhat.com>
@JAVGan JAVGan mentioned this pull request May 13, 2026
JAVGan added a commit that referenced this pull request May 13, 2026
Changes:

* Update dependency urllib3 to v2.7.0 [SECURITY] by @renovate[bot] in #1324
* Update dependency mako to v1.3.12 [SECURITY] by @renovate[bot] in #1323
* Update dependency python-qpid-proton to v0.40.0 by @renovate[bot] in #1318
* Update python Docker tag to v3.14.5 by @renovate[bot] in #1271
* Update dependency coverage to v7.14.0 by @renovate[bot] in #1326
* Update dependency googleapis-common-protos to v1.75.0 by @renovate[bot] in #1327
* Update dependency requests to v2.34.1 by @renovate[bot] in #1329
* Update dependency idna to v3.15 by @renovate[bot] in #1328

Refers to CLOUDDST-32605

Signed-off-by: Jonathan Gangi <jgangi@redhat.com>
JAVGan added a commit that referenced this pull request May 14, 2026
Changes:

* Update dependency urllib3 to v2.7.0 [SECURITY] by @renovate[bot] in #1324
* Update dependency mako to v1.3.12 [SECURITY] by @renovate[bot] in #1323
* Update dependency python-qpid-proton to v0.40.0 by @renovate[bot] in #1318
* Update python Docker tag to v3.14.5 by @renovate[bot] in #1271
* Update dependency coverage to v7.14.0 by @renovate[bot] in #1326
* Update dependency googleapis-common-protos to v1.75.0 by @renovate[bot] in #1327
* Update dependency requests to v2.34.1 by @renovate[bot] in #1329
* Update dependency idna to v3.15 by @renovate[bot] in #1328

Refers to CLOUDDST-32605

Signed-off-by: Jonathan Gangi <jgangi@redhat.com>
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