Command Injection Affecting jupyterlab-git package, versions [,0.51.1)


Severity

Recommended
0.0
low
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.07% (23rd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Command Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PYTHON-JUPYTERLABGIT-9667341
  • published6 Apr 2025
  • disclosed3 Apr 2025
  • creditUnknown

Introduced: 3 Apr 2025

NewCVE-2025-30370  (opens in a new tab)
CWE-78  (opens in a new tab)

How to fix?

Upgrade jupyterlab-git to version 0.51.1 or higher.

Overview

jupyterlab-git is an A JupyterLab extension for version control using git

Affected versions of this package are vulnerable to Command Injection in the addCommands() function, which executes a cd command on the input passed in to the "Open Git Repository in Terminal" interface. If a user with permission to create a repository names the repository with a malicious string including command substitution - i.e. $(command) they can cause the command to be executed when another user accesses the "Open Git Repository in Terminal" interface.

Workaround

This vulnerability can be avoided in any of the following three ways:

  1. Set c.ServerApp.terminals_enabled = False on the server to disable use of a terminal

  2. Run jupyter server extension disable jupyter_server_terminals to disable the use of a terminal on the server extension

  3. Run jupyter labextension disable @jupyterlab/terminal-extension on the lab extension.

PoC

mkdir '$(touch pwned.txt)'
cd '$(touch pwned.txt)/'
git init
cd ..

CVSS Base Scores

version 4.0
version 3.1