Low severityNVD Advisory· Published Nov 18, 2020· Updated Aug 4, 2024
Open redirect in Jupyter Notebook
CVE-2020-26215
Description
Jupyter Notebook before version 6.1.5 has an Open redirect vulnerability. A maliciously crafted link to a notebook server could redirect the browser to a different website. All notebook servers are technically affected, however, these maliciously crafted links can only be reasonably made for known notebook server hosts. A link to your notebook server may appear safe, but ultimately redirect to a spoofed server on the public internet. The issue is patched in version 6.1.5.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
notebookPyPI | < 6.1.5 | 6.1.5 |
Affected products
1Patches
13cec4bbe2175Merge pull request from GHSA-c7vm-f5p4-8fqh
3 files changed · +37 −4
docs/source/changelog.rst+9 −0 modified@@ -22,6 +22,15 @@ We strongly recommend that you upgrade pip to version 9+ of pip before upgrading ``pip --version``. +.. _release-6.1.5: + +6.1.5 +----- + +6.1.5 is a security release, fixing one vulnerability: + +- Fix open redirect vulnerability GHSA-c7vm-f5p4-8fqh (CVE to be assigned) + .. _release-6.1.4: 6.1.4
notebook/base/handlers.py+10 −4 modified@@ -854,13 +854,18 @@ def get(self): class TrailingSlashHandler(web.RequestHandler): """Simple redirect handler that strips trailing slashes - + This should be the first, highest priority handler. """ - + def get(self): - self.redirect(self.request.uri.rstrip('/')) - + path, *rest = self.request.uri.partition("?") + # trim trailing *and* leading / + # to avoid misinterpreting repeated '//' + path = "/" + path.strip("/") + new_uri = "".join([path, *rest]) + self.redirect(new_uri) + post = put = get @@ -911,6 +916,7 @@ def get(self): url = sep.join([self._url, self.request.query]) self.redirect(url, permanent=self._permanent) + class PrometheusMetricsHandler(IPythonHandler): """ Return prometheus metrics for this notebook server
notebook/tests/test_paths.py+18 −0 modified@@ -3,10 +3,13 @@ from nose.tools import assert_regex, assert_not_regex from notebook.base.handlers import path_regex +from notebook.utils import url_path_join +from .launchnotebook import NotebookTestBase # build regexps that tornado uses: path_pat = re.compile('^' + '/x%s' % path_regex + '$') + def test_path_regex(): for path in ( '/x', @@ -30,3 +33,18 @@ def test_path_regex_bad(): '/y/x/foo', ): assert_not_regex(path, path_pat) + + +class RedirectTestCase(NotebookTestBase): + def test_trailing_slash(self): + for uri, expected in ( + ("/notebooks/mynotebook/", "/notebooks/mynotebook"), + ("////foo///", "/foo"), + ("//example.com/", "/example.com"), + ("/has/param/?hasparam=true", "/has/param?hasparam=true"), + ): + r = self.request("GET", uri, allow_redirects=False) + print(uri, expected) + assert r.status_code == 302 + assert "Location" in r.headers + assert r.headers["Location"] == url_path_join(self.url_prefix, expected)
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
6- github.com/advisories/GHSA-c7vm-f5p4-8fqhghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2020-26215ghsaADVISORY
- github.com/jupyter/notebook/commit/3cec4bbe21756de9f0c4bccf18cf61d840314d74ghsax_refsource_MISCWEB
- github.com/jupyter/notebook/security/advisories/GHSA-c7vm-f5p4-8fqhghsax_refsource_CONFIRMWEB
- github.com/pypa/advisory-database/tree/main/vulns/notebook/PYSEC-2020-215.yamlghsaWEB
- lists.debian.org/debian-lts-announce/2020/12/msg00004.htmlghsamailing-listx_refsource_MLISTWEB
News mentions
0No linked articles in our index yet.