CVE-2025-30370 jupyterlab-git has a command injection vulnerability in "Open Git Repository in Terminal"
Attackers can execute arbitrary shell commands by tricking users into opening a maliciously named Git repository in the terminal via the JupyterLab Git extension.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Local or same network only
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2025-30370?
CVE-2025-30370 is a high-severity command injection vulnerability in jupyterlab-git, published on 3 Apr 2025. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Official description
jupyterlab-git is a JupyterLab extension for version control using Git. On many platforms, a third party can create a Git repository under a name that includes a shell command substitution string in the syntax $(<command>). These directory names are allowed in macOS and a majority of Linux distributions. If a user starts jupyter-lab in a parent directory of this inappropriately-named Git repository, opens it, and clicks "Git > Open Git Repository in Terminal" from the menu bar, then the injected command <command> is run in the user's shell without the user's permission. This issue is occurring because when that menu entry is clicked, jupyterlab-git opens the terminal and runs cd <git-repo-path> through the shell to set the current directory. Doing so runs any command substitution strings present in the directory name, which leads to the command injection issue described here. A previous patch provided an incomplete fix. This vulnerability is fixed in 0.51.1.
Weakness: CWE-78
Which versions are affected by CVE-2025-30370?
3 open source packages ship an affected version, including jupyterlab-git.
| Package | Affected | Fixed in |
|---|---|---|
jupyterlab-git PyPI | All versions | 0.51.1 |
jupyterlab-git PyPI | All versions | 0.51.1 |
jupyterlab-git PyPI | All versions | 0.51.1 |
How do I fix CVE-2025-30370?
Upgrade jupyterlab-git to 0.51.1 or later.
Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.
Is CVE-2025-30370 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-30370 exists.
Sources
Also known as GHSA-cj5w-8mjf-r5f8, PYSEC-2026-1483.