CVE-2024-1729: Gradio Gradio Apps Vulnerable To Timing Vulnerability

MODERATE
Advisory Identifier: GHSA-hmx6-r76c-85g9
CVSS 5.9
CWE-367
Published
Advisory Summary

CVE-2024-1729 is a MODERATE (CVSS 5.9) gradio apps vulnerable to timing vulnerability (CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition) affecting Gradio libraries in the PyPI ecosystem. The issue involves gradio apps vulnerable to timing attacks to guess password. Remediation is available by upgrading affected packages to version 4.19.2.

CVE-2024-1729 at a Glance

CVE Identifier CVE-2024-1729
GHSA Identifier GHSA-hmx6-r76c-85g9
Severity MODERATE
CVSS v3.1 Base Score 5.9
CWE Classification CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition
Affected Product Gradio
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:N/S:U/C:H/I:N/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 High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2024-1729

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: 4.19.2
pip install gradio>=4.19.2
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-2024-1729, 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 4.19.2), 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-367: Time-of-check Time-of-use (TOCTOU) Race Condition, where the product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check. 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 This security policy is with regards to a timing attack that allows users of Gradio apps to potentially guess the password of password-protected Gradio apps. This relies on the fact that string comparisons in Python terminate early, as soon as there is a string mismatch. Because Gradio apps are, by default, not rate-limited, a user could brute-force millions of guesses to figure out the correct username and password. ### Patches Yes, the problem has been patched in Gradio version 4.19.2 or higher. We have no knowledge of this exploit being used against users of Gradio applications, but we encourage all users to upgrade to Gradio 4.19.2 or higher. Fixed in: https://github.com/gradio-app/gradio/commit/e329f1fd38935213fe0e73962e8cbd5d3af6e87b

CVE-2024-1729 Affected Gradio Versions

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

References

Frequently Asked Questions

What is CVE-2024-1729?
CVE-2024-1729 is a security vulnerability in Gradio involving Gradio apps vulnerable to timing attacks to guess password under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition.
Which Gradio versions are affected?
Affected versions include releases prior to 4.19.2 across affected packages: gradio.
What version fixes CVE-2024-1729?
Upgrading to 4.19.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is gradio affected?
Yes, gradio is affected in releases prior to 4.19.2. Upgrade your dependency to 4.19.2 or later.
What is the CVSS score of CVE-2024-1729?
CVE-2024-1729 has a CVSS v3.1 base score of 5.9 (MODERATE) with vector string CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2024-1729?
CVE-2024-1729 is classified under CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition (The product checks the state of a resource before using that resource, but the resource's state can change between the check and the use in a way that invalidates the results of the check.).
How can I check PyPI dependencies for CVE-2024-1729?
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-hmx6-r76c-85g9",
  "modified" : "2024-03-29T14:00:36Z",
  "published" : "2024-02-22T22:09:22Z",
  "aliases" : [ "CVE-2024-1729" ],
  "summary" : "Gradio apps vulnerable to timing attacks to guess password",
  "details" : "### Impact\nThis security policy is with regards to a timing attack that allows users of Gradio apps to potentially guess the password of password-protected Gradio apps. This relies on the fact that string comparisons in Python terminate early, as soon as there is a string mismatch. Because Gradio apps are, by default, not rate-limited, a user could brute-force millions of guesses to figure out the correct username and password.\n\n### Patches\nYes, the problem has been patched in Gradio version 4.19.2 or higher. We have no knowledge of this exploit being used against users of Gradio applications, but we encourage all users to upgrade to Gradio 4.19.2 or higher.\n\nFixed in: https://github.com/gradio-app/gradio/commit/e329f1fd38935213fe0e73962e8cbd5d3af6e87b",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "gradio"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.19.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/gradio-app/gradio/security/advisories/GHSA-hmx6-r76c-85g9"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-1729"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gradio-app/gradio/commit/e329f1fd38935213fe0e73962e8cbd5d3af6e87b"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/gradio-app/gradio"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gradio-app/gradio/releases/tag/gradio%404.19.2"
  }, {
    "type" : "WEB",
    "url" : "https://huntr.com/bounties/f6a10a8d-f538-4cb7-9bb2-85d9f5708124"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-367" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-02-22T22:09:22Z",
    "nvd_published_at" : "2024-03-29T05:15:45Z"
  }
}