PYSEC-2022-6

See a problem?
Import Source
https://github.com/pypa/advisory-database/blob/main/vulns/pipenv/PYSEC-2022-6.yaml
JSON Data
https://api.osv.dev/v1/vulns/PYSEC-2022-6
Aliases
Published
2022-01-10T21:15:00Z
Modified
2023-11-08T04:08:06.997974Z
Summary
[none]
Details

pipenv is a Python development workflow tool. Starting with version 2018.10.9 and prior to version 2022.1.8, a flaw in pipenv's parsing of requirements files allows an attacker to insert a specially crafted string inside a comment anywhere within a requirements.txt file, which will cause victims who use pipenv to install the requirements file to download dependencies from a package index server controlled by the attacker. By embedding malicious code in packages served from their malicious index server, the attacker can trigger arbitrary remote code execution (RCE) on the victims' systems. If an attacker is able to hide a malicious --index-url option in a requirements file that a victim installs with pipenv, the attacker can embed arbitrary malicious code in packages served from their malicious index server that will be executed on the victim's host during installation (remote code execution/RCE). When pip installs from a source distribution, any code in the setup.py is executed by the install process. This issue is patched in version 2022.1.8. The GitHub Security Advisory contains more information about this vulnerability.

References

Affected packages

PyPI / pipenv

Package

Affected ranges

Type
GIT
Repo
https://github.com/pypa/pipenv
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Fixed
Type
ECOSYSTEM
Events
Introduced
2018.10.9
Fixed
2022.1.8

Affected versions

2018.*

2018.10.9
2018.10.13
2018.11.14
2018.11.26

2020.*

2020.4.1b1
2020.4.1b2
2020.5.28
2020.6.2
2020.8.13
2020.11.4
2020.11.15

2021.*

2021.5.29
2021.11.5
2021.11.5.post0
2021.11.9
2021.11.15
2021.11.23