GHSA-wjw6-2cqr-j4qr

Suggest an improvement
Source
https://github.com/advisories/GHSA-wjw6-2cqr-j4qr
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/10/GHSA-wjw6-2cqr-j4qr/GHSA-wjw6-2cqr-j4qr.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-wjw6-2cqr-j4qr
Aliases
Published
2021-10-19T20:14:36Z
Modified
2024-11-18T23:02:13.555137Z
Severity
  • 7.5 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:H/A:N CVSS Calculator
  • 6.9 (Medium) CVSS_V4 - CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:H/SA:N CVSS Calculator
Summary
Client metadata path-traversal
Details

Impact

In both clients (tuf/client and tuf/ngclient), there is a path traversal vulnerability that in the worst case can overwrite files ending in .json anywhere on the client system on a call to get_one_valid_targetinfo(). It occurs because the rolename is used to form the filename, and may contain path traversal characters (ie ../../name.json).

The impact is mitigated by a few facts: * It only affects implementations that allow arbitrary rolename selection for delegated targets metadata * The attack requires the ability to A) insert new metadata for the path-traversing role and B) get the role delegated by an existing targets metadata * The written file content is heavily restricted since it needs to be a valid, signed targets file. The file extension is always .json.

Patches

A fix is available in version 0.19 or newer.

Workarounds

None that do not require code changes. Clients can restrict the allowed character set for rolenames, or they can store metadata in files named in a way that is not vulnerable: neither of these approaches is possible without modifying python-tuf.

References

For more information

If you have any questions or comments about this advisory: * Open an issue in python-tuf * Contact the maintainers by email or Slack

Database specific
{
    "nvd_published_at": "2021-10-19T18:15:00Z",
    "cwe_ids": [
        "CWE-22"
    ],
    "severity": "MODERATE",
    "github_reviewed": true,
    "github_reviewed_at": "2021-10-19T16:09:34Z"
}
References

Affected packages

PyPI / tuf

Package

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
0.19.0

Affected versions

0.*

0.7.5
0.9.8
0.9.9
0.10.0
0.10.1
0.10.2
0.11.dev0
0.11.0
0.11.1
0.11.2.dev1
0.11.2.dev2
0.11.2.dev3
0.12.dev0
0.12.dev1
0.12.dev2
0.12.0
0.12.1
0.12.2
0.13.0
0.14.0
0.15.0
0.16.0
0.17.0
0.18.0
0.18.1