CVE-2026-6657: jupyter-server: CORS bypass enables arbitrary code execution
GHSA-v42x-x7jp-845h HIGH CISA: TRACK*A regex anchoring flaw in jupyter-server 1.12.0–2.17.0 allows an attacker to bypass CORS origin validation by registering a domain such as trusted.example.com.evil.com that passes re.match() checks intended to restrict access to trusted.example.com only. The vulnerability affects CORS headers, WebSocket connections, referer validation, and login redirects simultaneously — giving a cross-origin attacker full access to the Jupyter kernel API, including the ability to execute arbitrary Python code, read notebook contents, and exfiltrate training data or cloud credentials stored in environment variables. Jupyter is the backbone of most AI/ML development workflows, making exposure broad across data science teams handling proprietary models and sensitive datasets, and JupyterHub multi-user deployments further compound the blast radius. No public exploit or confirmed active exploitation has been reported, but the attack requires only luring a user with an active Jupyter session to a browser tab — a moderate-sophistication bar. Patch immediately to a fixed version beyond 2.17.0; if patching is not feasible, eliminate allow_origin_pat usage in favour of exact origin matching and restrict Jupyter access strictly to localhost or VPN.
What is the risk?
HIGH risk for AI/ML environments where Jupyter is reachable beyond localhost. The exploitation bar is low — an attacker needs only to register a domain matching the regex flaw and deliver a single malicious link. Blast radius is severe: full kernel access means arbitrary code execution in the Python environment hosting models, pipelines, and sensitive data. Environments with auto-mounted cloud credentials (AWS, GCP, Azure) face full credential exposure. JupyterHub multi-user deployments amplify impact by exposing a shared server surface. The absence of a CVSS score reflects novelty, not low severity.
How does the attack unfold?
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| Jupyter | pip | >= 1.12.0, <= 2.17.0 | No patch |
Do you use Jupyter? You're affected.
How severe is it?
What is the attack surface?
What should I do?
5 steps-
Patch: Upgrade jupyter-server beyond 2.17.0 where the re.match() anchoring flaw is corrected.
-
Workaround: Replace allow_origin_pat regex patterns with exact allow_origin string matching. If regex is unavoidable, ensure every pattern terminates with a $ anchor to enforce full string matching (e.g., ^trusted\.example\.com$ instead of ^trusted\.example\.com).
-
Network isolation: Restrict Jupyter to localhost (127.0.0.1) or zero-trust/VPN access — never expose to the public internet or untrusted networks.
-
Detection: Audit server access logs for cross-origin API requests from unexpected domains; monitor kernel execution logs for anomalous commands initiated via API.
-
Audit: Inventory all allow_origin_pat usages across development, staging, JupyterHub, and notebook CI deployments.
What does CISA's SSVC say?
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2026-6657?
A regex anchoring flaw in jupyter-server 1.12.0–2.17.0 allows an attacker to bypass CORS origin validation by registering a domain such as trusted.example.com.evil.com that passes re.match() checks intended to restrict access to trusted.example.com only. The vulnerability affects CORS headers, WebSocket connections, referer validation, and login redirects simultaneously — giving a cross-origin attacker full access to the Jupyter kernel API, including the ability to execute arbitrary Python code, read notebook contents, and exfiltrate training data or cloud credentials stored in environment variables. Jupyter is the backbone of most AI/ML development workflows, making exposure broad across data science teams handling proprietary models and sensitive datasets, and JupyterHub multi-user deployments further compound the blast radius. No public exploit or confirmed active exploitation has been reported, but the attack requires only luring a user with an active Jupyter session to a browser tab — a moderate-sophistication bar. Patch immediately to a fixed version beyond 2.17.0; if patching is not feasible, eliminate allow_origin_pat usage in favour of exact origin matching and restrict Jupyter access strictly to localhost or VPN.
Is CVE-2026-6657 actively exploited?
No confirmed active exploitation of CVE-2026-6657 has been reported, but organizations should still patch proactively.
How to fix CVE-2026-6657?
1. Patch: Upgrade jupyter-server beyond 2.17.0 where the re.match() anchoring flaw is corrected. 2. Workaround: Replace allow_origin_pat regex patterns with exact allow_origin string matching. If regex is unavoidable, ensure every pattern terminates with a $ anchor to enforce full string matching (e.g., ^trusted\.example\.com$ instead of ^trusted\.example\.com). 3. Network isolation: Restrict Jupyter to localhost (127.0.0.1) or zero-trust/VPN access — never expose to the public internet or untrusted networks. 4. Detection: Audit server access logs for cross-origin API requests from unexpected domains; monitor kernel execution logs for anomalous commands initiated via API. 5. Audit: Inventory all allow_origin_pat usages across development, staging, JupyterHub, and notebook CI deployments.
What systems are affected by CVE-2026-6657?
This vulnerability affects the following AI/ML architecture patterns: ML development environments, Training pipelines, Data science workbenches, JupyterHub multi-user deployments, AI/ML CI/CD pipelines running notebooks.
What is the CVSS score for CVE-2026-6657?
CVE-2026-6657 has a CVSS v3.1 base score of 8.8 (HIGH). The EPSS exploitation probability is 0.20%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0008.002 Domains AML.T0025 Exfiltration via Cyber Means AML.T0037 Data from Local System AML.T0049 Exploit Public-Facing Application AML.T0078 Drive-by Compromise Compliance Controls Affected
What are the technical details?
Original Advisory
A vulnerability in jupyter-server versions 1.12.0 through 2.17.0 allows an attacker to bypass CORS origin validation when the `allow_origin_pat` configuration is used. The issue arises from the use of `re.match()` for validating the `Origin` header, which only anchors at the start of the string. This allows attacker-controlled domains such as `trusted.example.com.evil.com` to pass validation against patterns intended to match `trusted.example.com`. The vulnerability affects multiple locations in the codebase, including CORS headers, WebSocket connections, referer validation, and login redirects, potentially enabling phishing attacks, arbitrary code execution, and unauthorized access to sensitive API responses.
Exploitation Scenario
A threat actor targeting an AI development team registers the domain notebooks.company.com.attacker.io. They host a page at that domain containing JavaScript that issues fetch() requests to the victim's internal Jupyter server (e.g., http://localhost:8888 or an internal JupyterHub URL). When a data scientist with an active Jupyter session opens the attacker's link — delivered via phishing email or a poisoned documentation site — the browser sends cross-origin requests that pass the vulnerable re.match() check against the pattern ^notebooks\.company\.com. The malicious script then calls the Jupyter REST API to spawn a kernel, execute Python reading /etc/environment and ~/.aws/credentials, dump contents of all open notebooks, and POST the exfiltrated data to the attacker's collection endpoint. The entire attack chain completes within seconds of the victim loading the page, with no user interaction beyond the initial click.
Weaknesses (CWE)
CWE-346 Origin Validation Error
Primary
CWE-346 Origin Validation Error
Primary
CWE-346 Origin Validation Error CWE-346 — Origin Validation Error: The product does not properly verify that the source of data or communication is valid.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H References
Timeline
Related Vulnerabilities
CVE-2023-25574 10.0 JupyterHub LTI13: JWT forgery enables full auth bypass
Same package: jupyter CVE-2026-44180 9.8 Jupyter Enterprise Gateway: root privilege bypass in Kubernetes
Same package: jupyter CVE-2026-23537 9.1 Feast: unauth file write to RCE via /save-document
Same package: jupyter CVE-2026-44727 9.0 jupyter-server: stored XSS yields kernel RCE
Same package: jupyter CVE-2026-42557 8.8 JupyterLab: one-click RCE via notebook HTML cell output
Same package: jupyter