CVE-2026-40864: JupyterHub XSRF protection bypass in HTTP form endpoints

CVE-2026-40864 · Severity: medium · CVSS 5.4 · Published 2026-05-22

JupyterHub, a multi-user platform for Jupyter notebooks, contains a security flaw in its cross-site request forgery (XSRF) protection. An attacker could trick a logged-in user into performing unintended actions, such as starting a server or accepting a shared server connection. While this does not grant the attacker direct access to the user's data, it can be used to manipulate user sessions and server states.

Technologies: jupyterhub (PyPI). Vendors: PyPI.

Quick answers

Is CVE-2026-40864 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-40864 being exploited in the wild.
How severe is CVE-2026-40864?
Medium severity, with a CVSS score of 5.4, published 22 May 2026.
Which products and versions are affected?
jupyterhub (PyPI) >= 4.1.0, < 5.4.5, ECOSYSTEM:introduced=4.1.0,fixed=5.4.5.
Is there a fix for CVE-2026-40864?
Yes. jupyterhub (PyPI): upgrade to 5.4.5 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-40864 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-40864?
Check whether you run jupyterhub (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • jupyterhub (PyPI): upgrade to 5.4.5 or later
    pip install "jupyterhub>=5.4.5"

Technical details

A Cross-Site Request Forgery (CSRF/XSRF) vulnerability exists in JupyterHub due to an improper implementation of origin checks. The application incorrectly identifies requests containing the 'Sec-Fetch-Mode: no-cors' header as same-origin requests, effectively bypassing XSRF validation for HTTP form endpoints like /hub/spawn and /hub/accept-share. An attacker can exploit this by inducing a victim to submit a cross-origin POST request. This allows the attacker to trigger server spawns or force a user to accept a server share from the attacker. The JSON API is not affected. The issue is resolved in version 5.4.5.

Affected products

  • jupyterhub jupyterhub >= 4.1.0, < 5.4.5

Identifiers

  • CVE-2026-40864
  • GHSA-m68r-v472-jgq9
  • PYSEC-2026-2189

Timeline

  • 2026-05-05: disclosed
  • 2026-05-05: advisory
  • 2026-05-05: patched

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.