Описание
Label Studio is vulnerable to full account takeover by chaining Stored XSS + IDOR in User Profile via custom_hotkeys field
Prologue
These vulnerabilities have been found and chained by DCODX-AI. Validation of the exploit chain has been confirmed manually.
Summary
A persistent stored cross-site scripting (XSS) vulnerability exists in the custom_hotkeys functionality of the application. An authenticated attacker (or one who can trick a user/administrator into updating their custom_hotkeys) can inject JavaScript code that executes in other users’ browsers when those users load any page using the templates/base.html template. Because the application exposes an API token endpoint (/api/current-user/token) to the browser and lacks robust CSRF protection on some API endpoints, the injected script may fetch the victim’s API token or call token reset endpoints — enabling full account takeover and unauthorized API access. This vulnerability is of critical severity due to the broad impact, minimal requirements for exploitation (authenticated user), and the ability to escalate privileges to full account compromise.
Details
Within templates/base.html, the application renders user-controlled hotkey configuration via the following JavaScript snippet:
Here, user.custom_hotkeys is run through json_dumps_ensure_ascii (in core/templatetags/filters.py) which performs json.dumps(dictionary, ensure_ascii=False) but does not escape closing </script> sequences or other dangerous characters. Because the template uses the |safe filter, the output is inserted into the HTML <script> context without further escaping.
In users/api.py, the PATCH endpoint allows updating of custom_hotkeys:
The serializer allows < and > characters (e.g., "
When another user loads a page using templates/base.html (for example /user/account/ or /), the rendered JavaScript includes the injected string, causing closing of the original code. Because the application exposes /api/current-user/token ( in GET) which returns the user’s API token and CSRF protection is relaxed for this API path, the malicious script can fetch the token and send it to an attacker-controlled endpoint, thereby enabling account takeover and further API misuse.
PoC
- Login to the application
- Go to the login page:
GET /user/login/
- Identify your user ID (via API)
GET /api/current-user/whoami- In the response JSON you will see your user ID (for example
"id": 123). - Note this ID for the next step.
- Inject a malicious hotkey payload in the PATCH request /api/users/{id}
- Using the user API, send a
PATCHrequest to update yourcustom_hotkeys.
Example request
Example response
- Verify the injected string persists
- Still logged in as your user, go to your account page (e.g.,
GET /user/account/). - See the alert containing the API access token for the user. In a real world attack this token is sent to the attacker server
Impact
Exploitation impact:
- Full account takeover of victim user(s).
- Exposure of API tokens granting access to internal/external APIs.
- Unauthorized API access, data exfiltration, token reset or privilege escalation.
- If victim is administrator or privileged user, wide system compromise possible.
Who is impacted:
- All users who load the template and whose session/token is accessible via browser.
- The organization’s application and data.
- Potentially other end-users if cross-user token exfiltration occurs.
Ссылки
- https://github.com/HumanSignal/label-studio/security/advisories/GHSA-2mq9-hm29-8qch
- https://nvd.nist.gov/vuln/detail/CVE-2026-22033
- https://github.com/HumanSignal/label-studio/pull/9084
- https://github.com/HumanSignal/label-studio/commit/ea2462bf042bbf370b79445d02a205fbe547b505
- https://github.com/HumanSignal/label-studio/releases/tag/nightly
Пакеты
label-studio
<= 1.22.0
Отсутствует
Связанные уязвимости
Label Studio is a multi-type data labeling and annotation tool. In 1.22.0 and earlier, a persistent stored cross-site scripting (XSS) vulnerability exists in the custom_hotkeys functionality of the application. An authenticated attacker (or one who can trick a user/administrator into updating their custom_hotkeys) can inject JavaScript code that executes in other users’ browsers when those users load any page using the templates/base.html template. Because the application exposes an API token endpoint (/api/current-user/token) to the browser and lacks robust CSRF protection on some API endpoints, the injected script may fetch the victim’s API token or call token reset endpoints — enabling full account takeover and unauthorized API access.