CVE-2022-35918: Streamlit: path traversal leaks server filesystem
MEDIUMStreamlit apps using custom components allow unauthenticated attackers to read arbitrary server files — including API keys, credentials, and model configs — via crafted URLs. Upgrade to 1.11.1 immediately; no workarounds exist. Treat this as high-priority if your ML teams run Streamlit on servers co-located with LLM API keys, cloud credentials, or training data.
What is the risk?
CVSS 6.5 Medium understates real-world risk in ML environments. Streamlit servers typically run with broad filesystem access alongside .env files containing LLM API keys (OpenAI, Anthropic), cloud credentials, and database connection strings. Exploitation requires only network access and a crafted URL — no authentication, no specialized knowledge. The 'user interaction required' flag reflects one attack path but direct server-side exploitation is equally viable.
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| Streamlit | pip | — | No patch |
Do you use Streamlit? You're affected.
How severe is it?
What is the attack surface?
What should I do?
6 steps-
Upgrade to Streamlit >= 1.11.1 — patching is the only fix.
-
Audit running versions:
pip show streamlit | grep Versionacross all environments. -
Search logs for path traversal patterns: ../, %2e%2e%2f, and double-encoded variants in URL parameters.
-
Rotate any secrets (LLM API keys, DB credentials, cloud tokens) accessible on affected servers.
-
Restrict Streamlit process filesystem permissions to only required directories.
-
Place internal Streamlit instances behind an authenticated reverse proxy.
What does CISA's SSVC say?
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2022-35918?
Streamlit apps using custom components allow unauthenticated attackers to read arbitrary server files — including API keys, credentials, and model configs — via crafted URLs. Upgrade to 1.11.1 immediately; no workarounds exist. Treat this as high-priority if your ML teams run Streamlit on servers co-located with LLM API keys, cloud credentials, or training data.
Is CVE-2022-35918 actively exploited?
No confirmed active exploitation of CVE-2022-35918 has been reported, but organizations should still patch proactively.
How to fix CVE-2022-35918?
1. Upgrade to Streamlit >= 1.11.1 — patching is the only fix. 2. Audit running versions: `pip show streamlit | grep Version` across all environments. 3. Search logs for path traversal patterns: ../, %2e%2e%2f, and double-encoded variants in URL parameters. 4. Rotate any secrets (LLM API keys, DB credentials, cloud tokens) accessible on affected servers. 5. Restrict Streamlit process filesystem permissions to only required directories. 6. Place internal Streamlit instances behind an authenticated reverse proxy.
What systems are affected by CVE-2022-35918?
This vulnerability affects the following AI/ML architecture patterns: ML UI dashboards, model serving interfaces, data science platforms, internal ML tooling, prototype ML deployments.
What is the CVSS score for CVE-2022-35918?
CVE-2022-35918 has a CVSS v3.1 base score of 6.5 (MEDIUM). The EPSS exploitation probability is 1.32%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0025 Exfiltration via Cyber Means AML.T0035 AI Artifact Collection AML.T0037 Data from Local System AML.T0049 Exploit Public-Facing Application AML.T0055 Unsecured Credentials Compliance Controls Affected
What are the technical details?
Original Advisory
Streamlit is a data oriented application development framework for python. Users hosting Streamlit app(s) that use custom components are vulnerable to a directory traversal attack that could leak data from their web server file-system such as: server logs, world readable files, and potentially other sensitive information. An attacker can craft a malicious URL with file paths and the streamlit server would process that URL and return the contents of that file. This issue has been resolved in version 1.11.1. Users are advised to upgrade. There are no known workarounds for this issue.
Exploitation Scenario
An adversary targeting an ML team discovers an internal Streamlit dashboard via subdomain enumeration or a leaked internal URL. They craft a request with path traversal sequences targeting common credential locations (/home/user/.env, /app/.env, /etc/passwd, ~/.aws/credentials). Since ML pipeline servers often store OpenAI or Anthropic API keys alongside Streamlit apps, a successful traversal yields credentials enabling broader infrastructure compromise — pivoting from a data science UI to cloud account takeover.
Weaknesses (CWE)
CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Primary
CWE-22 Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') 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.
- [Implementation] Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylis
- [Architecture and Design] For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N References
Timeline
Related Vulnerabilities
CVE-2024-41115 9.8 streamlit-geospatial: eval() injection enables RCE
Same package: streamlit CVE-2024-41114 9.8 streamlit-geospatial: RCE via eval() on palette input
Same package: streamlit CVE-2024-41113 9.8 streamlit-geospatial: RCE via eval() in Timelapse page
Same package: streamlit CVE-2024-41112 9.8 streamlit-geospatial: RCE via eval() on palette input
Same package: streamlit CVE-2024-41116 9.8 streamlit-geospatial: RCE via eval() injection
Same package: streamlit