CVE-2023-34239: Gradio Gradio Vulnerable To Arbitrary File Vulnerability

MODERATE
Advisory Identifier: GHSA-3qqg-pgqq-3695
CVSS 7.3
CWE-20
Published
Advisory Summary

CVE-2023-34239 is a MODERATE (CVSS 7.3) gradio vulnerable to arbitrary file vulnerability (CWE-20: Improper Input Validation) affecting Gradio libraries in the PyPI ecosystem. The issue involves gradio vulnerable to arbitrary file read and proxying of arbitrary urls. Remediation is available by upgrading affected packages to version 3.34.0.

CVE-2023-34239 at a Glance

CVE Identifier CVE-2023-34239
GHSA Identifier GHSA-3qqg-pgqq-3695
Severity MODERATE
CVSS v3.1 Base Score 7.3
CWE Classification CWE-20: Improper Input Validation
Affected Product Gradio
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.3

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

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

How to Fix CVE-2023-34239

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: 3.34.0
pip install gradio>=3.34.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 gradio

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2023-34239, 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 3.34.0), 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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. 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

### Impact There are two separate security vulnerabilities here: (1) a security vulnerability that allows users to read arbitrary files on the machines that are running shared Gradio apps (2) the ability of users to use machines that are sharing Gradio apps to proxy arbitrary URLs ### Patches Both problems have been solved, please upgrade `gradio` to `3.34.0` or higher ### Workarounds Not possible to workaround except by taking down any shared Gradio apps ### References Relevant PRs: * https://github.com/gradio-app/gradio/pull/4406 * https://github.com/gradio-app/gradio/pull/4370

CVE-2023-34239 Affected Gradio Versions

1 component(s)
Fixed Versions:
3.34.0
Product / Package Ecosystem Affected Versions Fixed Version
gradio
PyPI
< 3.34.0
3.34.0

References

Frequently Asked Questions

What is CVE-2023-34239?
CVE-2023-34239 is a security vulnerability in Gradio involving Gradio vulnerable to arbitrary file read and proxying of arbitrary URLs under CWE-20: Improper Input Validation.
Which Gradio versions are affected?
Affected versions include releases prior to 3.34.0 across affected packages: gradio.
What version fixes CVE-2023-34239?
Upgrading to 3.34.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is gradio affected?
Yes, gradio is affected in releases prior to 3.34.0. Upgrade your dependency to 3.34.0 or later.
What is the CVSS score of CVE-2023-34239?
CVE-2023-34239 has a CVSS v3.1 base score of 7.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L.
What CWE is associated with CVE-2023-34239?
CVE-2023-34239 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check PyPI dependencies for CVE-2023-34239?
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-3qqg-pgqq-3695",
  "modified" : "2024-09-20T21:19:30Z",
  "published" : "2023-06-09T22:51:19Z",
  "aliases" : [ "CVE-2023-34239" ],
  "summary" : "Gradio vulnerable to arbitrary file read and proxying of arbitrary URLs",
  "details" : "### Impact\nThere are two separate security vulnerabilities here: (1) a security vulnerability that allows users to read arbitrary files on the machines that are running shared Gradio apps (2) the ability of users to use machines that are sharing Gradio apps to proxy arbitrary URLs\n\n### Patches\nBoth problems have been solved, please upgrade `gradio` to `3.34.0` or higher\n\n### Workarounds\nNot possible to workaround except by taking down any shared Gradio apps\n\n### References\nRelevant PRs:\n* https://github.com/gradio-app/gradio/pull/4406\n* https://github.com/gradio-app/gradio/pull/4370",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "gradio"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.34.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/gradio-app/gradio/security/advisories/GHSA-3qqg-pgqq-3695"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-34239"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gradio-app/gradio/pull/4370"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gradio-app/gradio/pull/4406"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gradio-app/gradio/commit/37967617bd97615fb6f3b44e7750c0e0be58479a"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gradio-app/gradio/commit/37967617bd97615fb6f3b44e7750c0e0be58479a#diff-324a7165f5d5a8823a28b76f5653fa45f32c8144c82b2e528882c97c7eae534f"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gradio-app/gradio/commit/cd64130d54e678525774bbb200ef9c7166fa1543"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/gradio-app/gradio"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/gradio/PYSEC-2023-90.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-06-09T22:51:19Z",
    "nvd_published_at" : "2023-06-08T00:15:09Z"
  }
}