# CVE-2022-35861: pyenv 1.2.24 through 2.3.2 allows local users to gain privileges via a .python-version file in the current working directory.

- Severity: High 7.8 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- 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): 0.29%, higher than 23% of CVEs (2026-12-01)
- Published: 2022-07-17T16:31:03.000Z
- Modified: 2026-06-17T04:52:24.920Z
- Weaknesses: CWE-22
- Assigned by: mitre

## Description

pyenv 1.2.24 through 2.3.2 allows local users to gain privileges via a .python-version file in the current working directory. An attacker can craft a Python version string in .python-version to execute shims under their control. (Shims are executables that pass a command along to a specific version of pyenv. The version string is used to construct the path to the command, and there is no validation of whether the version specified is a valid version. Thus, relative path traversal can occur.)

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- pyenv pyenv: from 1.2.24 up to 2.3.2

## Every score

- NVD: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- NVD: CVSS:2.0 4.6 Medium `AV:L/AC:L/Au:N/C:P/I:P/A:P`

## References

- <https://github.com/pyenv/pyenv/commit/22fa683571d98b59ea16e5fe48ac411c67939653> (patch)

## Sources

- CVE List: [CVE-2022-35861](https://www.cve.org/CVERecord?id=CVE-2022-35861), CVE Terms of Use, modified 2024-08-03
- NVD: [CVE-2022-35861](https://nvd.nist.gov/vuln/detail/CVE-2022-35861), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2022-35861 · Whole record: https://cve.day/CVE-2022-35861.json · Rebuilt by cve.day 2026-11-25T22:58:12.992Z
