# CVE-2023-27494: Streamlit Cross-site Scripting vulnerability

> Attackers can execute arbitrary JavaScript in users' browsers via malicious URLs in Streamlit apps, potentially leading to session hijacking or data theft.

- **Severity:** Medium 5.9 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:L/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:** 16 Mar 2023
- **Updated:** 25 Feb 2025
- **Also known as:** GHSA-9c6g-qpgj-rvxw, PYSEC-2023-50

## What is CVE-2023-27494?

CVE-2023-27494 is a medium-severity cross-site scripting vulnerability in streamlit, published on 16 Mar 2023. 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, software for turning data scripts into web applications, had a cross-site scripting (XSS) vulnerability in versions 0.63.0 through 0.80.0. Users of hosted Streamlit app(s) were vulnerable to a reflected XSS vulnerability. An attacker could craft a malicious URL with Javascript payloads to a Streamlit app. The attacker could then trick the user into visiting the malicious URL and, if successful, the server would render the malicious javascript payload as-is, leading to XSS. Version 0.81.0 contains a patch for this vulnerability.

Weakness: CWE-79 (Improper Neutralization of Input During Web Page Generation)

## Which versions are affected by CVE-2023-27494?

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 | 0.81.0 |
| `streamlit` | PyPI | From 0.63.0 | 0.81.0 |
| `streamlit` | PyPI | From 0.63.0 | 0.81.0 |

Products: Snowflake Streamlit.

## How do I fix CVE-2023-27494?

Upgrade streamlit to 0.81.0 or later.

## Is CVE-2023-27494 being exploited?

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

## Other vulnerabilities in streamlit

- [CVE-2022-35918](https://insights.sbomify.com/CVE-2022-35918/): Streamlit directory traversal vulnerability (medium 6.5)
- [CVE-2024-42474](https://insights.sbomify.com/CVE-2024-42474/): Streamlit Path Traversal Security Vulnerability on Windows (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-2023-27494 and fix it if it is affected.

What it is: CVE-2023-27494 is a medium-severity cross-site scripting vulnerability in streamlit, published on 16 Mar 2023. 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-2023-27494 in the wild and no public exploit code.

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

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-2023-27494/ (Markdown: https://insights.sbomify.com/CVE-2023-27494/index.md)
```

## Sources

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

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