
Case study: Label Studio CVE-2022-36551 (task-import URL opened with urlopen). Demo only, not for use.
Case study of a server-side request forgery advisory (CWE-918) in
HumanSignal/label-studio (formerly heartexlabs/label-studio): the
project task-import API opens a caller-supplied URL with urllib.request.urlopen without checking its scheme;
the upstream fix rejects file:// URLs before the call.
Demo only, not for use. This repository is a case study built from unmodified snapshots of HumanSignal/label-studio at two historical commits. It is not a fork and is not maintained. Do not install, deploy, or depend on it: the
baselinebranch contains code affected by the advisories below.
This branch: main holds only this index. The code is on baseline (tag poe, vulnerable) and fix (tag pone, patched).
| CVE | CVE-2022-36551 |
| GHSA | GHSA-pc6f-259w-w3j6, "Heartex - Label Studio Community Edition vulnerable to SSRF in the Data Import module", CWE-918 |
| Affected | label-studio < 1.6.0, per the GHSA record |
| Upstream fix | HumanSignal/label-studio#2840, commit 501142cb81, merged 2022-08-23 |
baselineAll line numbers are at upstream commit ad29804731.
| Step | Location |
|---|---|
| URL route | path('<int:pk>/import', api.ImportAPI.as_view(), name='project-import'), label_studio/data_import/urls.py:17, mounted under api/projects/ at line 26 and included from label_studio/core/urls.py:58. No decorator: the view is registered through Django URL configuration. |
| View | class ImportAPI(generics.CreateAPIView), label_studio/data_import/api.py:161; post (line 175) delegates to DRF's CreateAPIView.post, which dispatches to ImportAPI.create (line 198); create calls load_tasks(request, project) at line 209 |
| Input | load_tasks, label_studio/data_import/uploader.py:143, reads form field url at line 162 |
| Existing check | if settings.SSRF_PROTECTION_ENABLED and url_is_local(url): raise ImportFromLocalIPError, lines 175-176; SSRF_PROTECTION_ENABLED defaults to False (label_studio/core/settings/base.py:372). No URL-scheme check precedes the call. |
| Call | tasks_from_url(file_upload_ids, project, request, url) at line 177; tasks_from_url defined at line 114 |
| Sink | stdlib urllib.request.urlopen(url, context=ctx) at uploader.py:123 |
At 501142cb81, load_tasks raises ValidationError('"url" is not valid') when
url.strip().startswith('file://') (lines 178-179),
before the tasks_from_url call (now line 181). The commit also
adds label_studio/tests/data_import/test_uploader.py. The call to urlopen is still present: the fix adds a
guard and removes no call.
This is not a fork: a fresh repository whose code branches hold upstream source snapshots, with no upstream history and no upstream remote.
| Branch | Tag | Upstream commit | Date | Snapshot commit | Snapshot tree |
|---|---|---|---|---|---|
baseline | poe | ad29804731 | 2022-08-22 | f75fe894f078f7afa79968fc71d643109eb6cf42 | ccd778fa8dfb6472b97638a3ede19b9cc26571dc |
fix | pone | 501142cb81 | 2022-08-23 | 2a140fbde0929875e262cf68618318744b8e7f8a | d1293b5feb153a5eb4d75b11a563ae9974e8ea7a |
Each snapshot commit is the upstream tree at that commit with one change: .github/workflows/ (24 files) is
removed so that upstream CI does not run here. No other file is added, removed, or edited. The fix snapshot's
parent is the baseline snapshot, so the diff between the two snapshot commits
(compare) is exactly the upstream fix commit's diff. On each code branch, a second
commit replaces upstream's README.md with a branch-specific version of this file; upstream's README is in the snapshot commit.
To check a snapshot against upstream from a clone of this repository:
git fetch https://github.com/HumanSignal/label-studio ad298047312123e2fb781cd6d7b9668ed1b51edc
git diff --stat FETCH_HEAD f75fe894f078f7afa79968fc71d643109eb6cf42 # lists only .github/workflows/*
| Tag | Commit | Pins |
|---|---|---|
poe | b4e24a9a2d8ff98be4a86c514c63653822921b34 | baseline: vulnerable snapshot plus this README |
pone | d34808e5ec7cf59b8704ec343e2abf35689a31f7 | fix: patched snapshot plus this README |
Label Studio is licensed under the Apache License 2.0. The upstream LICENSE and NOTICE are kept verbatim at
the root of the baseline and fix branches, as are the third-party licence files upstream ships
(licenses/django_license.txt, licenses/python_license.txt, and the *.LICENSE.txt files beside the bundled
front-end JavaScript under label_studio/frontend/dist/). Changes made for this case study, on 2026-10-07:
.github/workflows/ removed, and this README.md replaces upstream's.