# CVE-2026-40864: JupyterHub: Cross-origin form POSTs bypass XSRF

> Attackers can bypass XSRF protections to trigger server spawns or force users to accept shared server access via cross-origin form POSTs.

- **Severity:** Medium 5.4 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 22 May 2026
- **Updated:** 26 May 2026
- **Also known as:** BIT-jupyterhub-2026-40864, DEBIAN-CVE-2026-40864, GHSA-m68r-v472-jgq9, PYSEC-2026-2189, UBUNTU-CVE-2026-40864

## What is CVE-2026-40864?

CVE-2026-40864 is a medium-severity vulnerability in jupyterhub, published on 22 May 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

JupyterHub is software that allows users to create a multi-user server for Jupyter notebooks. In versions 4.1.0 through 5.4.4, XSRF protection (updated in 4.1.0) inappropriately treated requests with Sec-Fetch-Mode: no-cors as same-origin requests, bypassing XSRF checks. The JSON API is not affected, only HTTP form endpoints, such as /hub/spawn and /hub/accept-share, meaning attackers could trigger server spawn (but not access the server) and if the attacker is a JupyterHub user permitted to share access to their server, cause a user to accept a share and have access to the attacker's server. This issue has been fixed in version 5.4.5. If developers are unable to immediately upgrade, they can temporarily mitigate this issue by dropping requests to JupyterHub with Sec-Fetch-Mode: no-cors if they are using a reverse proxy.

Weakness: CWE-352 (Cross-Site Request Forgery)

## Which versions are affected by CVE-2026-40864?

4 open source packages ship an affected version, including jupyterhub. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `jupyterhub` | Bitnami | From 4.1.0 | 5.4.5 |
| `jupyterhub` | PyPI | From 4.1.0 | 5.4.5 |
| `jupyterhub` | PyPI | From 4.1.0 | 5.4.5 |
| `jupyterhub` | PyPI | From 4.1.0 | 5.4.5 |

Products: Jupyter Jupyterhub.

## How do I fix CVE-2026-40864?

Upgrade jupyterhub to 5.4.5 or later.

## Is CVE-2026-40864 being exploited?

There is no known exploitation of CVE-2026-40864 in the wild and no public exploit code.

Public exploit code:

- JupyterHub CSRF via cross-origin form POST — CVE-2026-40864 / CVSS 5.4 (github_poc): https://github.com/romain-deperne/CVE-2026-40864

## Other vulnerabilities in jupyterhub

- [CVE-2024-28233](https://insights.sbomify.com/CVE-2024-28233/): XSS in JupyterHub via Self-XSS leveraged by Cookie Tossing (high 8.1)
- [CVE-2024-41942](https://insights.sbomify.com/CVE-2024-41942/): JupyterHub has a privilege escalation vulnerability with the `admin:users` scope (high 7.2)
- [CVE-2019-10255](https://insights.sbomify.com/CVE-2019-10255/): Open Redirect vulnerability in jupyterhub and notebook (medium 6.1)
- [CVE-2026-33709](https://insights.sbomify.com/CVE-2026-33709/): JupyterHub has an Open Redirect Vulnerability (medium 5.1)
- [CVE-2020-36191](https://insights.sbomify.com/CVE-2020-36191/): Cross-Site Request Forgery in JupyterHub (medium 4.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-40864 and fix it if it is affected.

What it is: CVE-2026-40864 is a medium-severity vulnerability in jupyterhub, published on 22 May 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2026-40864 in the wild and no public exploit code.

Affected packages and fixed versions:
- jupyterhub (Bitnami): affected from 4.1.0; fixed in 5.4.5
- jupyterhub (PyPI): affected from 4.1.0; fixed in 5.4.5
- jupyterhub (PyPI): affected from 4.1.0; fixed in 5.4.5
- jupyterhub (PyPI): affected from 4.1.0; fixed in 5.4.5

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-40864/ (Markdown: https://insights.sbomify.com/CVE-2026-40864/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-40864
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-40864
- OSV: https://osv.dev/vulnerability/CVE-2026-40864

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-40864/
Summaries are generated and may contain mistakes; the official description above is the record.
