CVE-2023-41626: Gradio Gradio Arbitrary File Upload Vulnerability Vulnerability

MODERATE
Advisory Identifier: GHSA-v4q9-qgqf-7jwp
CVSS 4.8
CWE-434
Published
Advisory Summary

CVE-2023-41626 is a MODERATE (CVSS 4.8) gradio arbitrary file upload vulnerability vulnerability (CWE-434: Unrestricted Upload of File with Dangerous Type) affecting Gradio libraries in the PyPI ecosystem. The issue involves gradio arbitrary file upload vulnerability. Remediation is available in the latest vendor maintenance releases.

CVE-2023-41626 at a Glance

CVE Identifier CVE-2023-41626
GHSA Identifier GHSA-v4q9-qgqf-7jwp
Severity MODERATE
CVSS v3.1 Base Score 4.8
CWE Classification CWE-434: Unrestricted Upload of File with Dangerous Type
Affected Product Gradio
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 4.8

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:L/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 Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2023-41626

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-2023-41626, 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-434: Unrestricted Upload of File with Dangerous Type, where the product allows the upload or transfer of dangerous file types that are automatically processed within its environment. 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

Gradio v3.27.0 was discovered to contain an arbitrary file upload vulnerability via the `/upload` interface.

CVE-2023-41626 Affected Gradio Versions

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

References

Frequently Asked Questions

What is CVE-2023-41626?
CVE-2023-41626 is a security vulnerability in Gradio involving Gradio arbitrary file upload vulnerability under CWE-434: Unrestricted Upload of File with Dangerous Type.
Which Gradio versions are affected?
Affected versions include releases prior to current release patches across affected packages: gradio.
What version fixes CVE-2023-41626?
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-2023-41626?
CVE-2023-41626 has a CVSS v3.1 base score of 4.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2023-41626?
CVE-2023-41626 is classified under CWE-434: Unrestricted Upload of File with Dangerous Type (The product allows the upload or transfer of dangerous file types that are automatically processed within its environment.).
How can I check PyPI dependencies for CVE-2023-41626?
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-v4q9-qgqf-7jwp",
  "modified" : "2023-09-21T17:12:02Z",
  "published" : "2023-09-16T00:30:30Z",
  "aliases" : [ "CVE-2023-41626" ],
  "summary" : "Gradio arbitrary file upload vulnerability",
  "details" : "Gradio v3.27.0 was discovered to contain an arbitrary file upload vulnerability via the `/upload` interface.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "gradio"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "3.27.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-41626"
  }, {
    "type" : "WEB",
    "url" : "https://gist.github.com/impose1/590472eb0544ef1ec36c8a5a40122adb"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/gradio-app/gradio"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-434" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-09-21T17:12:02Z",
    "nvd_published_at" : "2023-09-15T23:15:07Z"
  }
}