CyberSecBulletin
CVE-2024-1561NVD status: Analyzed

gradio-app/gradio: Path Traversal: '..filename'

CVE-2024-1561 is a high-severity path traversal: '..filename' vulnerability in gradio-app/gradio from Gradio-app, with a CVSS 3.0 base score of 7.5 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, without any action from a user. The record lists version 4.13.0 as the first without the flaw, so updating gradio-app/gradio to that release or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 9.31% chance of exploitation within 30 days, which is in the top 4.55% of all scored CVEs.

Next patch cycle

High severity with no evidence of exploitation so far.

What to do

  1. Update gradio-app/gradio to 4.13.0 or a later version.
  2. Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.

Affected products and versions

VendorProductAffected versionsFixed in
Gradio-appgradio-app/gradiobefore 4.13.04.13.0
Gradio Projectgradio4.12.0Not stated

Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.

How the severity score breaks down

Attack vector
NetworkCan be exploited remotely over a network, including the internet.
Attack complexity
LowNo special conditions are needed; the attack works reliably.
Privileges required
NoneNo account or login is needed.
User interaction
NoneNo action by a victim is required.
Scope
UnchangedImpact stays within the vulnerable component.
Confidentiality
HighAll data handled by the component can be read.
Integrity
NoneNothing can be modified.
Availability
NoneAvailability is not affected.

Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N. Scored by CNA (huntr.dev).

Official description

An issue was discovered in gradio-app/gradio, where the `/component_server` endpoint improperly allows the invocation of any method on a `Component` class with attacker-controlled arguments. Specifically, by exploiting the `move_resource_to_block_cache()` method of the `Block` class, an attacker can copy any file on the filesystem to a temporary directory and subsequently retrieve it. This vulnerability enables unauthorized local file read access, posing a significant risk especially when the application is exposed to the internet via `launch(share=True)`, thereby allowing remote attackers to read files on the host machine. Furthermore, gradio apps hosted on `huggingface.co` are also affected, potentially leading to the exposure of sensitive information such as API keys and credentials stored in environment variables.

Source: the CVE record as published by its numbering authority, via NVD and CVE.org.

The underlying weakness: Path Traversal: '..filename'

The product uses external input to construct a pathname that should be within a restricted directory, but it does not properly neutralize '..filename' (leading backslash dot dot) sequences that can resolve to a location that is outside of that directory.

How developers prevent this class of flaw

  • Inputs should be decoded and canonicalized to the application's current internal representation before being validated (CWE-180). Make sure that the application does not decode the same input twice (CWE-174). Such errors could be used to bypass allowlist validation schemes by introducing dangerous inputs after they have been checked.

More Path Traversal: '..filename' vulnerabilities (CWE-29)

Timeline

  1. CVE record published.
  2. CISA published its SSVC assessment (exploitation: poc, automatable: yes, technical impact: partial).
  3. Record last changed materially (score, affected products, status or references).

References

Technical write-ups (may include proof of concept)

Other vulnerabilities in gradio-app/gradio

All gradio-app/gradio vulnerabilities

Recent Path Traversal: '..filename' vulnerabilities

Spotted an error? Tell us.