Vulnerabilities in pkg:pypi/tuf

PACKAGE
Advisory Summary

GHSA-qp9x-wp8f-qgjj is a MODERATE (CVSS 4.0) tuf has platform-dependent delegation path vulnerability (CWE-178: Improper Handling of Case Sensitivity) affecting Tuf libraries in the PyPI ecosystem. The issue involves tuf has platform-dependent delegation path matching. Remediation is available by upgrading affected packages to version 7.0.0.

7 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/tuf

7 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/tuf. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-qp9x-wp8f-qgjj - MODERATE tuf has platform-dependent delegation path matching
GHSA-wjw6-2cqr-j4qr CVE-2021-41131 MODERATE Client metadata path-traversal
GHSA-f8mr-jv2c-v8mg CVE-2020-15163 MODERATE Invalid root may become trusted root in The Update Framework (TUF)
GHSA-pwqf-9h7j-7mv8 CVE-2020-6174 CRITICAL Incorrect threshold signature computation in TUF
GHSA-2828-9vh6-9m6j CVE-2020-6173 MODERATE Client Denial of Service on TUF
GHSA-77hh-43cm-v8j6 - LOW tuf's Metadata API: Targets.get_delegated_role() is missing input validation
GHSA-r7vq-6425-j94w - LOW Python-TUF vulnerable to incorrect threshold signature computation for new root metadata

GHSA-qp9x-wp8f-qgjj at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-qp9x-wp8f-qgjj
Severity MODERATE
CVSS v3.1 Base Score 4.0
CWE Classification CWE-178: Improper Handling of Case Sensitivity
Affected Product Tuf
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 4.0

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix GHSA-qp9x-wp8f-qgjj

To remediate this vulnerability, upgrade all affected Tuf dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

tuf fixed: 7.0.0
pip install tuf>=7.0.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show tuf

How to Check if You Are Affected

To determine whether your Python environment is affected by GHSA-qp9x-wp8f-qgjj, inspect your installed packages using pip:

pip show tuf

Analyze the terminal output to locate any version of Tuf in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 7.0.0), your application is affected.

Note: The pip show tuf command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-178: Improper Handling of Case Sensitivity, where the product does not properly account for differences in case sensitivity when accessing or determining the properties of a resource, leading to inconsistent results. In Tuf, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

`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

GHSA-qp9x-wp8f-qgjj Affected Tuf Versions

1 component(s)
Fixed Versions:
7.0.0
Product / Package Ecosystem Affected Versions Fixed Version
tuf
PyPI
< 7.0.0
7.0.0

References

Frequently Asked Questions

What is GHSA-qp9x-wp8f-qgjj?
GHSA-qp9x-wp8f-qgjj is a security vulnerability in Tuf involving tuf has platform-dependent delegation path matching under CWE-178: Improper Handling of Case Sensitivity.
Which Tuf versions are affected?
Affected versions include releases prior to 7.0.0 across affected packages: tuf.
What version fixes GHSA-qp9x-wp8f-qgjj?
Upgrading to 7.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is tuf affected?
Yes, tuf is affected in releases prior to 7.0.0. Upgrade your dependency to 7.0.0 or later.
What is the CVSS score of GHSA-qp9x-wp8f-qgjj?
GHSA-qp9x-wp8f-qgjj has a CVSS v3.1 base score of 4.0 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with GHSA-qp9x-wp8f-qgjj?
GHSA-qp9x-wp8f-qgjj is classified under CWE-178: Improper Handling of Case Sensitivity (The product does not properly account for differences in case sensitivity when accessing or determining the properties of a resource, leading to inconsistent results.).
How can I check PyPI dependencies for GHSA-qp9x-wp8f-qgjj?
Run the dependency tree command: 'pip show tuf'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-qp9x-wp8f-qgjj",
  "modified" : "2026-05-28T22:46:13Z",
  "published" : "2026-05-28T22:46:13Z",
  "aliases" : [ ],
  "summary" : "tuf has platform-dependent delegation path matching",
  "details" : "`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" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "tuf"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "7.0.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 6.0.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/theupdateframework/python-tuf/security/advisories/GHSA-qp9x-wp8f-qgjj"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/theupdateframework/python-tuf"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/theupdateframework/python-tuf/releases/tag/v7.0.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-178" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-28T22:46:13Z",
    "nvd_published_at" : null
  }
}