CVE-2021-39159 Remote code execution in Binderhub
Attackers can execute arbitrary code in BinderHub via malicious input, potentially stealing credentials and escalating privileges within the Kubernetes deployment.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2021-39159?
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.
Official 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.
Which versions are affected by CVE-2021-39159?
3 open source packages ship an affected version, including binderhub. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
binderhub PyPI | All versions | 0.2.0 |
binderhub PyPI | All versions | 0.2.0 |
binderhub PyPI | All versions | 0.2.0-n653 |
Products include Jupyter Binderhub.
How do I fix CVE-2021-39159?
Upgrade binderhub to a fixed version for your release line: 0.2.0 or 0.2.0-n653.
Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.
Is CVE-2021-39159 being exploited?
There is no known exploitation of CVE-2021-39159 in the wild and no public exploit code.
Sources
Also known as GHSA-9jjr-qqfp-ppwx, PYSEC-2021-371.