CVE-2023-27494: Streamlit: reflected XSS enables session hijacking

MEDIUM
Published March 16, 2023
CISO Take

Any team hosting Streamlit apps on versions 0.63.0–0.80.0 is exposed to reflected XSS via crafted URLs — a realistic credential theft vector targeting ML engineers and data scientists. Upgrade to 0.81.0 immediately. Priority is elevated if Streamlit instances are exposed externally or used as front-ends for internal ML tooling accessible by broad audiences.

Risk Assessment

Medium severity (CVSS 6.1) but contextually significant in AI/ML environments where Streamlit is pervasive for rapid prototyping and internal tooling. The attack requires no authentication and minimal technical skill; an adversary only needs to craft a malicious URL and socially engineer a click. Exposure is highest for organizations publishing Streamlit apps externally or sharing demo links broadly within the company. The lack of CISA KEV listing and the user-interaction requirement keep overall risk moderate.

Affected Systems

Package Ecosystem Vulnerable Range Patched
streamlit pip No patch
44.5K OpenSSF 7.2 2.8K dependents Pushed today 8% patched ~0d to patch Full package profile →

Do you use streamlit? You're affected.

Severity & Risk

CVSS 3.1
6.1 / 10
EPSS
0.7%
chance of exploitation in 30 days
Higher than 72% of all CVEs
Exploitation Status
No known exploitation
Sophistication
Trivial

Attack Surface

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

Recommended Action

1 step
  1. 1) Upgrade Streamlit to 0.81.0 or later — this is the only definitive fix. 2) If immediate patching is blocked, deploy a WAF rule to reject or sanitize requests containing JavaScript patterns in URL query parameters. 3) Implement a Content Security Policy (CSP) header to block inline script execution. 4) Audit all Streamlit instances across your environment; prioritize any exposed to external or untrusted users. 5) Review access logs for anomalous URL patterns containing script tags, event handlers, or URL-encoded JavaScript. 6) Enforce least-privilege browser sessions for internal ML tooling users.

CISA SSVC Assessment

Decision Track
Exploitation none
Automatable No
Technical Impact partial

Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.

Classification

Compliance Impact

This CVE is relevant to:

ISO 42001
A.8.4 - Information security for AI systems
NIST AI RMF
MANAGE-2.2 - Risk Treatment
OWASP LLM Top 10
LLM02 - Insecure Output Handling

Frequently Asked Questions

What is CVE-2023-27494?

Any team hosting Streamlit apps on versions 0.63.0–0.80.0 is exposed to reflected XSS via crafted URLs — a realistic credential theft vector targeting ML engineers and data scientists. Upgrade to 0.81.0 immediately. Priority is elevated if Streamlit instances are exposed externally or used as front-ends for internal ML tooling accessible by broad audiences.

Is CVE-2023-27494 actively exploited?

No confirmed active exploitation of CVE-2023-27494 has been reported, but organizations should still patch proactively.

How to fix CVE-2023-27494?

1) Upgrade Streamlit to 0.81.0 or later — this is the only definitive fix. 2) If immediate patching is blocked, deploy a WAF rule to reject or sanitize requests containing JavaScript patterns in URL query parameters. 3) Implement a Content Security Policy (CSP) header to block inline script execution. 4) Audit all Streamlit instances across your environment; prioritize any exposed to external or untrusted users. 5) Review access logs for anomalous URL patterns containing script tags, event handlers, or URL-encoded JavaScript. 6) Enforce least-privilege browser sessions for internal ML tooling users.

What systems are affected by CVE-2023-27494?

This vulnerability affects the following AI/ML architecture patterns: ML dashboards and demo applications, Model inference UIs, Data exploration and visualization tools, Internal MLOps portals.

What is the CVSS score for CVE-2023-27494?

CVE-2023-27494 has a CVSS v3.1 base score of 6.1 (MEDIUM). The EPSS exploitation probability is 0.70%.

Technical Details

NVD 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.

Exploitation Scenario

An adversary identifies a target organization hosting a Streamlit-based ML demo or internal model dashboard on a vulnerable version. They craft a URL embedding a JavaScript payload (e.g., a cookie-stealing script or credential-phishing redirect) and deliver it via phishing email, Slack message, or a GitHub comment targeting ML engineers. When the victim clicks the link, the Streamlit server reflects the unsanitized payload directly into the page response, the browser executes the JavaScript, and the attacker captures session tokens or redirects the victim to a credential harvesting page — gaining persistent access to internal ML tooling or connected enterprise systems.

Weaknesses (CWE)

CVSS Vector

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Timeline

Published
March 16, 2023
Last Modified
November 21, 2024
First Seen
March 16, 2023

Related Vulnerabilities