{"id":"CVE-2026-123806","aliases":["GHSA-qp9x-wp8f-qgjj"],"title":"tuf has platform-dependent delegation path matching","titleSource":"OSV","descriptionSource":"OSV","declaredSeverity":"MODERATE","description":"`DelegatedRole._is_target_in_pathpattern` uses `fnmatch.fnmatch` to decide whether a given target path is authorized by a delegation's glob pattern.\n\nPython'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 `\\`.\n\nAs 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.\n\nThe result on Windows is a TUF specification violation in the python-tuf `ngclient` implementation.\n\n## Vulnerable code\n\n`tuf/api/_payload.py` (HEAD `7ecb67d`):\n\n```python\n1183  @staticmethod\n1184  def _is_target_in_pathpattern(targetpath: str, pathpattern: str) -> bool:\n1185      \"\"\"Determine whether ``targetpath`` matches the ``pathpattern``.\"\"\"\n1186      # We need to make sure that targetpath and pathpattern are pointing to\n1187      # the same directory as fnmatch doesn't threat \"/\" as a special symbol.\n1188      target_parts = targetpath.split(\"/\")\n1189      pattern_parts = pathpattern.split(\"/\")\n1190      if len(target_parts) != len(pattern_parts):\n1191          return False\n1192\n1193      # Every part in the pathpattern could include a glob pattern, that's why\n1194      # each of the target and pathpattern parts should match.\n1195      for target, pattern in zip(target_parts, pattern_parts, strict=True):\n1196          if not fnmatch.fnmatch(target, pattern):\n1197              return False\n1198      return True\n```\n\n`fnmatch.fnmatch` source (Python 3.12, unchanged in current mainline):\n\n```python\ndef fnmatch(name, pat):\n    ...\n    name = os.path.normcase(name)\n    pat = os.path.normcase(pat)\n    return fnmatchcase(name, pat)\n```\n\n## Fix\n\nReplace `fnmatch.fnmatch` with `fnmatch.fnmatchcase`, which is explicitly documented as \"not applying case normalization\", so it behaves identically across platforms.\n\n## Attack\n\n1. A TUF repository with two path-based delegations whose patterns differ only in case — for example, `Foo/*` and `foo/*`.\n2. The \"attacker\" delegation is listed BEFORE the \"legit\" delegation in the delegation order.\n3. The client searches for `foo/something`: on Windows, it will find the \"attacker\" provided target \"Foo/something\".\n\n\n## Exploitability caveats \n\n* The attack needs a repository configuration with case-colliding delegation path patterns. The attacker must control one of the delegated roles.\n* Delegation ordering matters: the attacker-controlled role must be visited BEFORE the legit role in the pre-order walk.\n* The client must run on Windows. No effect on Linux/macOS.\n\n## Credit\n\nReporter: Koda Reef @kodareef5 \nAdvisory edits: Jussi Kukkonen @jku","severity":"medium","score":4,"published":"2026-05-28T22:46:13.000Z","modified":"2026-11-13T13:09:54.700Z","withdrawn":false,"knownExploited":false,"affected":[{"ecosystem":"PyPI","name":"tuf","sources":[{"name":"OSV · GHSA-qp9x-wp8f-qgjj","url":"https://osv.dev/vulnerability/GHSA-qp9x-wp8f-qgjj"}],"ranges":[{"events":[{"introduced":"0"},{"fixed":"7.0.0"}],"type":"ECOSYSTEM"}],"versions":["0.10.0","0.10.1","0.10.2","0.11.0","0.11.1","0.11.2.dev1","0.11.2.dev2","0.11.2.dev3","0.11.dev0","0.12.0","0.12.1","0.12.2","0.12.dev0","0.12.dev1","0.12.dev2","0.13.0","0.14.0","0.15.0","0.16.0","0.17.0","0.18.0","0.18.1","0.19.0","0.20.0","0.7.5","0.9.8","0.9.9","1.0.0","1.1.0","2.0.0","2.1.0","3.0.0","3.1.0","3.1.1","4.0.0","5.0.0","5.1.0","6.0.0"],"fixed":["7.0.0"]}],"sourceAffected":[],"references":["https://github.com/theupdateframework/python-tuf/security/advisories/GHSA-qp9x-wp8f-qgjj","https://github.com/theupdateframework/python-tuf","https://github.com/theupdateframework/python-tuf/releases/tag/v7.0.0","https://github.com/theupdateframework/python-tuf/commit/8ed4414946041030b264871ac41b929cf15774a5"],"sources":[{"name":"OSV","id":"GHSA-qp9x-wp8f-qgjj","modified":"2026-11-09T20:30:04.187065120Z","url":"https://osv.dev/vulnerability/GHSA-qp9x-wp8f-qgjj"},{"name":"CVE","id":"CVE-2026-123806","modified":"2026-11-13T13:09:54.700Z","url":"https://www.cve.org/CVERecord?id=CVE-2026-123806"}],"assessments":[{"source":"OSV","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":4},{"source":"GitHub_M","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":4}],"cve":{"records":[{"id":"CVE-2026-123806","source":"GitHub_M","state":"PUBLISHED","reasons":[],"replacements":[],"disputed":false,"unsupportedWhenAssigned":false,"reserved":"2026-11-06T15:27:56.226Z","published":"2026-11-09T20:18:45.481Z","modified":"2026-11-13T13:09:54.700Z"}],"publishers":[{"name":"GitHub_M","role":"CNA","organizationId":"a0819718-46f1-4df5-94e2-005712e83aaa","modified":"2026-11-09T20:18:45.481Z"},{"name":"CISA-ADP","role":"ADP","organizationId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","modified":"2026-11-13T13:09:54.700Z"}],"references":[{"url":"https://github.com/theupdateframework/python-tuf/security/advisories/GHSA-qp9x-wp8f-qgjj","tags":["x_refsource_CONFIRM"],"source":"GitHub_M"},{"url":"https://github.com/theupdateframework/python-tuf/commit/8ed4414946041030b264871ac41b929cf15774a5","tags":["x_refsource_MISC"],"source":"GitHub_M"},{"url":"https://github.com/theupdateframework/python-tuf/releases/tag/v7.0.0","tags":["x_refsource_MISC"],"source":"GitHub_M"}],"weaknesses":[{"id":"CWE-178","description":"CWE-178: Improper Handling of Case Sensitivity","source":"GitHub_M"}],"applicability":[],"prioritization":[{"source":"CISA-ADP","type":"SSVC","role":"CISA Coordinator","timestamp":"2026-11-13T13:09:37.342304Z","decisions":[{"name":"Exploitation","value":"none"},{"name":"Automatable","value":"no"},{"name":"Technical Impact","value":"partial"}]}]},"products":[{"vendor":"theupdateframework","name":"python-tuf","platforms":[],"versions":[{"version":"< 7.0.0","status":"affected"}],"cpes":[],"source":"GitHub_M","url":"https://www.cve.org/CVERecord?id=CVE-2026-123806"}],"remediation":[],"observedAt":"2026-11-13T18:03:17.667Z","kev":{"status":"not-listed","checkedAt":"2026-11-15T03:30:31.194Z"},"coverage":[{"source":"NVD","status":"no-result","checkedAt":"2026-11-09T20:40:33.363Z","attemptedAt":"2026-11-09T20:40:33.363Z"},{"source":"GHSA","status":"available","checkedAt":"2026-11-09T20:40:33.363Z","attemptedAt":"2026-11-09T20:40:33.363Z"},{"source":"EUVD","status":"no-result","checkedAt":"2026-11-09T20:40:32.738Z","attemptedAt":"2026-11-09T20:40:32.738Z"},{"source":"EPSS","status":"no-result","checkedAt":"2026-11-09T20:40:32.353Z","attemptedAt":"2026-11-09T20:40:32.353Z"}],"evidence":[{"source":"GitHub Advisory Database","id":"GHSA-qp9x-wp8f-qgjj","url":"https://github.com/advisories/GHSA-qp9x-wp8f-qgjj","modified":"2026-11-09T20:18:56Z","score":4,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","checkedAt":"2026-11-09T20:40:33.363Z"}],"aiSummary":null}