{"answers":{"affected":"3 open source packages ship an affected version, including binderhub. It affects 1 product.","exploited":"There is no known exploitation of CVE-2021-39159 in the wild and no public exploit code.","fix":"Upgrade binderhub to a fixed version for your release line: 0.2.0 or 0.2.0-n653.","what":"CVE-2021-39159 is a critical command injection vulnerability in jupyterhub binderhub, published on 25 Aug 2021. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2021-39159 and fix it if it is affected.\n\nWhat it is: CVE-2021-39159 is a critical command injection vulnerability in jupyterhub binderhub, published on 25 Aug 2021. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of CVE-2021-39159 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- binderhub (PyPI): affected all versions; fixed in 0.2.0\n- binderhub (PyPI): affected all versions; fixed in 0.2.0\n- binderhub (PyPI): affected all versions; fixed in 0.2.0-n653\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-2021-39159/ (Markdown: https://insights.sbomify.com/CVE-2021-39159/index.md)","id":"CVE-2021-39159","markdown":"https://insights.sbomify.com/CVE-2021-39159/index.md","name":"CVE-2021-39159","record":{"aliases":["GHSA-9jjr-qqfp-ppwx","PYSEC-2021-371"],"analysis":{"component_type":"cloud_service","fix_type":"upgrade","impacts":["code_execution","privilege_escalation"],"network_reachable":"yes","non_default_config":false,"product_category":"BinderHub cloud service","requires_auth":"none","summary":"Attackers can execute arbitrary code in BinderHub via malicious input, potentially stealing credentials and escalating privileges within the Kubernetes deployment.","user_interaction":"required","vuln_class":"command_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"binderhub","vendor":"jupyter"}],"cvss":{"score":9.6,"severity":"critical","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-78","name":"Improper Neutralization of Special Elements used in an OS Command"},{"id":"CWE-94","name":"Improper Control of Generation of Code"}],"description":"BinderHub is a kubernetes-based cloud service that allows users to share reproducible interactive computing environments from code repositories. In affected versions a remote code execution vulnerability has been identified in BinderHub, where providing BinderHub with maliciously crafted input could execute code in the BinderHub context, with the potential to egress credentials of the BinderHub deployment, including JupyterHub API tokens, kubernetes service accounts, and docker registry credentials. This may provide the ability to manipulate images and other user created pods in the deployment, with the potential to escalate to the host depending on the underlying kubernetes configuration. Users are advised to update to version 0.2.0-n653. If users are unable to update they may disable the git repo provider by specifying the `BinderHub.repo_providers` as a workaround.","ecosystems":["PyPI"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Remote code execution in Binderhub","id":"CVE-2021-39159","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"command_injection","year":"2021"},"n_packages":3,"n_references":2,"next":{"headline":"Code injection in nbgitpuller","id":"CVE-2021-39160"},"packages":[{"ecosystem":"PyPI","fixed":["0.2.0"],"introduced":["0"],"last_affected":[],"package":"binderhub","purl":null,"source":"GHSA-9jjr-qqfp-ppwx"},{"ecosystem":"PyPI","fixed":["0.2.0"],"introduced":["0"],"last_affected":[],"package":"binderhub","purl":"pkg:pypi/binderhub","source":"GHSA-9jjr-qqfp-ppwx"},{"ecosystem":"PyPI","fixed":["0.2.0-n653"],"introduced":["0"],"last_affected":[],"package":"binderhub","purl":"pkg:pypi/binderhub","source":"PYSEC-2021-371"}],"prev":{"headline":"Dependency injection in NVCaffe","id":"CVE-2021-39158"},"products":["binderhub"],"published":"2021-08-25","related":[],"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)"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":"PUBLISHED","updated":"2024-08-04","vendors":["jupyterhub"]},"summary":"Attackers can execute arbitrary code in BinderHub via malicious input, potentially stealing credentials and escalating privileges within the Kubernetes deployment.","url":"https://insights.sbomify.com/CVE-2021-39159/"}