CVE-2025-5320: Gradio Gradio CORS Origin Validation Bypass Vulnerability
LOWCVE-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
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).
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.
pip install gradio>=Latest secure release
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
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?
Which Gradio versions are affected?
What version fixes CVE-2025-5320?
Is gradio affected?
What is the CVSS score of CVE-2025-5320?
What CWE is associated with CVE-2025-5320?
How can I check PyPI dependencies for CVE-2025-5320?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"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"
}
}