# CVE-2021-41131: Client metadata path-traversal in python-tuf

- Severity: High 7.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:H/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.45%, higher than 74% of CVEs (2026-12-01)
- Published: 2021-10-19T17:50:11.000Z
- Modified: 2026-07-08T06:27:19.270Z
- Also known as: GHSA-wjw6-2cqr-j4qr, PYSEC-2021-376
- Related: CVE-2021-41150
- Weaknesses: CWE-22
- Assigned by: GitHub_M

## Description

python-tuf is a Python reference implementation of The Update Framework (TUF). 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. A fix is available in version 0.19 or newer. There are no workarounds 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.

(As written by CVE List.)

## Affected

- theupdateframework python-tuf: < 0.19.0
- tuf (PyPI): before 0.19.0; before 4ad7ae48fda594b640139c3b7eae21ed5155a102
- linuxfoundation the_update_framework: up to 0.18.1

## Every score

- GitHub_M: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:H/A:N`
- GitHub: CVSS:3.1 7.5 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:H/A:N`
- GitHub: CVSS:4.0 Medium `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`
- NVD: CVSS:3.1 8.7 High `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:N/I:H/A:H`
- NVD: CVSS:2.0 8.8 High `AV:N/AC:M/Au:N/C:N/I:C/A:C`

## References

- <https://github.com/theupdateframework/python-tuf/security/advisories/GHSA-wjw6-2cqr-j4qr> (advisory, third-party-advisory, web)
- <https://github.com/theupdateframework/python-tuf/issues/1527> (issue-tracking, report, third-party-advisory, web)
- <https://github.com/theupdateframework/python-tuf/commit/4ad7ae48fda594b640139c3b7eae21ed5155a102> (fix, patch, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-41131> (advisory)
- <https://github.com/pypa/advisory-database/tree/main/vulns/tuf/PYSEC-2021-376.yaml> (web)
- <https://github.com/theupdateframework/python-tuf> (package)

## Sources

- CVE List: [CVE-2021-41131](https://www.cve.org/CVERecord?id=CVE-2021-41131), CVE Terms of Use, modified 2024-11-18
- GitHub Advisory Database: [GHSA-wjw6-2cqr-j4qr](https://github.com/advisories/GHSA-wjw6-2cqr-j4qr), CC-BY-4.0, modified 2026-07-08
- NVD: [CVE-2021-41131](https://nvd.nist.gov/vuln/detail/CVE-2021-41131), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2021-376](https://osv.dev/vulnerability/PYSEC-2021-376), CC-BY-4.0, modified 2025-01-14

---

Page: https://cve.day/CVE-2021-41131 · Whole record: https://cve.day/CVE-2021-41131.json · Rebuilt by cve.day 2026-11-25T22:58:04.567Z
