CVE-2023-40170: Jupyter server Cross-Site Scripting Vulnerability
MODERATECVE-2023-40170 is a MODERATE (CVSS 4.6) cross-site scripting vulnerability (CWE-284: Improper Access Control) affecting Jupyter server libraries in the PyPI ecosystem. The issue involves cross-site inclusion (xssi) of files in jupyter-server. Remediation is available by upgrading affected packages to version 2.7.2.
CVE-2023-40170 at a Glance
Security Impact
CVSS: 4.6
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N).
How to Fix CVE-2023-40170
To remediate this vulnerability, upgrade all affected Jupyter server dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install jupyter-server>=2.7.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show jupyter-server
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2023-40170, inspect your installed packages using pip:
pip show jupyter-server
Analyze the terminal output to locate any version of Jupyter server in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.7.2), your application is affected.
Note: The pip show jupyter-server command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-284: Improper Access Control, where the product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. In Jupyter server, 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
CVE-2023-40170 Affected Jupyter server Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
jupyter-server
|
PyPI |
< 2.7.2
|
2.7.2
|
References
Frequently Asked Questions
What is CVE-2023-40170?
Which Jupyter server versions are affected?
What version fixes CVE-2023-40170?
Is jupyter-server affected?
What is the CVSS score of CVE-2023-40170?
What CWE is associated with CVE-2023-40170?
How can I check PyPI dependencies for CVE-2023-40170?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-64x5-55rw-9974",
"modified" : "2023-08-29T23:34:09Z",
"published" : "2023-08-29T23:34:09Z",
"aliases" : [ "CVE-2023-40170" ],
"summary" : "cross-site inclusion (XSSI) of files in jupyter-server",
"details" : "### Impact\n\nImproper cross-site credential checks on `/files/` URLs could allow exposure of certain file contents, or accessing files when opening untrusted files via \"Open image in new tab\".\n\n### Patches\n\nJupyter Server 2.7.2\n\n### Workarounds\n\nUse lower performance `--ContentsManager.files_handler_class=jupyter_server.files.handlers.FilesHandler`, which implements the correct checks.\n\n### References\n\nUpstream patch for CVE-2019-9644 was not applied completely, leaving part of the vulnerability open.\n\nVulnerability reported by Tim Coen via the [bug bounty program](https://app.intigriti.com/programs/jupyter/jupyter/detail) [sponsored by the European Commission](https://commission.europa.eu/news/european-commissions-open-source-programme-office-starts-bug-bounties-2022-01-19_en) and hosted on the [Intigriti platform](https://www.intigriti.com/).",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "jupyter-server"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.7.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/jupyter-server/jupyter_server/security/advisories/GHSA-64x5-55rw-9974"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-40170"
}, {
"type" : "WEB",
"url" : "https://github.com/jupyter-server/jupyter_server/commit/87a4927272819f0b1cae1afa4c8c86ee2da002fd"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/jupyter-server/jupyter_server"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/jupyter-server/PYSEC-2023-157.yaml"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/NRP7DNZYVOIA4ZB3U3ZWKTFZEPYWNGCQ"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/XDKQAWQN6SQTOVACZNXYKEHWQXGG4DOF"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-284", "CWE-306", "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-08-29T23:34:09Z",
"nvd_published_at" : "2023-08-28T21:15:07Z"
}
}