Skip to content

GHSA-j757-pf57-f8r4 CVE-2024-47869 PYSEC-2024-199

Gradio performs a non-constant-time comparison when comparing hashes

Low PyPI
Severity
0.0 / 10
Low · CVSS 4.0
Exploit chance (EPSS)
0.29%
Chance of exploitation in the next 30 days. Higher than 22.15% of scored vulnerabilities.
Known exploited
No
Not in CISA's catalog
Weakness
CWE-203 Observable Discrepancy
CWE-208 Observable Timing Discrepancy
Fix
4.44.0
Upgrade gradio to this version or later

Description

Impact

What kind of vulnerability is it? Who is impacted?

This vulnerability involves a timing attack in the way Gradio compares hashes for the analytics_dashboard function. Since the comparison is not done in constant time, an attacker could exploit this by measuring the response time of different requests to infer the correct hash byte-by-byte. This can lead to unauthorized access to the analytics dashboard, especially if the attacker can repeatedly query the system with different keys.

Patches

Yes, please upgrade to gradio>4.44 to mitigate this issue.

Workarounds

Is there a way for users to fix or remediate the vulnerability without upgrading?

To mitigate the risk before applying the patch, developers can manually patch the analytics_dashboard dashboard to use a constant-time comparison function for comparing sensitive values, such as hashes. Alternatively, access to the analytics dashboard can be disabled.

Affected versions

PyPI

PackageVulnerableFixed in
gradio
< 4.44.0
4.44.0

How to fix

Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.

gradio PyPI → 4.44.0

pip
pip install --upgrade "gradio>=4.44.0"
poetry
poetry add "gradio>=4.44.0"
uv
uv add "gradio>=4.44.0"

Severity breakdown

CVSS 4.0 0.0

CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N

Attack vector
Network
Attack complexity
High
Attack requirements
None
Privileges required
None
User interaction
None
Confidentiality (vulnerable system)
Low
Integrity (vulnerable system)
None
Availability (vulnerable system)
None
Confidentiality (subsequent systems)
None
Integrity (subsequent systems)
None
Availability (subsequent systems)
None

CVSS 3.1 3.7

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N

Attack vector
Network
Attack complexity
High
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
None

Weakness

CWE-203: Observable Discrepancy

The product behaves differently or sends different responses under different circumstances in a way that is observable to an unauthorized actor.

How to prevent it
  • Architecture and Design: Compartmentalize the system to have "safe" areas where trust boundaries can be unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always be careful when interfacing with a compartment outside of the safe area. Ensure that appropriate compartmentalization is built into the system design, and the compartmentalization allows for and reinforces privilege separation functionality. Architects and designers should rely on the principle of least privilege to decide the appropriate time to use privileges and the time to drop privileges.
  • Implementation: Ensure that error messages only contain minimal details that are useful to the intended audience and no one else. The messages need to strike the balance between being too cryptic (which can confuse users) or being too detailed (which may reveal more than intended). The messages should not reveal the methods that were used to determine the error. Attackers can use detailed information to refine or optimize their original attack, thereby increasing their chances of success. If errors must be captured in some detail, record them in log messages, but consider what could occur if the log messages can be viewed by attackers. Highly sensitive information such as passwords should never be saved to log files. Avoid inconsistent messaging that might accidentally tip off an attacker about internal state, such as whether a user account exists or not.

CWE-208: Observable Timing Discrepancy

Two separate operations in a product require different amounts of time to complete, in a way that is observable to an actor and reveals security-relevant information about the state of the product, such as whether a particular operation was successful or not.

References

Timeline

  1. Published
  2. Last updated by the source
  3. Latest EPSS score
AdvisorySeverityWhy it's related
GHSA-j36p-7w88-g82j
Gradio FileExplorer preprocess path traversal allows files outside root_dir to reach callbacks
High Also affects gradio
GHSA-6655-8ph2-63j3
Gradio: Audio cache key ignores metadata when saving numpy audio outputs
Low Also affects gradio
GHSA-7hp7-4p35-3cx2
Gradio contains a cookie injection vulnerability
Medium Also affects gradio
GHSA-jmh7-g254-2cq9
Gradio has SSRF via Malicious `proxy_url` Injection in `gr.load()` Config Processing
High Also affects gradio
GHSA-pfjf-5gxr-995x
Gradio has an Open Redirect in its OAuth Flow
Medium Also affects gradio
GHSA-39mp-8hj3-5c49
Gradio is Vulnerable to Absolute Path Traversal on Windows with Python 3.13+
High Also affects gradio
GHSA-h3h8-3v2v-rg7m
Gradio: Mocked OAuth Login Exposes Server Credentials and Uses Hardcoded Session Secret
Medium Also affects gradio
GHSA-8jw3-6x8j-v96g
Gradio Allows Unauthorized File Copy via Path Manipulation
High Also affects gradio
Is this in your code?

MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.

Check your repos with MergeHarbor