Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:A/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Attacker needs repo commit access (PR:L) and victim must click through the rename diff (UI:R); browser XSS pivots to server terminal RCE, a scope change (S:C) with full C/I/A impact.
Primary rating from Vendor (https://github.com/jupyterlab/jupyterlab-git).
CVSS VectorVendor: https://github.com/jupyterlab/jupyterlab-git
Lifecycle Timeline
6DescriptionCVE.org
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("base64_payload"))>.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:
- An adversary creates a file with a crafted filename containing a JavaScript payload, e.g., <img src=x onerror=eval(atob("base64_payload"))>.py
- The adversary renames the file in a subsequent commit and pushes both commits to a shared Git repository
- The victim clones or pulls the repository and navigates to the Git History tab in JupyterLab
- The victim clicks the rename commit, then clicks the renamed file to view the diff
- The createHeader() method constructs a diff header using string concatenation with the unsanitized filename and assigns the result to innerHTML
- 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.
AnalysisAI
Stored cross-site scripting in the jupyterlab-git extension (versions 0.30.0b3 through 0.53.x) escalates to remote code execution when a victim views a rename diff in the Git History tab. The PlainTextDiff.ts createHeader() method injects unsanitized Git filenames into innerHTML, so a filename such as <img src=x onerror=eval(atob(...))>.py fires JavaScript that reads the _xsrf cookie, spawns a JupyterLab terminal via POST /api/terminals, and runs arbitrary shell commands. Reported by AWS Security; no public exploit identified at time of analysis, though the vendor advisory (GHSA-f962-v9hr-pfg5) documents a detailed reproduction path, and it is not listed in CISA KEV.
Technical ContextAI
jupyterlab-git is a server/browser extension for JupyterLab (shipped as pip packages jupyterlab-git and jupyterlab-git-core and npm @jupyterlab/git) that surfaces Git operations - status, commits, diffs, and history - inside the JupyterLab UI. The root cause is CWE-79 (improper neutralization of input during web page generation): the diff-header rendering in src/components/diff/PlainTextDiff.ts built an HTML string by concatenating branch/file 'labels' and assigned it via head.innerHTML, and the parallel NotebookDiff.ts path had the same pattern. Because Git filenames are attacker-controllable and rename history passes the old/new filename through as a label, any HTML in the filename is parsed by the browser. The fix replaces innerHTML string concatenation with document.createElement('span') plus textContent, so filenames are rendered as inert text. Notably the payload crosses trust boundaries: browser-side script uses JupyterLab's own authenticated API surface (the _xsrf token and /api/terminals WebSocket) to obtain server-side shell execution, which is why an XSS becomes RCE.
RemediationAI
Vendor-released patch: upgrade to jupyterlab-git 0.54.0 (pip jupyterlab-git / jupyterlab-git-core and npm @jupyterlab/git all fixed at 0.54.0); the fix is in commit c6d37b88f36aa59aee317930b95e427fb9d6b09b and release https://github.com/jupyterlab/jupyterlab-git/releases/tag/v0.54.0, which replaces innerHTML rendering with textContent in PlainTextDiff.ts and NotebookDiff.ts. If you cannot upgrade immediately, the practical compensating controls are to avoid opening the Git History / rename-diff view on repositories from untrusted or shared contributors, and to only clone repositories whose committers you trust - since the trigger is viewing a rename diff, not merely cloning. Because the escalation to RCE relies on the terminal API, environments that do not need it can disable JupyterLab terminals (set ServerApp.terminals_enabled = False), which blocks the RCE pivot at the cost of losing terminal functionality, though the underlying XSS in the victim's session would remain. The AWS/vendor-suggested source fix (textContent, or escaping <, >, &, ", ' before DOM insertion) is already incorporated in 0.54.0, so patching is strongly preferred over ad-hoc mitigation.
Same weakness CWE-79 – Cross-site Scripting (XSS)
View allShare
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-42428
GHSA-f962-v9hr-pfg5