CVE-2025-5320: Gradio Gradio CORS Origin Validation Bypass Vulnerability

LOW
Advisory Identifier: GHSA-wmjh-cpqj-4v6x
CVSS 3.7
CWE-345
Published
Advisory Summary

CVE-2025-5320 is a LOW (CVSS 3.7) gradio cors origin validation bypass vulnerability (CWE-345: Insufficient Verification of Data Authenticity) affecting Gradio libraries in the PyPI ecosystem. The issue involves gradio cors origin validation bypass vulnerability. Remediation is available in the latest vendor maintenance releases.

CVE-2025-5320 at a Glance

CVE Identifier CVE-2025-5320
GHSA Identifier GHSA-wmjh-cpqj-4v6x
Severity LOW
CVSS v3.1 Base Score 3.7
CWE Classification CWE-345: Insufficient Verification of Data Authenticity
Affected Product Gradio
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 3.7

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

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

How to Fix CVE-2025-5320

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

gradio fixed: Latest secure release
pip install gradio>=Latest secure release
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 gradio

How to Check if You Are Affected

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

pip show gradio

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-345: Insufficient Verification of Data Authenticity, where the product does not sufficiently verify the origin or authenticity of data, in a way that causes it to accept invalid data. In Gradio, 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

A vulnerability classified as problematic has been found in gradio-app gradio up to 5.29.1. This affects the function is_valid_origin of the component CORS Handler. The manipulation of the argument localhost_aliases leads to origin validation error. It is possible to initiate the attack remotely. The complexity of an attack is rather high. The exploitability is told to be difficult. The exploit has been disclosed to the public and may be used. The vendor was contacted early about this disclosure but did not respond in any way.

CVE-2025-5320 Affected Gradio Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
gradio
PyPI
≥ 5.0.0
≤ 5.29.1

References

Frequently Asked Questions

What is CVE-2025-5320?
CVE-2025-5320 is a security vulnerability in Gradio involving Gradio CORS Origin Validation Bypass Vulnerability under CWE-345: Insufficient Verification of Data Authenticity.
Which Gradio versions are affected?
Affected versions include releases prior to current release patches across affected packages: gradio.
What version fixes CVE-2025-5320?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is gradio affected?
Yes, gradio is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2025-5320?
CVE-2025-5320 has a CVSS v3.1 base score of 3.7 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2025-5320?
CVE-2025-5320 is classified under CWE-345: Insufficient Verification of Data Authenticity (The product does not sufficiently verify the origin or authenticity of data, in a way that causes it to accept invalid data.).
How can I check PyPI dependencies for CVE-2025-5320?
Run the dependency tree command: 'pip show gradio'. 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-wmjh-cpqj-4v6x",
  "modified" : "2025-06-05T00:22:23Z",
  "published" : "2025-05-29T15:31:09Z",
  "aliases" : [ "CVE-2025-5320" ],
  "summary" : "Gradio CORS Origin Validation Bypass Vulnerability",
  "details" : "A vulnerability classified as problematic has been found in gradio-app gradio up to 5.29.1. This affects the function is_valid_origin of the component CORS Handler. The manipulation of the argument localhost_aliases leads to origin validation error. It is possible to initiate the attack remotely. The complexity of an attack is rather high. The exploitability is told to be difficult. The exploit has been disclosed to the public and may be used. The vendor was contacted early about this disclosure but did not respond in any way.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:P"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "gradio"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0"
      }, {
        "last_affected" : "5.29.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-5320"
  }, {
    "type" : "WEB",
    "url" : "https://gist.github.com/superboy-zjc/aa3dfa161d7b19d8a53ab4605792f2fe"
  }, {
    "type" : "WEB",
    "url" : "https://gist.github.com/superboy-zjc/aa3dfa161d7b19d8a53ab4605792f2fe#proof-of-concept-poc"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/gradio-app/gradio"
  }, {
    "type" : "WEB",
    "url" : "https://vuldb.com/?ctiid.310491"
  }, {
    "type" : "WEB",
    "url" : "https://vuldb.com/?id.310491"
  }, {
    "type" : "WEB",
    "url" : "https://vuldb.com/?submit.580250"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-345" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-06-05T00:22:23Z",
    "nvd_published_at" : "2025-05-29T14:15:38Z"
  }
}