CVE-2021-39159: Remote Code Execution in BinderHub

binderhub Updated 02 Oct 2025

Summary

30/08/2021
Yes i
Critical
9.6

CVE-2021-39159: remote code execution via git repo provider. Affects binderhub versions < 0.2.0. Fixed in 0.2.0. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

BinderHub is an open-source project that provides a platform for building and hosting interactive Jupyter notebooks. It allows users to create and share computational environments based on code repositories. BinderHub supports various repository providers, including GitHub, GitLab, Gist, Zenodo, Figshare, Hydroshare, and Dataverse. This vulnerability affects BinderHub versions prior to 0.2.0.

Vulnerability Detail

A remote code execution vulnerability has been discovered in BinderHub. By supplying malicious input, an attacker can execute arbitrary code within the BinderHub context. This can lead to the extraction of sensitive credentials, such as JupyterHub API tokens, Kubernetes service accounts, and Docker registry credentials. The attacker may gain the ability to manipulate images and user-created pods within the deployment, potentially escalating privileges depending on the underlying Kubernetes configuration. The vulnerability has a CVSS score of 9.6 (Critical).

How To Fix

Minimum fixed version

0.2.0

This is the first release that contains the fix.

pip install --upgrade "binderhub==0.2.0"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, you can disable the git repo provider in BinderHub by specifying the BinderHub.repo_providers configuration. Here is an example of how to disable the git repo provider:

from binderhub.repoproviders import (GitHubRepoProvider,
                            GitLabRepoProvider, GistRepoProvider,
                            ZenodoProvider, FigshareProvider, HydroshareProvider,
                            DataverseProvider)

c.BinderHub.repo_providers =  {
            'gh': GitHubRepoProvider,
            'gist': GistRepoProvider,
            'gl': GitLabRepoProvider,
            'zenodo': ZenodoProvider,
            'figshare': FigshareProvider,
            'hydroshare': HydroshareProvider,
            'dataverse': DataverseProvider,
        }

By disabling the git repo provider, you remove the ability to create Binder environments from git repositories.

Conclusion

The remote code execution vulnerability in BinderHub can lead to severe consequences, including the extraction of sensitive credentials and potential privilege escalation. It is crucial to apply the provided patch or disable the git repo provider as a temporary workaround. For further assistance or support in addressing this vulnerability, please contact DevNack.com.

See every vulnerability recorded for binderhub →

Share this vulnerability

FAQ

BinderHub is an open-source platform for building and hosting interactive Jupyter notebooks. It allows users to create and share computational environments based on code repositories.

Versions of BinderHub prior to 0.2.0 are affected by this vulnerability.

This vulnerability allows an attacker to execute arbitrary code within the BinderHub context. They can potentially extract sensitive credentials, manipulate images and user-created pods, and escalate privileges depending on the Kubernetes configuration.

To fix this vulnerability, apply the provided patch to the affected version of BinderHub and rebuild/redeploy the instance.

Yes, you can temporarily disable the git repo provider in BinderHub by modifying the BinderHub.repo_providers configuration.

How To Fix

Minimum fixed version

0.2.0

This is the first release that contains the fix.

pip install --upgrade "binderhub==0.2.0"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback