CVE-2024-42474: Streamlit Path Traveral Vulnerability
MODERATECVE-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
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).
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.
pip install streamlit>=1.37.0
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
CVE-2024-42474 Affected Streamlit Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
streamlit
|
PyPI |
< 1.37.0
|
1.37.0
|
References
Frequently Asked Questions
What is CVE-2024-42474?
Which Streamlit versions are affected?
What version fixes CVE-2024-42474?
Is streamlit affected?
What is the CVSS score of CVE-2024-42474?
What CWE is associated with CVE-2024-42474?
How can I check PyPI dependencies for CVE-2024-42474?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}