# CVE-2022-35918: Streamlit directory traversal vulnerability

> Attackers can read sensitive files from the server via crafted URLs in Streamlit apps using custom components, requiring an upgrade to fix.

- **Severity:** Medium 6.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 1 Aug 2022
- **Updated:** 23 Apr 2025
- **Also known as:** GHSA-v4hr-4jpx-56gc, PYSEC-2022-248

## What is CVE-2022-35918?

CVE-2022-35918 is a medium-severity path traversal vulnerability in streamlit, published on 1 Aug 2022. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

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.

Weakness: CWE-22 (Improper Limitation of a Pathname to a Restricted Directory)

## Which versions are affected by CVE-2022-35918?

3 open source packages ship an affected version, including streamlit. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `streamlit` | PyPI | From 0.63.0 | 1.11.1 |
| `streamlit` | PyPI | From 0.63.0 | 1.11.1 |
| `streamlit` | PyPI | From 0.63.0 | 1.11.1 |

Products: Snowflake Streamlit.

## How do I fix CVE-2022-35918?

Upgrade streamlit to 1.11.1 or later.

## Is CVE-2022-35918 being exploited?

There is no known exploitation of CVE-2022-35918 in the wild and no public exploit code.

## Other vulnerabilities in streamlit

- [CVE-2024-42474](https://insights.sbomify.com/CVE-2024-42474/): Streamlit Path Traversal Security Vulnerability on Windows (medium 5.9)
- [CVE-2023-27494](https://insights.sbomify.com/CVE-2023-27494/): Streamlit Cross-site Scripting vulnerability (medium 5.9)
- [CVE-2026-33682](https://insights.sbomify.com/CVE-2026-33682/): Streamlit on Windows has Unauthenticated SSRF Vulnerability (NTLM Credential Exposure) (medium 4.7)
- [CVE-2026-10804](https://insights.sbomify.com/CVE-2026-10804/): Streamlit Palette hashing.py weak hash (low 2.0)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2022-35918 and fix it if it is affected.

What it is: CVE-2022-35918 is a medium-severity path traversal vulnerability in streamlit, published on 1 Aug 2022. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2022-35918 in the wild and no public exploit code.

Affected packages and fixed versions:
- streamlit (PyPI): affected from 0.63.0; fixed in 1.11.1
- streamlit (PyPI): affected from 0.63.0; fixed in 1.11.1
- streamlit (PyPI): affected from 0.63.0; fixed in 1.11.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2022-35918/ (Markdown: https://insights.sbomify.com/CVE-2022-35918/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2022-35918
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2022-35918
- OSV: https://osv.dev/vulnerability/CVE-2022-35918

---
From sbomify Insights: https://insights.sbomify.com/CVE-2022-35918/
Summaries are generated and may contain mistakes; the official description above is the record.
