Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-102831 Overview
CVE-2026-102831 is a cross-site scripting vulnerability [CWE-79] in JupyterLab, Jupyter Notebook, and JupyterLite Core. The flaw resides in the system clipboard cell-paste path, which accepts attacker-controlled cell JSON without clearing the metadata.trusted field. When useSystemClipboardForCells is active and pasteCodeCellsWithoutOutput is disabled, a pasted code cell can mark HTML output as trusted, bypass output sanitization, and execute script in the authenticated JupyterLab origin without executing the cell itself. Markdown and raw cells remain unaffected because their output is always sanitized.
Critical Impact
An attacker who convinces a user to paste crafted cell JSON can execute arbitrary JavaScript in the authenticated JupyterLab origin, enabling session hijacking, notebook exfiltration, and code execution through kernel APIs.
Affected Products
- JupyterLab 4.5.0 through 4.5.10 and 4.6.0 through 4.6.3
- Jupyter Notebook 7.5.0 through 7.6.2
- JupyterLite Core 0.7.0 through 0.8.3
Discovery Timeline
- 2026-09-29 - CVE-2026-102831 published to NVD
- 2026-09-29 - Last updated in NVD database
Technical Details for CVE-2026-102831
Vulnerability Analysis
JupyterLab's trust model relies on the metadata.trusted flag to decide whether cell outputs bypass the HTML sanitizer. Outputs marked as trusted are rendered directly, allowing inline <script> tags and event handlers to execute. The cell-paste handler in packages/notebook/src/actions.tsx cast clipboard data directly to nbformat.IBaseCell[] without stripping the trusted flag. An attacker who controls clipboard contents can inject cell JSON where a code cell's HTML output is pre-marked trusted. Once pasted, the output renders in the authenticated JupyterLab origin and executes attacker-supplied JavaScript without the cell ever being run.
Root Cause
The root cause is missing sanitization of externally-sourced cell metadata. JupyterLab did not distinguish between clipboard data it wrote itself and clipboard data originating from another application or attacker-controlled source. Because the trusted marker was preserved on paste, the sanitization pipeline was skipped for outputs that should have been treated as untrusted.
Attack Vector
Exploitation requires user interaction: the victim must paste attacker-controlled JSON into a JupyterLab notebook while useSystemClipboardForCells is enabled and pasteCodeCellsWithoutOutput is disabled. Delivery vectors include crafted web pages that write to the system clipboard, malicious documents, or shared snippets. The pasted payload executes in the JupyterLab origin, granting the attacker access to the notebook session, kernel APIs, and any authenticated tokens.
// Security patch in packages/notebook/src/actions.tsx
// Untrust cells from the system clipboard when not originating locally
return;
}
- let values = stored as nbformat.IBaseCell[];
+ const storedCells = stored as nbformat.IBaseCell[];
+ const isLocal = clipboard.matchesLastWrite(JUPYTER_CELL_MIME, stored);
+ let values = isLocal
+ ? (JSONExt.deepCopy(storedCells) as nbformat.IBaseCell[])
+ : Private.untrustSystemClipboardCells(storedCells);
+ let interactionValues = storedCells;
if (options?.stripOutputs) {
values = Private.stripCodeCellOutputs(values);
+ interactionValues = Private.stripCodeCellOutputs(storedCells);
}
- addCells(notebook, mode, values, true);
+ addCells(notebook, mode, values, true, interactionValues);
void focusActiveCell(notebook);
}
Source: GitHub Commit 1a10a7d
The patch introduces a matchesLastWrite API on the clipboard interface. When clipboard data does not match what JupyterLab itself last wrote, the new untrustSystemClipboardCells helper clears the trusted marker before cells are added to the notebook.
Detection Methods for CVE-2026-102831
Indicators of Compromise
- Notebook .ipynb files containing code cells with metadata.trusted: true alongside HTML outputs that include <script> tags or inline event handlers such as onerror or onload.
- Browser console errors or unexpected network requests originating from the JupyterLab origin shortly after a paste operation.
- Kernel API calls (for example, /api/kernels/*/execute) initiated without a corresponding user cell execution.
Detection Strategies
- Inventory JupyterLab, Notebook, and JupyterLite Core installations and flag any instance running vulnerable versions listed in the advisory.
- Scan stored notebooks for code cells whose outputs[*].data["text/html"] contain executable HTML while metadata.trusted is set to true.
- Review browser and reverse-proxy logs for anomalous requests to Jupyter server endpoints (/api/contents, /api/sessions, /api/kernels) that lack matching front-end interaction telemetry.
Monitoring Recommendations
- Alert on outbound connections from Jupyter server hosts to unexpected destinations that could indicate token or notebook exfiltration.
- Monitor package registries and internal build pipelines for downgrade attempts targeting jupyterlab, notebook, or jupyterlite-core.
- Correlate JupyterLab access logs with authentication events to detect session reuse from unexpected client IPs following a suspected paste event.
How to Mitigate CVE-2026-102831
Immediate Actions Required
- Upgrade JupyterLab to 4.5.11 or 4.6.4, Jupyter Notebook to 7.6.3, and JupyterLite Core to 0.8.4.
- Restart all running Jupyter servers after the upgrade to ensure users load the patched front-end assets.
- Instruct users to avoid pasting untrusted cell content and to revoke or rotate any long-lived Jupyter tokens if compromise is suspected.
Patch Information
The fix is delivered in JupyterLab 4.5.11 and 4.6.4, Jupyter Notebook 7.6.3, and JupyterLite Core 0.8.4. Technical details are available in the GitHub Security Advisory GHSA-6966-vjj6-99xv and the corresponding release notes for JupyterLab v4.5.11 and JupyterLab v4.6.4. The commits 1a10a7d, 7f9f29e, and cf6e89a introduce the clipboard matchesLastWrite check and clear the trusted metadata on cells that did not originate from the local application.
Workarounds
- Disable useSystemClipboardForCells in JupyterLab user settings to prevent system clipboard content from being interpreted as cell JSON.
- Enable pasteCodeCellsWithoutOutput so cell outputs are stripped on paste, removing the trusted HTML payload path.
- Restrict access to JupyterLab deployments behind authenticated reverse proxies and enforce Content-Security-Policy headers that limit inline script execution.
# Configuration example: upgrade to patched versions
pip install --upgrade 'jupyterlab>=4.6.4'
pip install --upgrade 'notebook>=7.6.3'
pip install --upgrade 'jupyterlite-core>=0.8.4'
# Verify installed versions
jupyter lab --version
jupyter notebook --version
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

