CVE-2023-27494: Streamlit Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-9c6g-qpgj-rvxw
CVSS 5.9
CWE-79
Published
Advisory Summary

CVE-2023-27494 is a MODERATE (CVSS 5.9) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Streamlit libraries in the PyPI ecosystem. The issue involves streamlit publishes previously-patched cross-site scripting vulnerability. Remediation is available by upgrading affected packages to version 0.81.0.

CVE-2023-27494 at a Glance

CVE Identifier CVE-2023-27494
GHSA Identifier GHSA-9c6g-qpgj-rvxw
Severity MODERATE
CVSS v3.1 Base Score 5.9
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Streamlit
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 5.9

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2023-27494

To remediate this vulnerability, upgrade all affected Streamlit dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

streamlit fixed: 0.81.0
pip install streamlit>=0.81.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show streamlit

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2023-27494, inspect your installed packages using pip:

pip show streamlit

Analyze the terminal output to locate any version of Streamlit in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.81.0), your application is affected.

Note: The pip show streamlit command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where 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. In Streamlit, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

**Synopsis:** Streamlit open source publicizes a prior security fix implemented in 2021. The vulnerability affected Streamlit versions between 0.63.0 and 0.80.0 (inclusive) and was patched on April 21, 2021. If you are using Streamlit with version before 0.63.0 or after 0.80.0, no action is required. # 1. Impacted Products Streamilt Open Source versions between 0.63.0 and 0.80.0. # 2. Introduction On April 21, 2021, Streamlit merged a patch that fixed a cross-site scripting (XSS) vulnerability in the Streamlit open source library, without an associated public advisory. The vulnerability affected Streamlit versions between 0.63.0 and 0.80.0 (inclusive), which are no longer supported. We recommend using the latest version of our library, but so long as you are not using an affected Streamlit version, no action is required. # 3. Cross Site Scripting Vulnerability ## 3.1 Description On April 20, 2021, Streamlit was informed via our support forum about a XSS vulnerability in the open source library. We fixed and merged a patch remediating the vulnerability on April 21st, 2021. The issue was determined to be in the moderate severity range with a maximum CVSSv3 base score of [5.9](https://www.first.org/cvss/calculator/3.0#CVSS:3.0/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N) ## 3.2 Scenarios and attack vector(s) 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 an XSS. ## 3.3 Our response Streamlit fixed and merged a patch for this vulnerability on April 21, 2021. The vulnerability was fixed within 24hrs of notification to Streamlit. ## 3.4 Resolution The vulnerability has been fixed in all Streamlit versions released since April 21, 2021. The affected versions – those between 0.63.0 and 0.80.0 (inclusive) – are no longer supported. We recommend always using supported versions of the Streamlit open source library. Version 1.19.0 is current as of this advisory. # 4. Contact Please contact security@snowflake.com if you have any questions regarding this advisory. If you discover a security vulnerability in one of our products or websites, please report the issue to HackerOne. For more information, please see our [Vulnerability Disclosure Policy](https://hackerone.com/snowflake?type=team).

CVE-2023-27494 Affected Streamlit Versions

1 component(s)
Fixed Versions:
0.81.0
Product / Package Ecosystem Affected Versions Fixed Version
streamlit
PyPI
≥ 0.63.0
< 0.81.0
0.81.0

References

Frequently Asked Questions

What is CVE-2023-27494?
CVE-2023-27494 is a security vulnerability in Streamlit involving Streamlit publishes previously-patched Cross-site Scripting vulnerability under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Streamlit versions are affected?
Affected versions include releases prior to 0.81.0 across affected packages: streamlit.
What version fixes CVE-2023-27494?
Upgrading to 0.81.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is streamlit affected?
Yes, streamlit is affected in releases prior to 0.81.0. Upgrade your dependency to 0.81.0 or later.
What is the CVSS score of CVE-2023-27494?
CVE-2023-27494 has a CVSS v3.1 base score of 5.9 (MODERATE) with vector string CVSS:3.0/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N.
What CWE is associated with CVE-2023-27494?
CVE-2023-27494 is classified under 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.).
How can I check PyPI dependencies for CVE-2023-27494?
Run the dependency tree command: 'pip show streamlit'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-9c6g-qpgj-rvxw",
  "modified" : "2024-10-28T14:30:47Z",
  "published" : "2023-03-17T14:43:03Z",
  "aliases" : [ "CVE-2023-27494" ],
  "summary" : "Streamlit publishes previously-patched Cross-site Scripting vulnerability",
  "details" : "**Synopsis:**  Streamlit open source publicizes a prior security fix implemented in 2021. The vulnerability affected Streamlit versions between 0.63.0 and 0.80.0 (inclusive) and was patched on April 21, 2021.  If you are using Streamlit with version before 0.63.0 or after 0.80.0, no action is required. \n# 1. Impacted Products\nStreamilt Open Source versions between 0.63.0 and 0.80.0.\n# 2. Introduction\nOn April 21, 2021, Streamlit merged a patch that fixed a cross-site scripting (XSS) vulnerability in the Streamlit open source library, without an associated public advisory.  The vulnerability affected Streamlit versions between 0.63.0 and 0.80.0 (inclusive), which are no longer supported. We recommend using the latest version of our library, but so long as you are not using an affected Streamlit version, no action is required. \n# 3. Cross Site Scripting Vulnerability \n## 3.1 Description\nOn April 20, 2021, Streamlit was informed via our support forum about a XSS vulnerability in the open source library. We fixed and merged a patch remediating the vulnerability on April 21st, 2021. The issue was determined to be in the moderate severity range with a maximum CVSSv3 base score of [5.9](https://www.first.org/cvss/calculator/3.0#CVSS:3.0/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N)\n## 3.2 Scenarios and attack vector(s)\nUsers 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 an XSS. \n## 3.3 Our response\nStreamlit fixed and merged a patch for this vulnerability on April 21, 2021. The vulnerability was fixed within 24hrs of notification to Streamlit. \n## 3.4 Resolution\nThe vulnerability has been fixed in all Streamlit versions released since April 21, 2021.  The affected versions – those between 0.63.0 and 0.80.0 (inclusive) – are no longer supported. We recommend always using supported versions of the Streamlit open source library. Version 1.19.0 is current as of this advisory. \n# 4. Contact\nPlease contact security@snowflake.com if you have any questions regarding this advisory. If you discover a security vulnerability in one of our products or websites, please report the issue to HackerOne.  For more information, please see our [Vulnerability Disclosure Policy](https://hackerone.com/snowflake?type=team).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "streamlit"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.63.0"
      }, {
        "fixed" : "0.81.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/streamlit/streamlit/security/advisories/GHSA-9c6g-qpgj-rvxw"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-27494"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/streamlit/streamlit/commit/afcf880c60e5d7538936cc2d9721b9e1bc02b075"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/streamlit/PYSEC-2023-50.yaml"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/streamlit/streamlit"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-03-17T14:43:03Z",
    "nvd_published_at" : "2023-03-16T21:15:00Z"
  }
}