CVE-2024-42474: Streamlit Path Traveral Vulnerability

MODERATE
Advisory Identifier: GHSA-rxff-vr5r-8cj5
CVSS 5.9
CWE-22
Published
Advisory Summary

CVE-2024-42474 is a MODERATE (CVSS 5.9) path traveral vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Streamlit libraries in the PyPI ecosystem. The issue involves path traveral in streamlit on windows. Remediation is available by upgrading affected packages to version 1.37.0.

CVE-2024-42474 at a Glance

CVE Identifier CVE-2024-42474
GHSA Identifier GHSA-rxff-vr5r-8cj5
Severity MODERATE
CVSS v3.1 Base Score 5.9
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Streamlit
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 5.9

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

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

How to Fix CVE-2024-42474

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

streamlit fixed: 1.37.0
pip install streamlit>=1.37.0
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 streamlit

How to Check if You Are Affected

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

pip show streamlit

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. In Streamlit, 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

### 1. Impacted Products Streamilt Open Source versions before 1.37.0. ### 2. Introduction Snowflake Streamlit open source addressed a security vulnerability via the [static file sharing feature](https://docs.streamlit.io/develop/concepts/configuration/serving-static-files). The vulnerability was patched on Jul 25, 2024, as part of Streamlit open source version 1.37.0. The vulnerability only affects Windows. ### 3. Path Traversal Vulnerability #### 3.1 Description On May 12, 2024, Streamlit was informed via our bug bounty program about a path traversal vulnerability in the open source library. We fixed and merged a patch remediating the vulnerability on Jul 25, 2024. The issue was determined to be in the moderate severity range with a maximum CVSSv3 base score of [5.9](https://www.first.org/cvss/calculator/3.0#CVSS:3.0/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:N) #### 3.2 Scenarios and attack vector(s) Users of hosted Streamlit app(s) on Windows were vulnerable to a path traversal vulnerability when the [static file sharing feature](https://docs.streamlit.io/develop/concepts/configuration/serving-static-files) is enabled. An attacker could utilize the vulnerability to leak the password hash of the Windows user running Streamlit. #### 3.3 Resolution The vulnerability has been fixed in all Streamlit versions released since Jul 25, 2024. We recommend all users upgrade to Version 1.37.0. ### 4. Contact Please contact security@snowflake.com if you have any questions regarding this advisory. If you discover a security vulnerability in one of our products or websites, please report the issue to HackerOne. For more information, please see our [Vulnerability Disclosure Policy](https://hackerone.com/snowflake?type=team).

CVE-2024-42474 Affected Streamlit Versions

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

References

Frequently Asked Questions

What is CVE-2024-42474?
CVE-2024-42474 is a security vulnerability in Streamlit involving Path traveral in Streamlit on windows under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Streamlit versions are affected?
Affected versions include releases prior to 1.37.0 across affected packages: streamlit.
What version fixes CVE-2024-42474?
Upgrading to 1.37.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is streamlit affected?
Yes, streamlit is affected in releases prior to 1.37.0. Upgrade your dependency to 1.37.0 or later.
What is the CVSS score of CVE-2024-42474?
CVE-2024-42474 has a CVSS v3.1 base score of 5.9 (MODERATE) with vector string CVSS:3.0/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:N.
What CWE is associated with CVE-2024-42474?
CVE-2024-42474 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check PyPI dependencies for CVE-2024-42474?
Run the dependency tree command: 'pip show streamlit'. 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-rxff-vr5r-8cj5",
  "modified" : "2024-11-26T18:52:17Z",
  "published" : "2024-08-12T18:35:12Z",
  "aliases" : [ "CVE-2024-42474" ],
  "summary" : "Path traveral in Streamlit on windows",
  "details" : "### 1. Impacted Products\nStreamilt Open Source versions before 1.37.0.\n\n### 2. Introduction\nSnowflake Streamlit open source addressed a security vulnerability via the [static file sharing feature](https://docs.streamlit.io/develop/concepts/configuration/serving-static-files). The vulnerability was patched on Jul 25, 2024, as part of Streamlit open source version 1.37.0. The vulnerability only affects Windows.\n\n### 3. Path Traversal Vulnerability \n#### 3.1 Description\nOn May 12, 2024, Streamlit was informed via our bug bounty program about a path traversal vulnerability in the open source library. We fixed and merged a patch remediating the vulnerability on Jul 25, 2024. The issue was determined to be in the moderate severity range with a maximum CVSSv3 base score of [5.9](https://www.first.org/cvss/calculator/3.0#CVSS:3.0/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:N)\n#### 3.2 Scenarios and attack vector(s)\nUsers of hosted Streamlit app(s) on Windows were vulnerable to a path traversal vulnerability when the [static file sharing feature](https://docs.streamlit.io/develop/concepts/configuration/serving-static-files) is enabled. An attacker could utilize the vulnerability to leak the password hash of the Windows user running Streamlit. \n#### 3.3 Resolution\nThe vulnerability has been fixed in all Streamlit versions released since Jul 25, 2024. We recommend all users upgrade to Version 1.37.0.\n\n### 4. Contact\nPlease contact security@snowflake.com if you have any questions regarding this advisory. If you discover a security vulnerability in one of our products or websites, please report the issue to HackerOne. For more information, please see our [Vulnerability Disclosure Policy](https://hackerone.com/snowflake?type=team).\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "streamlit"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.37.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/streamlit/streamlit/security/advisories/GHSA-rxff-vr5r-8cj5"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-42474"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/streamlit/streamlit/commit/3a639859cfdfba2187c81897d44a3e33825eb0a3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/streamlit/PYSEC-2024-153.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/streamlit/streamlit"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-08-12T18:35:12Z",
    "nvd_published_at" : "2024-08-12T17:15:17Z"
  }
}