CVE-2022-29238: Notebook Token Bruteforcing. Vulnerability

MODERATE
Advisory Identifier: GHSA-v7vq-3x77-87vg
CVSS 4.3
CWE-425
Published
Advisory Summary

CVE-2022-29238 is a MODERATE (CVSS 4.3) token bruteforcing. vulnerability (CWE-425: Direct Request ('Forced Browsing')) affecting Notebook libraries in the PyPI ecosystem. The issue involves token bruteforcing.. Remediation is available by upgrading affected packages to version 6.4.12.

CVE-2022-29238 at a Glance

CVE Identifier CVE-2022-29238
GHSA Identifier GHSA-v7vq-3x77-87vg
Severity MODERATE
CVSS v3.1 Base Score 4.3
CWE Classification CWE-425: Direct Request ('Forced Browsing')
Affected Product Notebook
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 4.3

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:N/S:U/C:L/I:N/A:N).

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

How to Fix CVE-2022-29238

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

notebook fixed: 6.4.12
pip install notebook>=6.4.12
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 notebook

How to Check if You Are Affected

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

pip show notebook

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-425: Direct Request ('Forced Browsing'), where the web application does not adequately enforce appropriate authorization on all restricted urls, scripts, or files. In Notebook, 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

### Impact _What kind of vulnerability is it? Who is impacted?_ Authenticated requests to the notebook server with `ContentsManager.allow_hidden = False` only prevented listing the contents of hidden directories, not accessing individual hidden files or files in hidden directories (i.e. hidden files were 'hidden' but not 'inaccessible'). This could lead to notebook configurations allowing authenticated access to files that may reasonably be expected to be disallowed. Because fully authenticated requests are required, this is of relatively low impact. But if a server's root directory contains sensitive files whose only protection from the server is being hidden (e.g. `~/.ssh` while serving $HOME), then any authenticated requests could access files if their names are guessable. Such contexts also necessarily have full access to the server and therefore execution permissions, which also generally grants access to all the same files. So this does not generally result in any privilege escalation or increase in information access, only an additional, unintended _means_ by which the files could be accessed. ### Patches _Has the problem been patched? What versions should users upgrade to?_ notebook 6.4.12 ### Workarounds _Is there a way for users to fix or remediate the vulnerability without upgrading?_ - Do not run the notebook server in a directory with hidden files, use subdirectories - Use a custom ContentsManager with additional checks for `self.is_hidden(path)` prior to completing actions ### References _Are there any links users can visit to find out more?_ ### For more information If you have any questions or comments about this advisory: * Open an issue in [example link to repo](http://example.com) * Email us at [example email address](mailto:example@example.com)

CVE-2022-29238 Affected Notebook Versions

1 component(s)
Fixed Versions:
6.4.12
Product / Package Ecosystem Affected Versions Fixed Version
notebook
PyPI
< 6.4.12
6.4.12

References

Frequently Asked Questions

What is CVE-2022-29238?
CVE-2022-29238 is a security vulnerability in Notebook involving Token bruteforcing. under CWE-425: Direct Request ('Forced Browsing').
Which Notebook versions are affected?
Affected versions include releases prior to 6.4.12 across affected packages: notebook.
What version fixes CVE-2022-29238?
Upgrading to 6.4.12 (or the latest patched release for your respective branch) resolves the vulnerability.
Is notebook affected?
Yes, notebook is affected in releases prior to 6.4.12. Upgrade your dependency to 6.4.12 or later.
What is the CVSS score of CVE-2022-29238?
CVE-2022-29238 has a CVSS v3.1 base score of 4.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2022-29238?
CVE-2022-29238 is classified under CWE-425: Direct Request ('Forced Browsing') (The web application does not adequately enforce appropriate authorization on all restricted URLs, scripts, or files.).
How can I check PyPI dependencies for CVE-2022-29238?
Run the dependency tree command: 'pip show notebook'. 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-v7vq-3x77-87vg",
  "modified" : "2022-06-16T23:10:10Z",
  "published" : "2022-06-16T23:10:10Z",
  "aliases" : [ "CVE-2022-29238" ],
  "summary" : "Token bruteforcing.",
  "details" : "### Impact\n_What kind of vulnerability is it? Who is impacted?_\n\nAuthenticated requests to the notebook server with `ContentsManager.allow_hidden = False` only prevented listing the contents of hidden directories, not accessing individual hidden files or files in hidden directories (i.e. hidden files were 'hidden' but not 'inaccessible'). This could lead to notebook configurations allowing authenticated access to files that may reasonably be expected to be disallowed.\n\nBecause fully authenticated requests are required, this is of relatively low impact. But if a server's root directory contains sensitive files whose only protection from the server is being hidden (e.g. `~/.ssh` while serving $HOME), then any authenticated requests could access files if their names are guessable. Such contexts also necessarily have full access to the server and therefore execution permissions, which also generally grants access to all the same files. So this does not generally result in any privilege escalation or increase in information access, only an additional, unintended _means_ by which the files could be accessed.\n\n### Patches\n_Has the problem been patched? What versions should users upgrade to?_\n\nnotebook 6.4.12\n\n### Workarounds\n_Is there a way for users to fix or remediate the vulnerability without upgrading?_\n\n- Do not run the notebook server in a directory with hidden files, use subdirectories\n- Use a custom ContentsManager with additional checks for `self.is_hidden(path)` prior to completing actions\n\n### References\n_Are there any links users can visit to find out more?_\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [example link to repo](http://example.com)\n* Email us at [example email address](mailto:example@example.com)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "notebook"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.4.12"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/jupyter/notebook/security/advisories/GHSA-v7vq-3x77-87vg"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-29238"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/jupyter/notebook"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/notebook/PYSEC-2022-212.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-425" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-06-16T23:10:10Z",
    "nvd_published_at" : "2022-06-14T18:15:00Z"
  }
}