Repository navigation
chore(deps): update dependency mako to v1.4.2 [security] - #364
Open
red-hat-konflux-kflux-prd-rh02[bot] wants to merge 1 commit into
Open
red-hat-konflux-kflux-prd-rh02[bot] wants to merge 1 commit into
red-hat-konflux-kflux-prd-rh02[bot] wants to merge 1 commit into
Conversation
red-hat-konflux-kflux-prd-rh02
Bot
requested review from
IlonaShishov,
dmartinol,
luis5tb and
yuvalk
as code owners
October 6, 2026 04:02
red-hat-konflux-kflux-prd-rh02
Bot
force-pushed
the
konflux/mintmaker/main/pypi-mako-vulnerability
branch
4 times, most recently
from
October 13, 2026 08:03
719f448 to
5b131ef
Compare
red-hat-konflux-kflux-prd-rh02
Bot
force-pushed
the
konflux/mintmaker/main/pypi-mako-vulnerability
branch
3 times, most recently
from
October 21, 2026 16:02
68b0a77 to
d2e00ac
Compare
red-hat-konflux-kflux-prd-rh02
Bot
force-pushed
the
konflux/mintmaker/main/pypi-mako-vulnerability
branch
5 times, most recently
from
October 28, 2026 16:02
ab0c6c1 to
d822b28
Compare
red-hat-konflux-kflux-prd-rh02
Bot
force-pushed
the
konflux/mintmaker/main/pypi-mako-vulnerability
branch
3 times, most recently
from
November 3, 2026 16:02
0810ce8 to
c1790c1
Compare
red-hat-konflux-kflux-prd-rh02
Bot
force-pushed
the
konflux/mintmaker/main/pypi-mako-vulnerability
branch
from
November 10, 2026 08:03
c1790c1 to
04233ec
Compare
Signed-off-by: red-hat-konflux-kflux-prd-rh02 <190377777+red-hat-konflux-kflux-prd-rh02[bot]@users.noreply.github.com>
red-hat-konflux-kflux-prd-rh02
Bot
force-pushed
the
konflux/mintmaker/main/pypi-mako-vulnerability
branch
from
November 10, 2026 12:02
04233ec to
37e6c0f
Compare
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.4.1→==1.4.2Mako: Path traversal via drive-letter URI on Windows in TemplateLookup
CVE-2026-102991 / GHSA-5639-2j2p-m4mx / PYSEC-2026-4243
More information
Details
Summary
On Windows, a
TemplateLookupURI beginning with a drive designator (e.g.C:/../../secret.txtorC:\..\..\secret.txt) bypasses the directory traversal check inTemplate.__init__, allowing reads of files outside the configured template directory.This is a third, independent instance of the root cause behind CVE-2026-41205 (the
//prefix) and CVE-2026-44307 (the backslash form). Both of those fixes normalized a separator spelling. Neither addressed the other wayposixpathandntpathdisagree: the drive designator. Both prior fixes remain effective on their own terms; this variant survives them for an independent reason.Details
The root cause is the same
posixpath/os.pathmismatch: resolution is done withposixpath, confinement is checked withos.path, which isntpathon Windows.posixpathhas no concept of a drive, so it treatsC:as an ordinary path component; the..segments popC:and then escape the template root.ntpath, by contrast, splits the drive off and treats the remainder as rooted, discarding the..entirely -- so the guard on line 269 inspects a string from which the evidence has already been removed:ntpath.normpath(what the guard sees)//../secret.txt..\secret.txt\..\secret.txt..\secret.txtC:/../../secret.txtC:\secret.txtBecause the guard cannot fire for any URI beginning with a single-letter drive designator, the traversal is unconstrained, and its depth does not have to be guessed.
posixpath.normpath()saturates excess..segments at the root rather than erroring, so a URI carrying more..than the template root is deep reaches the volume root and descends from there. A single fixed payload therefore works regardless of where the template directory sits:On Windows the equivalent is
C:/../../../../../../../../Windows/win.ini, which reads that file for any template root depth. Only a target addressed relative to the template root needs the..count to be exact; anything reachable from the volume root does not.Affected code
mako/template.py:Template.__init__()URI validation usesos.path.normpath(), which on Windows strips the drive and discards the..segments before thestartswith("..")guard is applied.mako/lookup.py:TemplateLookup.get_template()resolves withposixpath.normpath/posixpath.join, whereC:is an ordinary component, then performs the existence check withos.path.isfile().Reproduction
Windows is emulated with the technique already used by the project's own test suite (
test/test_template.py:1398-1401):Against 1.4.1, with a sentinel file written outside the configured directory:
On POSIX the same URIs are refused, because
posixpath.normpathkeepsC:as an ordinary component and the..survive to be inspected. The issue is Windows-only.Note that
d:/../../../secret.txtresolves relative to the template root, not to driveD:-- this is not a cross-drive read. Reaching another drive would require a leading.., whichntpath.normpathrenders as..\..\D:\xand the existing guard catches.Impact
If an application on Windows passes user-controlled template names or include paths to
TemplateLookup.get_template(), an attacker may load and disclose any file readable by the application process on the same volume as the template directory, not merely files adjacent to it. 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.As with CVE-2026-41205, the URI is not generally reachable through a raw URL path, since a conforming URL normalizer collapses
C:/../..first. The relevant vectors are query strings, form and JSON bodies, route parameters, and<%include file="${...}"/>.Remediation
Normalize both sides with the same module. The resolution side already commits to
posixpath, so the confinement check should as well:This closes the drive case for the same reason it closes
//:posixpathtreatsC:as an ordinary component, so the..segments survive to be inspected. Verified to block all three drive forms with the full test suite passing.Credit
Reported by Eurico Nicacio under coordinated disclosure.
Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:NReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
Mako: Path traversal via drive-letter URI on Windows in TemplateLookup
CVE-2026-102991 / GHSA-5639-2j2p-m4mx / PYSEC-2026-4243
More information
Details
Summary
On Windows, a
TemplateLookupURI beginning with a drive designator (e.g.C:/../../secret.txtorC:\..\..\secret.txt) bypasses the directory traversal check inTemplate.__init__, allowing reads of files outside the configured template directory.This is a third, independent instance of the root cause behind CVE-2026-41205 (the
//prefix) and CVE-2026-44307 (the backslash form). Both of those fixes normalized a separator spelling. Neither addressed the other wayposixpathandntpathdisagree: the drive designator. Both prior fixes remain effective on their own terms; this variant survives them for an independent reason.Details
The root cause is the same
posixpath/os.pathmismatch: resolution is done withposixpath, confinement is checked withos.path, which isntpathon Windows.posixpathhas no concept of a drive, so it treatsC:as an ordinary path component; the..segments popC:and then escape the template root.ntpath, by contrast, splits the drive off and treats the remainder as rooted, discarding the..entirely -- so the guard on line 269 inspects a string from which the evidence has already been removed:ntpath.normpath(what the guard sees)//../secret.txt..\secret.txt\..\secret.txt..\secret.txtC:/../../secret.txtC:\secret.txtBecause the guard cannot fire for any URI beginning with a single-letter drive designator, the traversal is unconstrained, and its depth does not have to be guessed.
posixpath.normpath()saturates excess..segments at the root rather than erroring, so a URI carrying more..than the template root is deep reaches the volume root and descends from there. A single fixed payload therefore works regardless of where the template directory sits:On Windows the equivalent is
C:/../../../../../../../../Windows/win.ini, which reads that file for any template root depth. Only a target addressed relative to the template root needs the..count to be exact; anything reachable from the volume root does not.Affected code
mako/template.py:Template.__init__()URI validation usesos.path.normpath(), which on Windows strips the drive and discards the..segments before thestartswith("..")guard is applied.mako/lookup.py:TemplateLookup.get_template()resolves withposixpath.normpath/posixpath.join, whereC:is an ordinary component, then performs the existence check withos.path.isfile().Reproduction
Windows is emulated with the technique already used by the project's own test suite (
test/test_template.py:1398-1401):Against 1.4.1, with a sentinel file written outside the configured directory:
On POSIX the same URIs are refused, because
posixpath.normpathkeepsC:as an ordinary component and the..survive to be inspected. The issue is Windows-only.Note that
d:/../../../secret.txtresolves relative to the template root, not to driveD:-- this is not a cross-drive read. Reaching another drive would require a leading.., whichntpath.normpathrenders as..\..\D:\xand the existing guard catches.Impact
If an application on Windows passes user-controlled template names or include paths to
TemplateLookup.get_template(), an attacker may load and disclose any file readable by the application process on the same volume as the template directory, not merely files adjacent to it. 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.As with CVE-2026-41205, the URI is not generally reachable through a raw URL path, since a conforming URL normalizer collapses
C:/../..first. The relevant vectors are query strings, form and JSON bodies, route parameters, and<%include file="${...}"/>.Remediation
Normalize both sides with the same module. The resolution side already commits to
posixpath, so the confinement check should as well:This closes the drive case for the same reason it closes
//:posixpathtreatsC:as an ordinary component, so the..segments survive to be inspected. Verified to block all three drive forms with the full test suite passing.Credit
Reported by Eurico Nicacio under coordinated disclosure.
Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:NReferences
This data is provided by OSV and the PyPI Advisory Database (CC-BY 4.0).
Configuration
📅 Schedule: (UTC)
🚦 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 this update again.
To execute skipped test pipelines write comment
/ok-to-test.Documentation
Find out how to configure dependency updates in MintMaker documentation or see all available configuration options in Renovate documentation.