CVE-2022-35918: Streamlit: path traversal leaks server filesystem

MEDIUM
Published August 1, 2022
CISO Take

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.

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
45.0K OpenSSF 7.2 2.9K dependents Pushed 3d ago 7% patched ~0d to patch Full package profile →

Do you use Streamlit? You're affected.

How severe is it?

CVSS 3.1
6.5 / 10
EPSS
1.3%
chance of exploitation in 30 days
Higher than 67% of all CVEs
Exploitation Status
No known exploitation
Sophistication
Trivial

What is the attack surface?

AV AC PR UI S C I A
AV Network
AC Low
PR None
UI Required
S Unchanged
C High
I None
A None

What should I do?

6 steps
  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 does CISA's SSVC say?

Decision Track
Exploitation none
Automatable No
Technical Impact partial

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:

ISO 42001
A.6.1.2 - AI system risk assessment A.8.5 - Security of AI systems
NIST AI RMF
GOVERN 1.7 - Processes for identifying and addressing AI risks and impacts MANAGE 2.2 - Mechanisms are in place to sustain the value of deployed AI systems
OWASP LLM Top 10
LLM03:2025 - Supply Chain

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

ML UI dashboardsmodel serving interfacesdata science platformsinternal ML toolingprototype ML deployments

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

ISO 42001: A.6.1.2, A.8.5
NIST AI RMF: GOVERN 1.7, MANAGE 2.2
OWASP LLM Top 10: LLM03:2025

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'): 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

Timeline

Published
August 1, 2022
Last Modified
November 21, 2024
First Seen
August 1, 2022

Related Vulnerabilities