Medium

Label Studio allows Cross-Site Scripting (XSS) via GET request to `/projects/upload-example` endpoint

  • Disclosed: 14.02.2025
  • Updated: 11.10.2026 13:18

Description

Label Studio's /projects/upload-example endpoint allows injection of arbitrary HTML through a GET request with an appropriately crafted label_config query parameter. By crafting a specially formatted XML label config with inline task data containing malicious HTML/JavaScript, an attacker can achieve Cross-Site Scripting (XSS). While the application has a Content Security Policy (CSP), it is only set in report-only mode, making it ineffective at preventing script execution.

The vulnerability exists because the upload-example endpoint renders user-provided HTML content without proper sanitization on a GET request. This allows attackers to inject and execute arbitrary JavaScript in victims' browsers by getting them to visit a maliciously crafted URL.

This is considered vulnerable because it enables attackers to execute JavaScript in victims' contexts, potentially allowing theft of sensitive data, session hijacking, or other malicious actions.

Steps to reproduce

  1. Create a malicious label config that includes an XSS payload in embedded task data:
xml
<View><!-- {"data": {"text": "<div><img src=x
onerror=eval(atob(`YWxlcnQoIlhTUyIp`))></div>"}} --><HyperText name="text"
value="$text"/></View>
  1. URL encode the payload and access the following URL:

When executed, the payload causes the application to render an HTML page containing an img tag that fails to load, triggering the onerror event handler which executes base64-decoded JavaScript, demonstrating successful XSS execution in the victim's browser.

Mitigations

  • Enable the Content Security Policy in enforcement mode instead of report-only mode to actively block unauthorized script execution
  • Deprecate the GET behavior at the example-config endpoint since it's not used

Impact

The vulnerability requires no special privileges and can be exploited by getting a victim to visit a crafted URL. The impact is high as it allows arbitrary JavaScript execution in victims' browsers, potentially exposing sensitive data or enabling account takeover through session theft.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Python (PyPI) label-studio < 1.16.0 1.16.0

References

CVSS score 6.1/10
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Weakness (CWE)
CWE-79
Platform
Python (PyPI)
Package
label-studio
Disclosed
14.02.2025
Updated
11.10.2026 13:18

Sources and licenses

OSV / GitHub Advisory Database - PYSEC-2026-1504 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-wpq5-3366-mqw4 - CC BY 4.0

Vulnerability history: label-studio

All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.

All (12) in the archive
Total entries
12
First → latest
10.2022 01.2026
Without a fix
1
Exploited in attacks
0

Severity breakdown

  • Critical 1
  • High 7
  • Medium 4

Disclosures per year

  1. 2022: 1
  2. 2023: 3
  3. 2024: 4
  4. 2025: 3
  5. 2026: 1
Severity:
  1. Label Studio allows Cross-Site Scripting (XSS) via GET request to `/projects/upload-example` endpoint this entry
    Medium · 6.1 CVE-2025-25296 < 1.16.0 1.16.0
  2. High · 7.1 CVE-2023-47115 < 1.9.2 1.9.2
  3. High · 7.5 CVE-2023-47117 < 1.9.2.post0 1.9.2.post0

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.