{"schemaVersion":4,"id":"GHSA-QP9X-WP8F-QGJJ","aliases":[],"status":"published","duplicateOf":null,"title":null,"description":"tuf has platform-dependent delegation path matching\n\n`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","dates":{"published":"2026-05-28T22:46:13.000Z","modified":"2026-09-10T03:51:06.938Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":4,"severity":"medium","version":"3.1","versionLabel":"v3.1","source":"OSV · Pypi","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","computed":true,"selection":"version-preference"},"metrics":[{"version":"3.1","versionLabel":"v3.1","source":"OSV · Pypi","score":4,"severity":"medium","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","exploitability":6.4,"impact":2.3,"computed":true}]},"epss":{"probability":null,"percentile":null,"severity":"unknown","asOf":null,"change":{"pp":null,"baselineDate":null,"baselineScore":null},"history":[],"last30":[]},"kev":{"state":"not-listed","entries":[],"listedCount":0,"totalCatalogs":3,"catalogs":[{"source":"cisa","label":"CISA","listed":false,"entry":null},{"source":"enisa","label":"ENISA","listed":false,"entry":null},{"source":"circl","label":"CIRCL","listed":false,"entry":null}]},"ransomware":{"state":"none-recorded","sources":[]},"exploits":[],"exploitCount":0,"weaknesses":[],"affected":[{"vendor":"PyPI","product":"tuf","name":"tuf","label":"tuf","ecosystem":"PyPI","cpePart":null,"purl":"pkg:pypi/tuf","purlType":"pypi","versions":[{"text":"< 7.0.0","noFixRecorded":false,"fixedIn":null,"bounds":{"kind":"range","start":null,"startInclusive":true,"end":"7.0.0","endInclusive":false}}],"versionsText":"< 7.0.0","eol":null,"hubHref":null}],"affectedCount":1,"eol":{"hasEol":false,"count":0},"references":[{"url":"https://github.com/theupdateframework/python-tuf/security/advisories/GHSA-qp9x-wp8f-qgjj","label":"github.com/theupdateframework/python-tuf/security/advisories/GHSA-qp9x-wp8f-qgjj","hostname":"github.com","tags":["WEB"]},{"url":"https://github.com/theupdateframework/python-tuf","label":"github.com/theupdateframework/python-tuf","hostname":"github.com","tags":["PACKAGE"]},{"url":"https://github.com/theupdateframework/python-tuf/releases/tag/v7.0.0","label":"github.com/theupdateframework/python-tuf/releases/tag/v7.0.0","hostname":"github.com","tags":["WEB"]}],"lineage":{"upstream":[],"downstream":["CGA-227R-CG3F-5RVF","CGA-26RP-56VC-P32F","CGA-332J-9HC7-VPH9","CGA-3774-GXGJ-VRWW","CGA-39V4-J8VW-QJPR","CGA-442C-73Q8-V69C","CGA-4597-VV3G-QC2X","CGA-47R5-8GXW-8R7M","CGA-4WWX-666R-F6JH","CGA-5F57-R7J4-VQ59","CGA-5J33-P2RR-38MF","CGA-6QHH-2RQ5-4GF3","CGA-76C9-VJMP-GVQC","CGA-7RH2-PHMC-3MM6","CGA-8J2Q-FF75-4RFJ","CGA-8J9M-HVF8-83C3","CGA-8PR6-QHPR-PMXP","CGA-9X64-JF69-H6JQ","CGA-C59R-XW83-86VR","CGA-FWHG-3M8J-789F","CGA-H3Q5-9V22-8323","CGA-JCCH-PC3Q-5224","CGA-JGPM-FFJF-7X8V","CGA-JM9X-4W4J-4W5F","CGA-JP66-48R7-JV9H","CGA-MCP3-X3Q6-MR2M","CGA-MPF8-3GVG-VR8W","CGA-P3R5-2JG7-HG85","CGA-PP8J-WQCW-X7HC","CGA-PX8Q-MQ6X-FM7X","CGA-PXWX-PFCC-PC99","CGA-Q24C-9FRM-62RH","CGA-VC2H-495R-H5M9","CGA-W2QG-3339-G53W","CGA-W9G7-V3VX-2C4H","CGA-X3MX-FH5F-8WX3","CGA-X59P-56Q3-F7H3","CGA-X69J-89HF-QX4V","CGA-XPWM-HPH3-RG7J","CVE-2026-123806"],"duplicates":[],"related":["CGA-PPPR-98FR-2VJQ"]},"timeline":[{"kind":"published","date":"2026-05-28T22:46:13.000Z","label":"Published","detail":"Vulnerability first disclosed.","source":null},{"kind":"modified","date":"2026-09-10T03:51:06.938Z","label":"Last modified","detail":"Vulnerability information updated.","source":null}],"priority":{"label":"routine","tag":null,"reason":"Not severe (CVSS 4, local access); no exploitation reported by the 5 checked sources","nextStep":"Fix in the normal cadence","rank":[0,0,0,0,0,40],"checkedSources":["cisa","enisa","circl","shadowserver","cisa-adp"],"evidence":[{"type":"cvss","source":"osv_pypi","date":"2026-09-10T03:51:06.938Z","status":"valid","statusDate":null,"statusSource":null,"disputes":[],"score":4,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","version":"3.1","headline":true}],"epss":{"value":null,"date":null,"stale":false,"promoted":null},"sources":[{"id":"cisa","lastSuccessfulSync":"2026-12-05T10:02:10.250Z","state":"fresh"},{"id":"enisa","lastSuccessfulSync":"2026-12-05T10:02:10.837Z","state":"fresh"},{"id":"circl","lastSuccessfulSync":"2026-12-05T10:02:11.033Z","state":"fresh"},{"id":"shadowserver","lastSuccessfulSync":null,"state":"unavailable"},{"id":"cisa-adp","lastSuccessfulSync":"2026-12-05T10:01:03.214Z","state":"fresh"},{"id":"epss","lastSuccessfulSync":"2026-12-05T10:02:08.667Z","state":"fresh"},{"id":"osv","lastSuccessfulSync":"2026-12-05T10:02:07.694Z","state":"fresh"}],"feedEvent":null},"meta":{"dataAsOf":"2026-12-05T10:55:56.627Z","stale":false,"partial":false}}