---
id: "CVE-2026-123806"
page: "https://infrastack.ai/live/CVE-2026-123806"
kind: "vulnerability"
aliases: ["CVE-2026-123806", "GHSA-qp9x-wp8f-qgjj"]
title: "tuf has platform-dependent delegation path matching"
severity: "medium"
cvss: 4.0
epss: null
exploited: false
status: "open"
category: "package"
products: [{"name": "tuf", "fixed": ["7.0.0"], "affected": "<= 6.0.0", "ecosystem": "pypi"}]
ecosystems: ["pypi"]
tags: ["cwe-178", "ngclient", "package", "python", "tuf", "windows"]
not_affected_if: ["linux-or-macos-only", "no-path-delegations", "tuf-7.0.0-or-later"]
published_at: "2026-05-28T22:46:13+00:00"
first_seen_at: "2026-11-09T20:23:06+00:00"
updated_at: "2026-11-09T20:24:25+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-qp9x-wp8f-qgjj", "first_seen_at": "2026-11-09T20:23:06+00:00"}]
exploit_sources: []
---

# tuf has platform-dependent delegation path matching

Link for people: https://infrastack.ai/live/CVE-2026-123806 (this .md is for agents)

On Windows, python-tuf's ngclient matches delegated target paths case-insensitively, while Linux and macOS match case-sensitively, so the same repository can authorize different targets depending on the client's operating system. An attacker who controls a delegated role with a case-differing path pattern placed earlier in the delegation order can get a target accepted on Windows clients.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- pypi:tuf affected <= 6.0.0 fixed 7.0.0

## How to check

- Check the installed `tuf` version with `pip show tuf` and compare it to the fixed range.
- Look for Windows hosts or CI runners that run python-tuf `ngclient` to update trusted metadata or targets.
- Review the repository's delegations for path patterns that differ only in letter case.

## Fix

- `tuf` moves to `7.0.0` (affected up to `6.0.0`). The upstream fix replaces `fnmatch.fnmatch` with `fnmatch.fnmatchcase`.

## Timeline

- 2026-11-09T20:23:06+00:00 ghsa https://github.com/advisories/GHSA-qp9x-wp8f-qgjj

## Documents

- [advisory] Maintainer's advisory: api.github.com https://api.github.com/repos/theupdateframework/python-tuf/security-advisories/GHSA-qp9x-wp8f-qgjj
- [advisory] Maintainer's advisory: github.com https://github.com/theupdateframework/python-tuf/security/advisories/GHSA-qp9x-wp8f-qgjj
- [fix] Release: github.com https://github.com/theupdateframework/python-tuf/releases/tag/v7.0.0

## From the sources

`DelegatedRole._is_target_in_pathpattern` 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 _is_target_in_pathpattern(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      target_parts = targetpath.split("/")
1189      pattern_parts = pathpattern.split("/")
1190      if len(target_parts) != len(pattern_parts):
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(target_parts, pattern_parts, 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

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
