GHSA-77hh-43cm-v8j6: tuf's Metadata API Targets.get_delegated_role() Is Missing Input Validation Vulnerability

LOW
Published
Advisory Summary

GHSA-77hh-43cm-v8j6 is a LOW targets.get_delegated_role() is missing input validation vulnerability (General Security Weakness) affecting tuf's Metadata API libraries in the PyPI ecosystem. The issue involves targets.get_delegated_role() is missing input validation. Remediation is available by upgrading affected packages to version 3.1.1.

GHSA-77hh-43cm-v8j6 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-77hh-43cm-v8j6
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product tuf's Metadata API
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix GHSA-77hh-43cm-v8j6

To remediate this vulnerability, upgrade all affected tuf's Metadata API 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: 3.1.1
pip install tuf>=3.1.1
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-77hh-43cm-v8j6, inspect your installed packages using pip:

pip show tuf

Analyze the terminal output to locate any version of tuf's Metadata API in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.1.1), 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 General Security Weakness. In tuf's Metadata API, 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

The security of both a TUF client and repository implementations depend on the concept of trusted Metadata objects verifying the signatures over other Metadata that it delegates to. This verification process uses `Targets.get_delegated_role(delegated_role: str)` to find the delegation information. `tuf.api.metadata.Targets.get_delegated_role()` should ensure that the given `delegated_rolename` is actually a name of a role that is delegated by that Targets, but in the case of "succinct delegation" this does not happen. `tuf.ngclient` users are **not** impacted but direct users of `tuf.api.metadata` could be impacted. ### Impact If an attacker can make a Metadata API user run `Targets.get_delegated_role()` so that 1. the `Targets` uses succinct delegation 1. the `delegated_role` argument is not actually delegated by the `Targets` the result will be incorrect. This also means that if an attacker can make a Metadata API user run `Targets.verify_delegate()` or `Targets.get_verification_result()` so that 1. the delegating `Targets` uses a succinct delegation 1. the `delegated_role` argument is the name of some unrelated Metadata 1. that other Metadata is correctly signed by the keys defined in the succinct delegation the result would be a successful verification even though the `Targets` in question does not actually delegate to `delegated_role`. The impact is estimated to be low for following reasons: * This cannot impact a TUF client that implements the client workflow as specified since the delegated role name is not an input but is collected from the (trusted) delegating Targets itself * Actual signature verification is not bypassed: The verified metadata _must_ still be correctly signed by the keys specified in the delegating role. * The described situations are somewhat hypothetical: there does not seem to be any reason for a python-tuf user (whether client or a repository) to use `tuf.api.metadata` in this way. All users of `tuf.ngclient` are specifically **not** impacted. Users of `tuf.api.metadata` could be impacted if they use succinct delegations in a way described above. ### Patches A fix is available in python-tuf 3.1.1 as commit 77cb66bc and in later releases as commit eb4834d9._ ### Workarounds `tuf.api.metadata` users should only call `Targets.get_delegated_role()`, `Targets.verify_delegate()` or `Targets.get_verification_result()` with `delegated_role` argument that is known to be delegated by the `Targets` in question.

GHSA-77hh-43cm-v8j6 Affected tuf's Metadata API Versions

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

References

Frequently Asked Questions

What is GHSA-77hh-43cm-v8j6?
GHSA-77hh-43cm-v8j6 is a security vulnerability in tuf's Metadata API involving Targets.get_delegated_role() is missing input validation under General Security Weakness.
Which tuf's Metadata API versions are affected?
Affected versions include releases prior to 3.1.1 across affected packages: tuf.
What version fixes GHSA-77hh-43cm-v8j6?
Upgrading to 3.1.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is tuf affected?
Yes, tuf is affected in releases prior to 3.1.1. Upgrade your dependency to 3.1.1 or later.
What CWE is associated with GHSA-77hh-43cm-v8j6?
GHSA-77hh-43cm-v8j6 is classified under General Security Weakness.
How can I check PyPI dependencies for GHSA-77hh-43cm-v8j6?
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-77hh-43cm-v8j6",
  "modified" : "2024-02-16T23:35:39Z",
  "published" : "2024-02-16T23:35:39Z",
  "aliases" : [ ],
  "summary" : "tuf's Metadata API:  Targets.get_delegated_role() is missing input validation",
  "details" : "The security of both a TUF client and repository implementations depend on the concept of trusted Metadata objects verifying the signatures over other Metadata that it delegates to. This verification process uses `Targets.get_delegated_role(delegated_role: str)` to find the delegation information.\n\n`tuf.api.metadata.Targets.get_delegated_role()` should ensure that the given `delegated_rolename` is actually a name of a role that is delegated by that Targets, but in the case of \"succinct delegation\" this does not happen.\n\n`tuf.ngclient` users are **not** impacted but direct users of `tuf.api.metadata` could be impacted.\n\n### Impact\n\nIf an attacker can make a Metadata API user run `Targets.get_delegated_role()` so that \n1. the `Targets` uses succinct delegation\n1. the `delegated_role` argument is not actually delegated by the `Targets`\n\nthe result will be incorrect.\n\nThis also means that if an attacker can make a Metadata API user run `Targets.verify_delegate()` or `Targets.get_verification_result()` so that\n1. the delegating `Targets` uses a succinct delegation\n1. the `delegated_role` argument is the name of some unrelated Metadata\n1. that other Metadata is correctly signed by the keys defined in the succinct delegation\n\nthe result would be a successful verification even though the `Targets` in question does not actually delegate to `delegated_role`.\n\nThe impact is estimated to be low for following reasons:\n\n* This cannot impact a TUF client that implements the client workflow as specified since the delegated role name is not an input but is collected from the (trusted) delegating Targets itself\n* Actual signature verification is not bypassed: The verified metadata _must_ still be correctly signed by the keys specified in the delegating role.\n* The described situations are somewhat hypothetical: there does not seem to be any reason for a python-tuf user (whether client or a repository) to use `tuf.api.metadata` in this way.\n\nAll users of `tuf.ngclient` are specifically **not** impacted. Users of `tuf.api.metadata` could be impacted if they use succinct delegations in a way described above.\n\n### Patches\n\nA fix is available in python-tuf 3.1.1 as commit 77cb66bc and in later releases as commit eb4834d9._\n\n### Workarounds\n\n`tuf.api.metadata` users should only call `Targets.get_delegated_role()`, `Targets.verify_delegate()` or `Targets.get_verification_result()` with `delegated_role` argument that is known to be delegated by the `Targets` in question.\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "tuf"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "3.1.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/theupdateframework/python-tuf/security/advisories/GHSA-77hh-43cm-v8j6"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/theupdateframework/python-tuf/commit/77cb66bc879d108c449ba4c46dfb0e3a9e57a785"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/theupdateframework/python-tuf/commit/eb4834d9205d07ae164bc6c5b97787585c0acfdc"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/theupdateframework/python-tuf"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/theupdateframework/python-tuf/releases/tag/v3.1.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-02-16T23:35:39Z",
    "nvd_published_at" : null
  }
}