79% vs 51%: independent neobanks lag on app security. Read the report

Deep Dive

Deep Dive

MONAI Label Path Traversal RCE, Exploited (CVE-2026-133968)

An unauthenticated path traversal in MONAI Label 0.8.5 and earlier writes files outside the datastore and leads to RCE; no release fixes it.

TL;DR

  • A path traversal in the MONAI Label datastore endpoint lets any client that can reach the server write files anywhere the process can write.
  • Every release through 0.8.5 is affected, and authentication is disabled by default, so an internet-facing server needs no credentials.
  • The flaw is Critical (CVSS v3.1 9.8), and Amazon Threat Intelligence reported it exploited in the wild in September 2026; the CVE record says the same. It is not in CISA KEV as of 2026-11-21.
  • No fixed release exists yet. Until the next release ships, enable authentication, remove internet exposure and run the server as an unprivileged user.

Am I affected?

You are exposed only if all of these hold:

  • The server runs MONAI Label 0.8.5 or earlier.
  • An attacker can reach its HTTP API over the network.
  • The server uses the built-in local datastore, which is the default; the flaw is in LocalDatastore.
  • Authentication is disabled, which is the default, or the attacker holds a token with the monailabel-annotator role.

MONAI Label is the labeling and learning server of the MONAI project for medical imaging. It runs as a FastAPI application and writes uploaded images and labels into a datastore directory.

When MONAI_LABEL_AUTH_ENABLE is false, every request is treated as DEFAULT_USER, an account that holds the monailabel-admin, monailabel-reviewer, monailabel-annotator and monailabel-user roles. Enabling authentication removes that default, but the upload endpoint only asks for the annotator role.

Product Affected versions Fixed version
MONAI Label 0.1.0 through 0.8.5 None released; source fix merged in pull request 1915

No release carries the fix. The newest PyPI release is 0.8.5, published on 2024-11-25, and the advisory lists no patched version.

Check the installed package:

# installed Python package
pip show monailabel | grep -E '^(Name|Version):'
python -c "import monailabel; print(monailabel.__version__)"

# inside a running container
docker exec <container> python -c "import monailabel; print(monailabel.__version__)"

Check whether authentication is on, and whether the API answers without a token:

docker exec <container> printenv MONAI_LABEL_AUTH_ENABLE
curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:8000/datastore/

Empty output from printenv means the setting is unset, and the default is False. A 200 from the second command means the datastore API answered without credentials.

How do I fix it?

No release fixes this yet, so you either apply the merged source fix yourself or keep the server unreachable until the next release ships.

  1. Build or run MONAI Label from the merge commit that carries the fix:
git clone https://github.com/Project-MONAI/MONAILabel
cd MONAILabel
git checkout 113527bf638585ee5de6a1839b985829331ea272
pip install -e .
  1. Watch for the next release. When it appears, upgrade with pip install --upgrade monailabel and confirm the reported version is later than 0.8.5.

  2. If you cannot patch, turn authentication on: set MONAI_LABEL_AUTH_ENABLE=True and point MONAI_LABEL_AUTH_REALM_URI at your identity provider. Then grant the monailabel-annotator role only to people who should upload images. This removes the unauthenticated path, but any annotator can still send the request.

  3. Remove network exposure. Bind the server to loopback or put it behind a proxy that requires authentication, because the flaw needs a reachable API.

  4. Run the process as an unprivileged account with write access limited to the datastore directory. This does not stop the write, but it limits where the file lands and what a later payload can reach.

What is the root cause?

The datastore upload endpoint uses the caller's image value as a file name without checking the path it builds, so a value with .. segments resolves outside the image directory.

MONAI Label stores every uploaded image under a configured image directory. The upload handler reads the optional image query parameter and passes it to the local datastore as the image ID, with no validation:

# monailabel/endpoints/datastore.py, MONAI Label 0.8.5, line 71
image_id = image if image else os.path.basename(file.filename).replace(file_ext, "")

LocalDatastore.add_image() then appends the uploaded file's extension to that ID, joins the result onto the image directory, resolves the joined path with os.path.realpath() and copies the upload to it:

# monailabel/datastore/local.py, MONAI Label 0.8.5, lines 228-229 and 434-445
def _filename(self, id: str, ext: str) -> str:
    return id + ext

def add_image(self, image_id: str, image_filename: str, image_info: Dict[str, Any]) -> str:
    id, image_ext = self._to_id(os.path.basename(image_filename))
    if not image_id:
        image_id = id

    logger.info(f"Adding Image: {image_id} => {image_filename}")
    name = self._filename(image_id, image_ext)
    dest = os.path.realpath(os.path.join(self._datastore.image_path(), name))

    with FileLock(self._lock_file):
        logger.debug("Acquired the lock!")
        shutil.copy(image_filename, dest)

