CVE-2026-54527: JupyterLab Git: Stored XSS leading to RCE

Published Jun 19, 2026
·
Updated

JupyterLab Git is a Git extension for JupyterLab. From 0.30.0b3 before 0.54.0, the PlainTextDiff.ts createHeader() method passes Git filenames directly to innerHTML when rendering renamed files in commit history, allowing a crafted filename to execute JavaScript when a victim views the rename diff in the Git History tab. This issue is fixed in version 0.54.0.

Other sources

Overview

Amazon Web Services (AWS) Security has identified a stored cross-site scripting (XSS) issue in the jupyterlab-git JupyterLab extension that can lead to remote code execution (RCE). The issue exists in the PlainTextDiff.ts component, where the createHeader() method passes Git filenames directly to innerHTML without sanitization when rendering diffs for renamed files in commit history. This allows an adversary to craft a filename containing arbitrary HTML/JavaScript that executes when another user views the rename diff in the Git History tab.

The issue can be leveraged through the rename history view in the JupyterLab Git panel. An adversary creates a file with a crafted filename containing a JavaScript payload (e.g., <img src=x onerror=eval(atob("base64payload"))>.py), renames the file in a subsequent commit, and pushes to a shared repository. When a victim clones the repository, navigates to the Git History tab, clicks the rename commit, and then clicks the renamed file to view the diff, the unsanitized filename renders via innerHTML, executing arbitrary JavaScript in the victim's browser session. The injected JavaScript reads the xsrf cookie, opens a JupyterLab terminal via POST /api/terminals, connects via WebSocket, and executes arbitrary shell commands — achieving full RCE. An adversary can leverage this to exfiltrate secrets or credentials from the victim's environment.

Scope of impact

We discovered this issue during internal security testing. The issue is present in the default configuration of JupyterLab when the jupyterlab-git extension is installed.

The attack requires:

- The adversary to have commit access to a Git repository that the victim has cloned

- The victim to navigate to the Git History tab, click the rename commit, and click the renamed file to view the diff

The issue could allow an actor who has access to a shared Git repository to execute arbitrary JavaScript in another user's JupyterLab environment by committing a file with a crafted filename, potentially leading to remote code execution with access to user code, data, environment variables, and credentials.

Proof of concept

The issue exists in the createHeader() method where filenames from rename history are passed directly to innerHTML without sanitization:

[1] https://github.com/jupyterlab/jupyterlab-git/blob/main/src/components/diff/PlainTextDiff.ts#L214

Attack flow:

1. An adversary creates a file with a crafted filename containing a JavaScript payload, e.g., <img src=x onerror=eval(atob("base64payload"))>.py

2. The adversary renames the file in a subsequent commit and pushes both commits to a shared Git repository

3. The victim clones or pulls the repository and navigates to the Git History tab in JupyterLab

4. The victim clicks the rename commit, then clicks the renamed file to view the diff

5. The createHeader() method constructs a diff header using string concatenation with the unsanitized filename and assigns the result to innerHTML

6. The injected JavaScript executes in the victim's browser session, reads the xsrf cookie, sends a POST request to /api/terminals to open a JupyterLab terminal, connects via WebSocket, and executes arbitrary shell commands

Proof-of-concept mitigation

The issue can be mitigated by replacing innerHTML with textContent for filename rendering in the createHeader() method of PlainTextDiff.ts. Alternatively, proper HTML sanitization (escaping <, >, &, ", ') can be applied before inserting user-controlled filenames into the DOM.

GitHub

Affected Software

6 affected componentsFixes available
npm/@jupyterlab/git>=0.30.0b3<0.54.0-a1
0.54.0
pip/jupyterlab-git-core>=0.30.0b3<0.54.0a1
0.54.0
pip/jupyterlab-git>=0.30.0b3<0.54.0a1
0.54.0
jupyter jupyterlab-git>=0.30.1<0.54.0
jupyter jupyterlab-git=0.30.0
jupyter jupyterlab-git=0.30.0-beta3

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/@jupyterlab/git to a version that resolves this vulnerability.

    Fixed in 0.54.0
  2. Upgrade

    Upgrade pip/jupyterlab-git-core to a version that resolves this vulnerability.

    Fixed in 0.54.0
  3. Upgrade

    Upgrade pip/jupyterlab-git to a version that resolves this vulnerability.

    Fixed in 0.54.0
  4. Upgrade

    Upgrade jupyterlab-git JupyterLab extension to a version that resolves this vulnerability.

    Fixed in 0.54.0
  5. Configuration

    Mitigate the stored XSS by updating PlainTextDiff.ts so that the createHeader() method renders Git filenames using textContent (instead of innerHTML) when displaying renamed-file diffs in the commit history.

    jupyterlab-git (PlainTextDiff.ts createHeader) innerHTML vs textContent = Use textContent instead of innerHTML for filename rendering in createHeader()

Event History

Jun 19, 2026
Advisory Published
via GitHub·07:36 PM
Data Sourced
via GitHub·07:36 PM
DescriptionWeaknessAffected Software
Jul 8, 2026
CVE Published
via MITRE·09:03 PM
Data Sourced
via MITRE·09:03 PM
DescriptionWeakness
Data Sourced
via NVD·09:16 PM
RemedyDescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-54527?

The severity of CVE-2026-54527 is rated as 73 on the risk scale.

2

What kind of vulnerability is CVE-2026-54527?

CVE-2026-54527 is a stored cross-site scripting (XSS) vulnerability that can lead to remote code execution (RCE).

3

How do I fix CVE-2026-54527?

To fix CVE-2026-54527, update the jupyterlab-git extension to the latest patched version provided by the maintainers.

4

Which components are affected by CVE-2026-54527?

CVE-2026-54527 affects the PlainTextDiff.ts component of the jupyterlab-git extension.

5

Is remote code execution possible due to CVE-2026-54527?

Yes, CVE-2026-54527 can lead to remote code execution due to the stored XSS vulnerability.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203