CVE-2026-40864: JupyterHub has cross-origin form POSTs bypass XSRF (CWE-352)
Summary JupyterHub's XSRF protection (updated in 4.1.0) inappropriately treated requests with Sec-Fetch-Mode: no-cors as same-origin requests, which they are not, 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…
Published May 5, 2026 · Updated Jun 8, 2026
Affected packages
jupyterhub
- Ecosystem
- PyPI
- Affected
- >= 4.1.0, < 5.4.5
- Fixed in
- 5.4.5
- Check
pip show jupyterhub
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
JupyterHub's XSRF protection (updated in 4.1.0) inappropriately treated requests with Sec-Fetch-Mode: no-cors as same-origin requests, which they are not, 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.
Patches
Upgrade to JupyterHub 5.4.5.
Mitigations
If a reverse proxy is in use, drop requests to JupyterHub with Sec-Fetch-Mode: no-cors.
Credited to romain-deperne.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More PyPI vulnerabilities
All PyPI entriesCVE-2026-54338
JupyterHub has Unauthenticated Denial of Service via Unbounded Username Logging on Failed Login
medium5.3Aug 25, 2026CVE-2026-33709
JupyterHub has an Open Redirect Vulnerability
medium6.1Apr 3, 2026CVE-2024-41942
JupyterHub has a privilege escalation vulnerability with the `admin:users` scope
high7.2Aug 8, 2024CVE-2024-28233
Cross site scripting (XSS) in JupyterHub via Self-XSS leveraged by Cookie Tossing
high8.1Mar 28, 2024