os.path.realpath() resolves the .. segments instead of rejecting them. An image ID of ../../../tmp/x and an uploaded file named x.py produce <image_dir>/../../../tmp/x.py, whose resolved absolute path depends on the configured image directory's location and depth. The shutil.copy() call then writes the upload there, and nothing checks that the result stayed inside the image directory.

LocalDatastore.save_label() builds its destination the same way from the image value and the tag parameter, so the label endpoint offers a second write path through a crafted label tag.

How is it exploited?

An attacker sends one upload request with a traversal value in the image parameter, then repeats it with a path that the server imports or executes.

  1. The attacker sends PUT /datastore/image with a file part and an image value containing .. segments. The advisory uses ../../../tmp/x as the example.
  2. With authentication disabled, the request runs as the default administrator. With authentication enabled, a token holding the monailabel-annotator role is enough.
  3. add_image() appends the uploaded file's extension, joins the value onto the image directory, resolves it, and copies the upload to the resolved path.
  4. The same request against PUT /datastore/label writes through the label directory using the tag value, which gives a second traversal path.
  5. The attacker writes a file that Python imports when it starts. Amazon's report names sitecustomize.py, a module the interpreter imports at startup.
  6. The attacker triggers a training endpoint, which starts a new Python process. That process imports the payload, and the payload opens a reverse shell as the account that runs the server.

Amazon Threat Intelligence reconstructed this sequence from the operator's own Cairn control panel, which was left publicly accessible. Cairn is an open-source framework that coordinates AI agents as automated penetration testers. The CVE record states that the flaw was exploited in the wild starting in September 2026.

How does the attack flow?

An unauthenticated upload with a traversal value in image writes attacker content outside the datastore, and a later Python start imports it and runs a reverse shell.

flowchart LR A["PUT /datastore/image with ../ in image"] --> B["add_image joins the image directory and the value"] B --> C["realpath resolves the traversal, no check"] C --> D["shutil.copy writes outside the datastore"] D --> E["sitecustomize.py in a Python path"] E --> F["training endpoint starts a new Python process"] F --> G["reverse shell as the server account"]

What can an attacker do?

An attacker with network access writes any file the server process can write, and can turn that write into code execution as the same account.

  • The write reaches application code, configuration files, SSH authorized keys, cron directories and Python startup modules.
  • Code execution runs as the account that started MONAI Label. Amazon's agents obtained a root shell on one university server, so that deployment ran the service as root.
  • Overwriting configuration or datastore files gives a denial of service without code execution.
  • The conditions are a reachable API, authentication disabled or an annotator token, and a target path the process can write.

Amazon reports one confirmed root compromise, on a university server in East Asia. The agents also wrote sitecustomize.py and triggered a training endpoint there.

In a later session the operator supplied a proxy into a second university network running the same software. Amazon infers that network was compromised the same way, without confirming it. The public account does not show that patient scans or records were taken, or that clinical systems were touched.

Why does the fix work?

The fix resolves every destination and rejects any path that does not sit inside the datastore directory, so a traversal value can no longer escape.

 // monailabel/datastore/local.py
+    @staticmethod
+    def _confine_path(dest: str, allowed_base: str) -> str:
+        dest = os.path.realpath(dest)
+        allowed_base = os.path.realpath(allowed_base)
+        try:
+            inside = os.path.commonpath([dest, allowed_base]) == allowed_base
+        except ValueError:
+            inside = False
+        if not inside:
+            raise ValueError(f"Invalid path: {dest!r} is not inside {allowed_base!r}")
+        return dest
+
     def add_image(self, image_id: str, image_filename: str, image_info: Dict[str, Any]) -> str:
         ...
-        dest = os.path.realpath(os.path.join(self._datastore.image_path(), name))
+        dest = self._confine_path(os.path.join(self._datastore.image_path(), name), self._datastore.image_path())

The upload endpoint also reduces a caller-supplied ID to its base name and rejects an empty or dot-prefixed value:

 // monailabel/endpoints/datastore.py
     image_id = image if image else os.path.basename(file.filename).replace(file_ext, "")
+    if image:
+        image_id = os.path.basename(image_id)
+        if not image_id or image_id in (".", "..") or image_id.startswith("."):
+            raise HTTPException(status_code=400, detail="Invalid image ID")

_confine_path() compares the resolved destination with the resolved base directory, so .. segments, absolute values and Windows paths on a different drive are all rejected. save_label() applies the same check to the label tag directory and the final file. The change covers the two local-datastore write paths that the advisory names, and it is not in any release yet.

