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.

What is the risk?

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.

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.1 / 10
EPSS
0.4%
chance of exploitation in 30 days
Higher than 32% 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 Changed
C Low
I Low
A None

What should I do?

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.

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.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.41%.

What is the AI security impact?

Affected AI Architectures

ML dashboards and demo applicationsModel inference UIsData exploration and visualization toolsInternal MLOps portals

MITRE ATLAS Techniques

AML.T0011.003 Malicious Link
AML.T0048.003 User Harm
AML.T0049 Exploit Public-Facing Application

Compliance Controls Affected

ISO 42001: A.8.4
NIST AI RMF: MANAGE-2.2
OWASP LLM Top 10: LLM02

What are the technical details?

Original Advisory

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)

CWE-79 — Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'): The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.

  • [Architecture and Design] Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid [REF-1482]. Examples of libraries and frameworks that make it easier to generate properly encoded output include Microsoft's Anti-XSS library, the OWASP ESAPI Encoding module, and Apache Wicket.
  • [Implementation, Architecture and Design] Understand the context in which your data will be used and the encoding that will be expected. This is especially important when transmitting data between different components, or when generating outputs that can contain multiple encodings at the same time, such as web pages or multi-part mail messages. Study all expected communication protocols and data representations to determine the required encoding strategies. For any data that will be output to another web page, especially any data that was received from external inputs, use the appropriate encoding on all non-alphanumeric characters. Parts of the same output document may require different encodings, which will vary depending on whether the output is in the: etc. Note that HTML Entity Encoding is only appropriate for the HTML body. Consult the XSS Prevention Cheat Sheet [REF-724] for more details on the types of encoding and escaping that are needed. HTML body Element attributes (such as src="XYZ") URIs JavaScript sections Casca

Source: MITRE CWE corpus.

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