CVE-2026-40864: Jupyterhub JupyterHub Has Cross-origin Form POSTs Vulnerability

MODERATE
Advisory Identifier: GHSA-m68r-v472-jgq9
CVSS 5.4
CWE-352
Published
Advisory Summary

CVE-2026-40864 is a MODERATE (CVSS 5.4) jupyterhub has cross-origin form posts vulnerability (CWE-352: Cross-Site Request Forgery (CSRF)) affecting Jupyterhub libraries in the PyPI ecosystem. The issue involves jupyterhub has cross-origin form posts bypass xsrf (cwe-352). Remediation is available by upgrading affected packages to version 5.4.5.

CVE-2026-40864 at a Glance

CVE Identifier CVE-2026-40864
GHSA Identifier GHSA-m68r-v472-jgq9
Severity MODERATE
CVSS v3.1 Base Score 5.4
CWE Classification CWE-352: Cross-Site Request Forgery (CSRF)
Affected Product Jupyterhub
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 5.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2026-40864

To remediate this vulnerability, upgrade all affected Jupyterhub dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

jupyterhub fixed: 5.4.5
pip install jupyterhub>=5.4.5
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show jupyterhub

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-40864, inspect your installed packages using pip:

pip show jupyterhub

Analyze the terminal output to locate any version of Jupyterhub in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.4.5), your application is affected.

Note: The pip show jupyterhub command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-352: Cross-Site Request Forgery (CSRF), where the web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor. In Jupyterhub, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## 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`.

CVE-2026-40864 Affected Jupyterhub Versions

1 component(s)
Fixed Versions:
5.4.5
Product / Package Ecosystem Affected Versions Fixed Version
jupyterhub
PyPI
≥ 4.1.0
< 5.4.5
5.4.5

References

Frequently Asked Questions

What is CVE-2026-40864?
CVE-2026-40864 is a security vulnerability in Jupyterhub involving JupyterHub has cross-origin form POSTs bypass XSRF (CWE-352) under CWE-352: Cross-Site Request Forgery (CSRF).
Which Jupyterhub versions are affected?
Affected versions include releases prior to 5.4.5 across affected packages: jupyterhub.
What version fixes CVE-2026-40864?
Upgrading to 5.4.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is jupyterhub affected?
Yes, jupyterhub is affected in releases prior to 5.4.5. Upgrade your dependency to 5.4.5 or later.
What is the CVSS score of CVE-2026-40864?
CVE-2026-40864 has a CVSS v3.1 base score of 5.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:L.
What CWE is associated with CVE-2026-40864?
CVE-2026-40864 is classified under CWE-352: Cross-Site Request Forgery (CSRF) (The web application does not, or cannot, sufficiently verify whether a request was intentionally provided by the user who sent the request, which could have originated from an unauthorized actor.).
How can I check PyPI dependencies for CVE-2026-40864?
Run the dependency tree command: 'pip show jupyterhub'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-m68r-v472-jgq9",
  "modified" : "2026-06-08T23:20:50Z",
  "published" : "2026-05-05T18:10:58Z",
  "aliases" : [ "CVE-2026-40864" ],
  "summary" : "JupyterHub has cross-origin form POSTs bypass XSRF (CWE-352)",
  "details" : "## Summary\n\nJupyterHub'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.\n\n## Patches\n\nUpgrade to JupyterHub 5.4.5.\n\n## Mitigations\n\nIf a reverse proxy is in use, drop requests to JupyterHub with `Sec-Fetch-Mode: no-cors`.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "jupyterhub"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.1.0"
      }, {
        "fixed" : "5.4.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/jupyterhub/jupyterhub/security/advisories/GHSA-m68r-v472-jgq9"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-40864"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jupyterhub/jupyterhub/commit/9c5ec277d3cda5a59de2d8c8117efa77bd941127"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/jupyterhub/jupyterhub"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-352" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-05T18:10:58Z",
    "nvd_published_at" : "2026-05-22T21:16:43Z"
  }
}