How do I check if I was compromised?

Look for a file that Python imports at startup and for upload requests with traversal values, and treat either as a lead that needs confirmation.

Amazon published two addresses observed during the campaign, from 2026-09-08 to 2026-09-10:

  • 142.4.98.145
  • 142.4.107.34

Check whether a sitecustomize module exists outside the packages you installed:

python - <<'PY'
import importlib.util
spec = importlib.util.find_spec("sitecustomize")
print(spec.origin if spec else "sitecustomize not found")
PY

Then look for files written under site-packages after the campaign began:

sudo find /usr/local/lib/python3.*/site-packages -newermt '2026-09-01' -type f

Search the server's access log for upload requests with encoded or literal traversal values:

grep -Ei 'PUT /datastore/(image|label).*(%2e%2e|\.\.)' /var/log/monailabel/access.log

The advisory and Amazon's report publish no file hashes for the payload. An attempt that failed may leave no trace, and a legitimate sitecustomize.py exists on some systems, so a hit is a lead rather than proof.

Timeline

  • 2024-11-25: MONAI Label 0.8.5 is published on PyPI.
  • 2026-09-08 to 2026-09-10: Amazon records the campaign, including the exploitation of the flaw.
  • 2026-10-12: the fix pull request is opened.
  • 2026-10-19: the fix is merged into the repository.
  • 2026-11-18: the project publishes advisory GHSA-qc22-rmgc-vg94.
  • 2026-11-20: the CVE record is published, and Amazon publishes its report.

The flaw remained exploitable for 34 days before a fix pull request existed, and the public identifier arrived 73 days after the campaign began.

The public record arrived 73 days after exploitation began, with the fix merged 30 days before the advisory.
Figure 1: The path from exploitation to a public advisory and CVE. Source: Amazon Threat Intelligence, GHSA-qc22-rmgc-vg94 and the CVE record, checked November 21, 2026

FAQ

Is there a fixed version I can install?

No. The newest PyPI release is 0.8.5 from 2024-11-25, and the advisory lists no patched version. The fix exists only as a merged commit and will be in the next release.

Does enabling authentication stop the attack?

It closes the unauthenticated path, but any account with the monailabel-annotator role can still send the upload. Treat authentication as a reduction in exposure, not as a fix.

Was the flaw really exploited in the wild?

Yes. The CVE record says it was exploited in the wild starting in September 2026, and Amazon's report describes a root shell obtained on a university server.

Were patient scans or patient records stolen?

Amazon says its report does not show that patient scans or records were taken, or that clinical systems were touched. The confirmed impact is one rooted university server.

Is the MONAI framework affected?

No. The flaw is in MONAI Label, the labeling server, not in the MONAI library. The advisory was re-filed to the MONAI Label repository because the vulnerable code lives there.

Can a version check tell me whether I was attacked?

No. Every release through 0.8.5 carries the flaw, so the version check tells you whether to patch. It says nothing about past requests, which need the log and file checks.

Find vulnerable MONAI Label installs with Ostorlab

Ostorlab's software composition analysis inventories the packages in your repositories and container images, including every service that pins monailabel at 0.8.5 or earlier. That list shows which deployments need the source fix, or the workarounds, before a fixed release ships: https://www.ostorlab.co/product/sca_sbom

References

  • GitHub Security Advisory, "Path traversal in datastore upload endpoints allows arbitrary file write" (GHSA-qc22-rmgc-vg94), published 2026-11-18 (checked November 21, 2026)
  • CVE record, CVE-2026-133968, published 2026-11-20 (checked November 21, 2026)
  • Project MONAI, fix pull request 1915, "fix: confine datastore write paths", merged 2026-10-19 (checked November 21, 2026)
  • Amazon Threat Intelligence, "Chinese-nexus actor's Cairn AI agents found a zero-day on their own", published 2026-11-20 (checked November 21, 2026)
  • Project MONAI, monailabel/datastore/local.py at tag 0.8.5 (checked November 21, 2026)
  • Project MONAI, monailabel/endpoints/datastore.py at tag 0.8.5 (checked November 21, 2026)
  • Project MONAI, monailabel/endpoints/user/auth.py at tag 0.8.5 (checked November 21, 2026)
  • PyPI, monailabel 0.8.5 release files, uploaded 2024-11-25 (checked November 21, 2026)
  • pypistats.org, monailabel download statistics, 269 downloads in the last week (checked November 21, 2026)
  • GitHub, Project-MONAI/MONAILabel repository, 912 stars and 281 forks (checked November 21, 2026)
  • CISA, Known Exploited Vulnerabilities catalog, catalog version 2026.11.20 (checked November 21, 2026)