# GHSA-F74X-HGWM-2849: Path traversal in JupyterLab's HTML viewer let one click in a crafted file trust a notebook

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

## Affected versions

- jupyterlab (PyPI): from 3.0.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/htmlviewer (npm): from 3.0.0, through 4.6.6
- @jupyterlab/htmlviewer (npm): from 4.7.0-alpha.0, through 4.7.0-beta.3

## Description

JupyterLab's HTML viewer gives each file a base URL under the server's file endpoint, and that URL carries the user's XSRF token. A crafted file name could make that base URL point at another server endpoint, such as the one that marks a notebook as trusted. One click on a link in the file then trusted a notebook from the attacker, and its script ran when the user opened it.

Users are affected if all of the following conditions are true:

- they run JupyterLab 3.0.0 to 4.6.6, or an application that bundles it such as Notebook 7;
- they use a browser that sends hyperlink pings, such as Chrome or another Chromium-based browser; and
- a folder they open in JupyterLab holds files from someone else, such as a cloned repository, an unpacked archive or a shared folder, and that person knows the path of the folder below the server's root directory.

The attack then needs the user to do three things, in this order:

1. Open the crafted file in the HTML viewer. Double-clicking a workspace file (`.jupyterlab-workspace`) from the same person does this, and so does a link that opens the file in the viewer (JupyterLab 4.7.0b1 and later).
2. Click a link in that file.
3. Open that person's notebook.

Firefox sends hyperlink pings only when `browser.send_pings` is set to `true` in `about:config`, so Firefox users who keep the default (`false`) are not affected.

### Impact

The notebook was marked as trusted although the user neither ran nor trusted it. When the user opened it, its saved output ran script in the JupyterLab page, with the user's access to the Jupyter Server REST API: read and write files, start kernels and run code in them, and open terminals where terminals are enabled. The same click could also reach other server endpoints, for example to stop the server.

### 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 HTML viewer now escapes the path of the file before it gets the base URL from the URL resolver, so the base URL is the address of that file under `/files/`.

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. Applications built from the npm packages get the fix in `@jupyterlab/services` 7.6.7 and 7.7.0-rc.0.

### Workarounds

Until you have upgraded, open HTML files and workspace files from other people in Firefox, which does not send hyperlink pings unless `browser.send_pings` is set to `true` in `about:config`.

Administrators can turn the HTML viewer off by disabling its plugin:

```
jupyter labextension disable @jupyterlab/htmlviewer-extension:plugin
```

Confirm that `@jupyterlab/htmlviewer-extension:plugin` is disabled by running:

```
jupyter labextension list
```

HTML files then open in the text editor, and no file is shown as a web page.

### References

- https://jupyterlab.readthedocs.io/en/latest/user/notebook.html#notebook-trust
- https://jupyterlab.readthedocs.io/en/latest/user/workspaces.html
- https://github.com/jupyterlab/jupyterlab/commit/31c63f97342b0ff7a9dafc899d9f1acc3443abfb - the fix in 4.6.7
- https://github.com/jupyterlab/jupyterlab/commit/8413ad7558acfe225d1ccbc4aeb8e6bdea0b8db3 - the fix on `main`, for 4.7

**Published in the same release**:
- https://github.com/jupyterlab/jupyterlab/security/advisories/GHSA-qm7h-2957-7cc3 (ANT-2026-7WI11XU6) - its fix keeps download URLs under `/files/`, which also stops this route

### Acknowledgments

Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-OSZQH6D4.

## References

- https://github.com/jupyterlab/jupyterlab/security/advisories/GHSA-f74x-hgwm-2849

Page: https://cve.now/GHSA-F74X-HGWM-2849

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