CVE-2026-123806: tuf has platform-dependent delegation path matching

Published May 28, 2026
·
Updated

DelegatedRole.istargetinpathpattern uses fnmatch.fnmatch to decide whether a given target path is authorized by a delegation's glob pattern.

Python's fnmatch.fnmatch calls os.path.normcase() on both arguments before matching. On POSIX hosts normcase is the identity function; on Windows hosts os.path resolves to ntpath, whose normcase lowercases its input and replaces / with \.

As a result, python-tuf's delegation path pattern matching is case-sensitive on Linux/macOS but case-INSENSITIVE on Windows. This makes the authorization decision for a target dependent on the host operating system of the client running the updater.

The result on Windows is a TUF specification violation in the python-tuf ngclient implementation.

Vulnerable code

tuf/api/payload.py (HEAD 7ecb67d):

python 1183 @staticmethod 1184 def istargetinpathpattern(targetpath: str, pathpattern: str) -> bool: 1185 """Determine whether targetpath matches the pathpattern.""" 1186 # We need to make sure that targetpath and pathpattern are pointing to 1187 # the same directory as fnmatch doesn't threat "/" as a special symbol. 1188 targetparts = targetpath.split("/") 1189 patternparts = pathpattern.split("/") 1190 if len(targetparts) != len(patternparts): 1191 return False 1192 1193 # Every part in the pathpattern could include a glob pattern, that's why 1194 # each of the target and pathpattern parts should match. 1195 for target, pattern in zip(targetparts, patternparts, strict=True): 1196 if not fnmatch.fnmatch(target, pattern): 1197 return False 1198 return True

fnmatch.fnmatch source (Python 3.12, unchanged in current mainline):

python def fnmatch(name, pat): ... name = os.path.normcase(name) pat = os.path.normcase(pat) return fnmatchcase(name, pat)

Fix

Replace fnmatch.fnmatch with fnmatch.fnmatchcase, which is explicitly documented as "not applying case normalization", so it behaves identically across platforms.

Attack

1. A TUF repository with two path-based delegations whose patterns differ only in case — for example, Foo/ and foo/. 2. The "attacker" delegation is listed BEFORE the "legit" delegation in the delegation order. 3. The client searches for foo/something: on Windows, it will find the "attacker" provided target "Foo/something".

Exploitability caveats

The attack needs a repository configuration with case-colliding delegation path patterns. The attacker must control one of the delegated roles. Delegation ordering matters: the attacker-controlled role must be visited BEFORE the legit role in the pre-order walk. The client must run on Windows. No effect on Linux/macOS.

Credit

Reporter: Koda Reef @kodareef5 Advisory edits: Jussi Kukkonen @jku

Other sources

python-tuf is a Python reference implementation of The Update Framework (TUF). Prior to 7.0.0, DelegatedRole.istargetinpathpattern in tuf/api/payload.py uses fnmatch.fnmatch, which applies os.path.normcase before matching and makes delegation path authorization case-insensitive on Windows. When a TUF repository has path-based delegations that differ only by case and an attacker-controlled role is visited before the legitimate role, ngclient can accept an attacker-provided target from the wrong delegation for a requested path. Linux and macOS clients are not affected because their path normalization does not change case. This issue is fixed in 7.0.0.

— MITRE

Affected Software

2 affected componentsFixes available
pypi/python-tuf<7.0.0
pip/tuf<7.0.0
7.0.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/tuf to a version that resolves this vulnerability.

    Fixed in 7.0.0
  2. Upgrade

    Upgrade python-tuf to a version that resolves this vulnerability.

    Fixed in 7.0.0

Event History

May 28, 2026
Advisory Published
via OSV·10:46 PM
Data Sourced
via OSV·10:46 PM
DescriptionSeverityWeaknessAffected Software
Nov 9, 2026
CVE Published
via MITRE·08:18 PM
Data Sourced
via MITRE·08:18 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·10:18 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which clients are affected?

Only ngclient running on Windows is affected. Linux and macOS clients are not affected because their path normalization does not change case.

2

What repository configuration and attacker position are required for exploitation?

The repository must use path-based delegations that differ only by case. An attacker-controlled delegated role must be visited before the legitimate role and provide a target for the requested path.

3

How can the issue be remediated?

Upgrade python-tuf to version 7.0.0, which fixes the delegation path matching behavior.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203