# GHSA-X6GV-JWHV-J8W6: Cross-site scripting (XSS) in JupyterLab Vega charts when opening an untrusted notebook or Vega file

- Database: GitHub
- Severity: CVSS 8.6 (High)
- Published: 2026-12-04
- Modified: 2026-12-04

## Affected versions

- jupyterlab (PyPI): from 0.25.0, through 4.6.6
- jupyterlab (PyPI): from 4.7.0a0, through 4.7.0b3
- notebook (PyPI): from 7.0.0, through 7.6.5
- notebook (PyPI): from 7.7.0a0, through 7.7.0b3
- @jupyterlab/vega5-extension (npm): from 1.0.0-alpha.5, through 4.6.6
- @jupyterlab/vega5-extension (npm): from 4.7.0-alpha.0, through 4.7.0-beta.3

## Description

JupyterLab draws Vega and Vega-Lite charts in notebook outputs and in Vega and Vega-Lite files such as `.vg.json` and `.vl.json`. Altair, for example, saves its charts as Vega-Lite outputs. The Vega renderer was registered as safe for untrusted content and never checked whether the output was trusted, so a chart in an unsigned notebook was built live from the attacker's specification. A Vega specification is active content: Vega compiles the expressions in it to JavaScript. The attacker could therefore save a chart output that ran their JavaScript in the JupyterLab origin as soon as the user opened the notebook. The user did not have to click anything, run a cell or trust the notebook.

Users are affected if all of the following conditions are true:

- they run JupyterLab 0.25.0 to 4.6.6, or an application that bundles it such as Notebook 7; and
- they open a notebook or a Vega or Vega-Lite file (`.vg`, `.vg.json`, `.vega`, `.vl`, `.vl.json` or `.vegalite`) from someone else, and a Vega or Vega-Lite chart in it is displayed.

The notebook stays marked as not trusted.

### Impact

The script runs only when the user opens the file, and only with the privileges of that user. The patch closes every route below, because it no longer builds a live chart from untrusted content until the user presses Render in a Vega or Vega-Lite file.

#### Script on opening the file

The attacker's JavaScript ran with the authority of the JupyterLab page. It could use the Jupyter Server REST API as the user: read and write files, and start kernels or terminals that run code on the server. On JupyterHub without per-user subdomains (the default), all single-user servers and the Hub share one origin, so the script could also act on the Hub and on other servers that this user can access. The [JupyterHub security overview](https://jupyterhub.readthedocs.io/en/5.2.1/explanation/websecurity.html) recommends subdomains for this reason. The notebook trust model exists to stop this for unsigned outputs, but it did not apply here, because the renderer counted as safe.

#### Data sent to another site without script

The chart's data loader fetched URLs with the user's session and had no trust check either. Opening the file was enough for a chart to read the page configuration and files under the server root, and to send their content to a site of the attacker's choice. On a plain Jupyter Server the page configuration holds the server token. That token gives the whole server API to whoever holds it and can reach the server. Under JupyterHub that token is blank, but the file contents are still readable. This route needs the user's browser to be able to reach the attacker's site.

### Patches

JupyterLab 4.6.7 and 4.7.0rc0 contain the patch. No 4.5.x release with the fix is planned, so users of JupyterLab 4.5 and earlier should upgrade to 4.6.7. The JupyterLab maintainers reported to Vega the flaw that lets a chart run script, and Vega fixed it in Vega 6 ([GHSA-4cvm-vq37-cqp3](https://github.com/vega/vega/security/advisories/GHSA-4cvm-vq37-cqp3)). JupyterLab bundles Vega 5, so instead of moving to Vega 6, the patch stops Vega from running untrusted content. Vega and Vega-Lite outputs in untrusted notebooks, including Altair charts, now show their static image or text fallback until the notebook is trusted or the cell is run. For an Altair chart saved without an image, that fallback is Altair's message that the renderer has not been properly enabled. An output with no fallback is empty. A Vega or Vega-Lite file, such as a `.vg.json` or `.vl.json` file, now shows a Render button and runs nothing until the user presses it. A chart in a trusted notebook, or one that the user renders, can still run script.

Notebook bundles its own copy of the affected code, so Notebook users need to update `notebook` to 7.6.6 (or 7.7.0rc0 for pre-releases) as well as `jupyterlab`. Users of other applications that depend on JupyterLab should update the `jupyterlab` package too.

### Workarounds

Disable the Vega renderer:

```
jupyter labextension disable @jupyterlab/vega5-extension:factory
```

Confirm that `@jupyterlab/vega5-extension:factory` is disabled by running:

```
jupyter labextension list
```

Vega and Vega-Lite charts, including Altair charts, then appear as their static image or text fallback everywhere, even in trusted notebooks and in the outputs of cells you run yourself. Vega and Vega-Lite files open as JSON or plain text instead of as a chart.

Note: trusting only notebooks you wrote yourself does not protect you, because the script runs when the notebook is opened, before any trust decision.

### References

- https://jupyterlab.readthedocs.io/en/latest/user/file_formats.html#vega-vega-lite
- https://jupyterlab.readthedocs.io/en/latest/user/notebook.html#trust
- https://github.com/vega/vega/security/advisories/GHSA-4cvm-vq37-cqp3 - the Vega flaw that lets a chart run script, fixed in `vega-functions` 6.2.1
- https://github.com/jupyterlab/jupyterlab/commit/70700badb63839d7bac5bb0c8e0747b4caec77fd - the fix in 4.6.7
- https://github.com/jupyterlab/jupyterlab/commit/53959b6277c6891ff15a045a7979897e81ce6d4e - the fix on `main`, for 4.7

### Acknowledgments

Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-RCTTI4DN.
Also reported by @NotACop38 and @glacieraxiom

## References

- https://github.com/jupyterlab/jupyterlab/security/advisories/GHSA-x6gv-jwhv-j8w6

Page: https://cve.now/GHSA-X6GV-JWHV-J8W6

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
