{"answers":{"affected":"3 open source packages ship an affected version, including pipenv. It affects 2 products.","exploited":"There is no known exploitation of CVE-2022-21668 in the wild and no public exploit code.","fix":"Upgrade pipenv to 2022.1.8 or later.","what":"CVE-2022-21668 is a high-severity vulnerability in Fedoraproject Fedora, published on 10 Jan 2022. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2022-21668 and fix it if it is affected.\n\nWhat it is: CVE-2022-21668 is a high-severity vulnerability in Fedoraproject Fedora, published on 10 Jan 2022. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of CVE-2022-21668 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- pipenv (PyPI): affected from 2018.10.9; fixed in 2022.1.8\n- pipenv (PyPI): affected from 2018.10.9; fixed in 2022.1.8\n- pipenv (PyPI): affected from 2018.10.9; fixed in 2022.1.8\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2022-21668/ (Markdown: https://insights.sbomify.com/CVE-2022-21668/index.md)","id":"CVE-2022-21668","markdown":"https://insights.sbomify.com/CVE-2022-21668/index.md","name":"CVE-2022-21668","record":{"aliases":["GHSA-qc9x-gjcv-465w","PYSEC-2022-6","ROOT-APP-PYPI-CVE-2022-21668","UBUNTU-CVE-2022-21668"],"analysis":{"component_type":"developer_tool","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"yes","non_default_config":false,"product_category":"Python dependency manager","requires_auth":"low_privilege","summary":"Attackers can inject malicious index URLs in requirements.txt comments, causing pipenv to install malicious packages and execute arbitrary code.","user_interaction":"required","vuln_class":"supply_chain"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"fedora","vendor":"fedoraproject"},{"product":"pipenv","vendor":"pypa"}],"cvss":{"score":8,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-190","name":"Integer Overflow or Wraparound"},{"id":"CWE-1284","name":"Improper Validation of Specified Quantity in Input"},{"id":"CWE-791","name":"Incomplete Filtering of Special Elements"},{"id":"CWE-78","name":"Improper Neutralization of Special Elements used in an OS Command"},{"id":"CWE-77","name":"Improper Neutralization of Special Elements used in a Command"},{"id":"CWE-427","name":"Uncontrolled Search Path Element"},{"id":"CWE-20","name":"Improper Input Validation"}],"description":"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.","ecosystems":["PyPI"],"exploits":{"exploitdb":0,"first_seen":"2022-03-26","github_poc":1,"max_poc_stars":1,"metasploit":0,"nuclei":0,"refs":[{"date":"2022-03-26T22:50:36Z","kind":"github_poc","ref":"https://github.com/sreeram281997/CVE-2022-21668-Pipenv-RCE-vulnerability","stars":1,"title":null}],"tier":"poc_unverified"},"has_fix":true,"headline":"Pipenv's requirements.txt parsing allows malicious index url in comments","id":"CVE-2022-21668","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":"fedoraproject:fedora","products":["fedoraproject:fedora"],"type":"supply_chain","year":"2022"},"n_packages":3,"n_references":6,"next":{"headline":"Bot token exposed in main.py","id":"CVE-2022-21669"},"packages":[{"ecosystem":"PyPI","fixed":["2022.1.8"],"introduced":["2018.10.9"],"last_affected":[],"package":"pipenv","purl":null,"source":"GHSA-qc9x-gjcv-465w"},{"ecosystem":"PyPI","fixed":["2022.1.8"],"introduced":["2018.10.9"],"last_affected":[],"package":"pipenv","purl":"pkg:pypi/pipenv","source":"GHSA-qc9x-gjcv-465w"},{"ecosystem":"PyPI","fixed":["2022.1.8"],"introduced":["2018.10.9"],"last_affected":[],"package":"pipenv","purl":"pkg:pypi/pipenv","source":"PYSEC-2022-6"}],"prev":{"headline":"Denial of Service in soketi","id":"CVE-2022-21667"},"products":["pipenv"],"published":"2022-01-10","related":[{"cvss_score":9.8,"headline":"PHP-CGI OS Command Injection","id":"CVE-2024-4577","kev_date_added":"2024-06-12","published":"2024-06-09"},{"cvss_score":9.8,"headline":"Grafana Authentication Bypass","id":"CVE-2021-39226","kev_date_added":"2022-08-25","published":"2021-10-05"},{"cvss_score":9.8,"headline":"VMware ESXi and Horizon DaaS OpenSLP Heap-Based Buffer Overflow","id":"CVE-2019-5544","kev_date_added":"2021-11-03","published":"2019-12-06"},{"cvss_score":9.6,"headline":"Google Chromium V8 Type Confusion","id":"CVE-2024-4947","kev_date_added":"2024-05-20","published":"2024-05-15"},{"cvss_score":9.6,"headline":"Google Chromium Visuals Use-After-Free","id":"CVE-2024-4671","kev_date_added":"2024-05-13","published":"2024-05-09"},{"cvss_score":9.6,"headline":"Google Chromium Mojo Insufficient Data Validation","id":"CVE-2022-3075","kev_date_added":"2022-09-08","published":"2022-09-26"},{"cvss_score":9.6,"headline":"Google Chromium Indexed DB API Use-After-Free","id":"CVE-2021-30633","kev_date_added":"2021-11-03","published":"2021-10-08"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"},{"class":"open","licence":"CC0","name":"PoC-in-GitHub"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":"PUBLISHED","updated":"2024-08-03","vendors":["pypa"]},"summary":"Attackers can inject malicious index URLs in requirements.txt comments, causing pipenv to install malicious packages and execute arbitrary code.","url":"https://insights.sbomify.com/CVE-2022-21668/"}