MONAI Label Path Traversal: Patch CVE-2026-133968 Now

MONAI Label path traversal (CVE-2026-133968) is exploited and in CISA KEV. Affected versions, the 0.8.6 fix, a tested safe-path pattern and what to check.

TL;DR

  • What happened: MONAI Label’s datastore API wrote files to caller-chosen paths. It is rated CVSS 9.8 and was added to CISA KEV on 23 November.
  • Who is affected: Every MONAI Label server at 0.8.5 or earlier, especially ones reachable from untrusted networks.
  • What to do now: Upgrade to 0.8.6, turn authentication on and run the server as an unprivileged user.
  • Interview angle: Why joining a user-supplied name to a directory path is never a security boundary.

The MONAI Label path traversal (CVE-2026-133968) lets a caller choose where the server writes an uploaded file. The image parameter on PUT /datastore/image was used as a file name without validation. Attackers used it to plant code and get a root shell. Upgrade to MONAI Label 0.8.6 now.

Path traversal is a bug where user input becomes part of a file path and steers it outside the intended directory. Sequences like ../ or an absolute path do the steering. When the operation is a write, path traversal often turns into remote code execution, because the attacker can overwrite files the server later runs.

MONAI Label is an open-source annotation server for medical imaging AI. The MONAI Label path traversal matters beyond healthcare. Amazon Threat Intelligence says autonomous AI agents found and exploited it with little human direction. This post covers the affected versions, the mechanism, a fix we tested, and the concepts interviewers build questions around.

What changed and who is affected?

The maintainers published advisory GHSA-qc22-rmgc-vg94 on 18 November 2026 and rated it Critical. The GitHub-mirrored record GHSA-2f43-rwqm-6h67 lists CVSS 3.1 9.8 with no privileges or user interaction required. The fixed release, monailabel 0.8.6, shipped on 22 November 2026.

CVE-2026-133968 at a glance (sources linked in each row)
Item Value
Affected versions MONAI Label <= 0.8.5
Fixed version 0.8.6, released 22 Nov 2026 (Python >= 3.11)
Severity CVSS 3.1 9.8, AV:N/AC:L/PR:N/UI:N
Weakness CWE-22 (the CVE record uses CWE-24)
Default auth Disabled (MONAI_LABEL_AUTH_ENABLE=False)
Exploited Yes, from 8 September 2026
CISA KEV Added 23 Nov 2026, due 26 Nov 2026

There is a timing trap here. Several write-ups from 21 November said no fixed release existed. The 0.8.6 release landed hours later. Advisory pages may still show “Patched versions: None”, so trust the release page and PyPI.

How does the MONAI Label path traversal work?

The maintainers’ advisory describes the flaw at code level. The upload handler takes the image query parameter as the image ID. LocalDatastore.add_image() appends a file extension, joins the result to the image directory and copies the upload there. Nothing checks that the final path stays inside that directory. PUT /datastore/label builds its destination the same way.

From file write to root shell

Amazon’s report explains why a write bug is so serious. Its outline of the attack chain:

  1. The agents mapped the application’s API, then reached arbitrary file writes “in about 11 minutes”.
  2. They wrote a payload into sitecustomize.py, a file Python’s site module imports at interpreter start-up.
  3. They triggered a training API endpoint, which started a new Python process.
  4. That process loaded the planted code and opened a reverse shell running as root.

Amazon assesses “with high confidence” that this was a zero-day when used.

The fix pattern we tested

PR #1915 resolves each destination and checks that it stays inside the datastore directory. It keeps only the basename of the image value and rejects empty or dot-prefixed names with HTTP 400. We wrote a minimal version of both patterns and ran it on Python 3.13.18. This is our own illustration, not MONAI Label’s code:

import os

def naive_dest(base, image_id, ext=".nii.gz"):
    # caller-supplied id joined straight onto the store directory
    return os.path.realpath(os.path.join(base, image_id + ext))

def confined_dest(base, image_id, ext=".nii.gz"):
    name = os.path.basename(image_id)
    if not name or name.startswith("."):
        raise ValueError("rejected (400)")
    base_real = os.path.realpath(base)
    dest = os.path.realpath(os.path.join(base_real, name + ext))
    if os.path.commonpath([base_real, dest]) != base_real:
        raise ValueError("rejected (400)")
    return dest

Raw output for six test IDs (whether the resolved path stays inside a temp datastore):

'scan_001'             naive=inside   confined=inside
'../outside'           naive=OUTSIDE  confined=inside
'sub/../../outside'    naive=OUTSIDE  confined=inside
'/etc/hostname'        naive=OUTSIDE  confined=inside
''                     naive=inside   confined=rejected (400)
'.hidden'              naive=inside   confined=rejected (400)

The absolute-path row surprises many developers. The Python docs say that if a component is absolute, all earlier components are discarded. So os.path.join(base, user_value) can silently ignore base.

