CVE-2021-41131 is a high-severity (CVSS 8.7) Path Traversal vulnerability in tuf. A fix is available for tuf — see the affected versions and patch details below.
Client metadata path-traversal
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
CVE-2021-41131 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 384,993 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
tufReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
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
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | tuf | all versions | 0.19.0pip install --upgrade 'tuf==0.19.0' |
Affected Products
the update frameworklinuxfoundationDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for tuf, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update tuf to 0.19.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-41131 is resolved across your whole dependency graph.
Workarounds
Resolve every user-supplied path to its canonical form and reject anything that escapes the intended directory, and run the component under an account that has no read or write access outside the directory it legitimately serves.
Frequently Asked Questions
Is CVE-2021-41131 in your dependencies?
Find it across PyPI, including transitive dependencies.