What should developers do right now?

  1. Detect: Run pip show monailabel or check your image tag. Anything at 0.8.5 or earlier is affected.
  2. Patch: Run pip install -U monailabel==0.8.6 or docker pull projectmonai/monailabel:0.8.6. The release requires Python 3.11 or newer.
  3. Verify: Confirm the running process reports 0.8.6 after restart, not just the installed package.
  4. Mitigate: Set MONAI_LABEL_AUTH_ENABLE=True. Do not give the ANNOTATOR role to untrusted users, as the advisory says it is enough to exploit the bug.
  5. Contain: Keep the server off untrusted networks. Run it as an unprivileged user that can only write to the datastore.
  6. Hunt: If an old server was exposed, review it for unexpected file changes. Check for new sitecustomize.py or .pth files and changed SSH keys. Search logs for the two IPs in Amazon’s report.

If you run other self-hosted AI tools, apply the same checks. Our guide to AI agent security risks covers why agent-driven attacks move this fast.

Interview questions this update prepares you for

These are questions you should be ready for after a bug like this, not questions reported from any company.

What is path traversal, and why doesn’t os.path.join prevent it?

Path traversal happens when untrusted input changes which file a path points to. os.path.join only concatenates segments; it performs no security check. A ../ segment climbs out of the base directory once the path is normalised. Worse, in Python an absolute segment discards every earlier segment, so the base disappears entirely. The safe mental model: joining is string building, not access control. A boundary exists only after you resolve the final path and compare it against the allowed root.

Follow-up they may ask: How would you handle symlinks inside the upload directory?

How do you safely confine a user-supplied file name to one directory?

Prefer not to use the name at all: generate a server-side ID such as a UUID and store the original name as metadata. If you must use it, take only the basename and reject empty, dot-prefixed or reserved names. Then resolve both the base and the destination with realpath and check containment with commonpath, not startswith. A prefix check wrongly accepts /data/store-evil for base /data/store. Finally, open the file with flags that refuse to follow symlinks where the platform supports it.

Follow-up they may ask: Why is a regex that strips ../ not enough?

Why does an arbitrary file write usually become remote code execution?

Servers constantly load code and configuration from disk. If an attacker can write anywhere the process can write, they target files that run later: Python start-up hooks, cron entries, web templates, SSH authorized keys or plugin directories. Then they wait for, or trigger, a restart or new process. That is why least privilege matters. A process that can only write to its data directory turns a critical bug into a contained one, even before a patch exists.

Follow-up they may ask: Which files on a Linux host would you monitor for integrity changes?

What is CISA’s KEV catalog, and how should it change patch priority?

The Known Exploited Vulnerabilities catalog lists flaws with reliable evidence of exploitation in the wild. US federal agencies must fix listed items by a due date. For everyone else it is a strong prioritisation signal. CVSS measures how bad a bug could be; KEV says attackers are already using it. A practical policy is to patch KEV items on internet-facing systems first, ahead of higher-scored bugs with no known exploitation.

Follow-up they may ask: How would you combine CVSS, EPSS and KEV in a patch queue?

The NexGismo verdict: The bug itself is textbook. What should worry teams is the speed: per Amazon, agents went from API mapping to file writes in minutes. My recommendation: treat every self-hosted AI tool with auth off by default as internet-facing until you prove otherwise, and patch KEV items like this within days, not sprints.

  • CVE-2026-133968 affects MONAI Label 0.8.5 and earlier and is fixed in 0.8.6.
  • The flaw is in PUT /datastore/image, where the image value became a file path without validation.
  • MONAI Label ships with authentication disabled by default, and the ANNOTATOR role can still exploit the bug.
  • Amazon reports AI agents reached arbitrary file writes in about 11 minutes in September 2026.
  • Safe path handling means basename, resolve with realpath, then verify containment with commonpath.

Frequently Asked Questions

Is there a fixed version of MONAI Label for CVE-2026-133968?

Yes. MONAI Label 0.8.6 was published on PyPI and GitHub on 22 November 2026 as a security release. Upgrade with pip install -U monailabel==0.8.6 or pull projectmonai/monailabel:0.8.6. Some articles from 21 November say no fix exists; they were written before the release.

Does enabling authentication stop the MONAI Label path traversal?

Not fully. Authentication is off by default, so turning it on with MONAI_LABEL_AUTH_ENABLE=True removes anonymous access. But the maintainers’ advisory says a user with the ANNOTATOR role can still exploit the bug. Only upgrading to 0.8.6 fixes the flaw itself.

Was CVE-2026-133968 exploited in the wild?

Yes. Amazon Threat Intelligence reported that AI agents from the Cairn framework reached arbitrary file writes in about 11 minutes during a September 2026 campaign. CISA added the CVE to its Known Exploited Vulnerabilities catalog on 23 November 2026, with a 26 November deadline for federal agencies.

How do I check if my MONAI Label server was compromised?

The maintainers advise reviewing any 0.8.5 or older server that was reachable from untrusted networks for unexpected file changes. Look for new or modified Python files, startup hooks and keys outside the datastore. Amazon’s report also lists two attacker IP addresses you can search for in your logs.

The MONAI Label path traversal is a small coding mistake with a large blast radius. Upgrade to 0.8.6, switch authentication on and shrink what the process can write. Then audit your own upload handlers for the same join-then-write pattern. If supply-chain and dependency risk is on your list too, read our npm supply chain defence layers next, or see how AI vulnerability discovery is changing the defender’s side.

Sources