MONAI Label: 11 Minutes to Find the Flaw, 34 Days for the Fix to Reach PyPI

On November 20, 2026, Amazon Threat Intelligence published how AI agents found a zero-day on their own. The operator, an actor Amazon links to China with moderate confidence, gave them variants of a single goal: “obtain shell access”.

The agents ran on Cairn, an open source autonomous pentesting framework. Against a server running an AI application for medical imaging, they found a path traversal in a file upload endpoint. According to Amazon, they went from mapping the API to writing arbitrary files in about 11 minutes.

Amazon does not name the application, but everything points to MONAI Label; I explain why further down. Its fix was merged into the main branch on October 19. The version that includes it, 0.8.6, was uploaded to PyPI on November 22 at 01:27 UTC.

That is 34 days between the merge and PyPI. That gap is what interests me.

The agent found nothing exotic: it found one of the oldest flaws in the trade. The slow part was not discovering it. It was shipping the fix.

What did Amazon find on the Cairn server?

On September 10, Amazon found a Cairn instance exposed to the internet with no authentication. Because the operator left it open, anyone could see its history: project configurations, attacker prompts and model output.

The prompts were in Simplified Chinese and the script timestamps used China Standard Time. The campaign targeted IP addresses of East Asian universities outside mainland China, for about 48 hours starting on September 8.

Cairn does not hand out fixed roles to agents. According to its own README, it works on a shared blackboard with three primitives: confirmed facts, exploration intents and hints that a human can inject at any time. You give it an origin and a goal, and it searches for the path.

Amazon describes three operations from that campaign. The figures are Amazon’s, read from the logs of a single instance, and nobody has replicated them independently.

OperationDuration and effortResult
Unauthenticated Redis at a universityabout 16 hours, 148 consecutive actionsno success
GPU server at another universitymore than 6 hours, about 80 real users, more than 30,000 credential combinationsno success
AI application for medical imagingabout 11 minutes to arbitrary file writeroot shell, in a later session

My own table, with data published by Amazon Threat Intelligence on November 20, 2026.

On Redis, the agents tried the known list: abusing replication to load code, escaping the scripting sandbox, writing to the configuration and corrupting memory. They also tried Log4Shell on another service on the same machine.

Then they mapped the internal Docker network through an SSRF in a Qdrant instance and launched credential attacks against PostgreSQL and SSH. Nothing worked.

On the GPU server, they first built a list of usernames from faculty directories, lab websites, archived pages and academic papers. Then they tried combinations against SSH, an admin panel, a NAS, a VPN and the campus portal. That did not work either.

What was the flaw in MONAI Label?

MONAI Label is a server for AI-assisted medical image annotation, from the MONAI project. The project’s advisory, GHSA-qc22-rmgc-vg94, published on November 18, describes it precisely.

The PUT /datastore/image endpoint accepts an image parameter that the server uses as the image identifier without validating it. LocalDatastore.add_image() appends the extension, joins it to the images directory and copies the uploaded file there with shutil.copy().

A value like ../../../tmp/x writes the content wherever the process has write permission. PUT /datastore/label builds its destination the same way.

I read the 0.8.5 code. add_image() already called os.path.realpath() on the destination path: it normalized it, but never checked that it stayed inside the datastore.

save_label() did not even normalize it. Normalizing is not validating.

The fix, PR 1915, adds that check: it resolves the destination and requires that its common path with the allowed directory be that directory. The endpoint also keeps only the base name of the identifier and rejects empty ones or ones starting with a dot with an HTTP 400.

# Idea of the fix (summarized from monailabel/datastore/local.py in 0.8.6)
dest = os.path.realpath(dest)
base = os.path.realpath(allowed_base)
if os.path.commonpath([dest, base]) != base:
    raise ValueError(f"Invalid path: {dest!r} is not inside {base!r}")

The advisory adds the detail that turns a write flaw into a serious problem: authentication is disabled by default (MONAI_LABEL_AUTH_ENABLE=False). With the factory configuration, any client that reaches the port can exploit it. With authentication, the ANNOTATOR role is enough.

How did they go from writing a file to being root?

Writing a file is not running code. Amazon recounts how they closed that gap in a later session, of unpublished duration. The agents wrote a Python reverse shell into sitecustomize.py.

That file is not a new trick. The site module documentation explains that Python tries to import sitecustomize when each interpreter starts. If an attacker controls the sitecustomize that gets imported, the next Python process runs it without anyone calling it.

Then they called a training endpoint of the API, which launched a new Python process. That process imported the payload and opened the shell, as root.

Root does not come from the flaw: it comes from the user the server runs as. We do not know how that server was deployed. The official Dockerfile for 0.8.5 and for 0.8.6 declares no user, so those images run as root unless you change it.

After that, according to Amazon, the operator stepped in. They gave the agents a proxy that reached into the network of a second university, through a server running the same vulnerable software. Amazon infers that the operator had used the same zero-day to compromise it.

Why did the fix take 34 days to reach PyPI?

This is the part that does not make the headlines. I reconstructed the dates with the GitHub API, the PyPI history and the CVE records.

Date (UTC)EventSource
2024-11-25MONAI Label 0.8.5 is uploaded to PyPIPyPI
2026-09-08The Cairn campaign beginsAmazon
2026-09-10Amazon finds the exposed instanceAmazon
2026-10-12PR 1915 is opened, publiclyGitHub
2026-10-19PR 1915 is merged into mainGitHub
2026-11-18GHSA-qc22-rmgc-vg94 is published and PR 1940, a README warning, is openedGitHub
2026-11-20Amazon publishes its analysis and MITRE publishes CVE-2026-133968Amazon, CVE
2026-11-22PR 1942 is merged and 0.8.6 is uploaded to PyPIGitHub, PyPI

My own table. Dates from the GitHub API, the PyPI JSON API, the CVE record and Amazon’s analysis.

Version 0.8.5 had been the latest version for almost two years: 727 days between one release and the next. During those 34 days, anyone installing from PyPI got vulnerable code, even though the fix was already in the repository. And the PR, titled “fix: confine datastore write paths”, had been public since October 12.

No maintainer explains why the release waited. The PRs suggest one reason: PR 1915 noted that the OHIF viewer build was failing (issue 1916) and that the package was being built without it because setup.py ignored the error.

That build was not fixed until PR 1942, merged an hour before the release. This is my reading of the PRs, not an explanation from the project.

PR 1942 also fixes a second path traversal, in session uploads. Tar files were extracted with shutil.unpack_archive(), which in Python before 3.14 writes member names as they are. Same kind of flaw, different endpoint.

As of November 22, with 0.8.6 already published, the GitHub advisory still says the fix will ship in the next release, and its patched versions field is still empty. PR 1940, opened on the 18th and merged on the 19th, added to the README that there are “known, unpatched security issues” and that the server must not be exposed to the internet.

That advisory is not in GitHub’s global advisory database either, and OSV returns nothing when you query monailabel 0.8.5 on PyPI. So tools like Dependabot or pip-audit probably do not flag 0.8.5 yet. A fix in main protects nobody who does not build from main.

What changes when an agent is the one that finds it?

Looking at Amazon’s table, what I see is not a brilliant agent. I see cheap patience. Sixteen hours against a Redis that accepted unauthenticated connections but held out, and nothing.

By contrast, about 11 minutes were enough to write files through an endpoint that joined strings to build paths, and root came in a later session. If the server had the default configuration, not even a credential was needed.

The agents did not need new techniques. They needed a bug of the CWE-22 class, which has been on the lists for decades, and an exposed server. What the agent makes cheap is the search: it can repeat it against many targets without getting tired.

This is not an isolated Cairn case. On November 12, Unit 42 documented 25 Cairn operations against at least 19 organizations between August and September, with access or data obtained in 10.

Gambit Security described in September a financially motivated operator who used open source agents against online retailers. These are other campaigns, and no source links them to this case: they confirm the use of the tool, nothing more.

At Plexicus we build agents that do this same work, with permission and within a signed scope. That is why I read this case as a warning about timing more than about capability. If an agent finds your bug in minutes, the time that matters is how long you take to ship the fix and for your users to install it.

What does the evidence not establish?

Everything we know about the campaign comes from a single source: Amazon’s analysis of one exposed instance. The logs are not public, and the 11 minutes are Amazon’s reading of those logs.

Amazon does not name MONAI Label in its article. The identification comes from the CVE-2026-133968 record, which says “exploited in the wild starting in September 2026”, and from the GitHub advisory, which credits the original report to @aws-sec-vdp. It is a solid connection, but it is not Amazon’s statement.

We do not know how many MONAI Label servers were exposed or how many were compromised. Nor do we know which model drove the agents, how much the run cost or whether the operator injected hints during those 11 minutes, something Cairn allows.

The official records do not agree with each other either. MITRE assigned a 9.8 in CVSS 3.1 and classified the flaw as CWE-24; the project advisory rates it critical, with no CVSS score, and uses CWE-22.

The SSVC assessment CISA added to the CVE record on November 20 says exploitation “none”, while the text of the CVE itself says it has been exploited since September. And the most recent CISA KEV catalog, version 2026.11.20, was published 43 minutes before the CVE existed, so its absence there says nothing yet.

What would I check today if I had MONAI Label deployed?

  1. Upgrade to 0.8.6. It fixes both path traversals and requires Python 3.11 or later, so in some environments the upgrade is also an interpreter change. Do not wait for your dependency scanner to flag it.
  2. Turn on authentication. MONAI_LABEL_AUTH_ENABLE=True and the ANNOTATOR role only for trusted people.
  3. Take it off the internet. The project itself says it is not meant to be exposed. Put it behind a VPN or on a closed network.
  4. Do not run it as root. An unprivileged user with write access only to the datastore directory would have limited the arbitrary write.
  5. Check sitecustomize without starting the server’s Python, which would import it and run the payload. Ubuntu, the base of the official images, already ships one, so its existence proves nothing. Use find to list every sitecustomize.py, usercustomize.py and .pth file, verify the system ones against their package (dpkg -V) and review .pth files with import lines.
  6. Review modified files if a server running 0.8.5 or earlier was reachable from an untrusted network, as the release note recommends.

Frequently asked questions

Am I affected if I use MONAI, not MONAI Label?

The advisory affects the monailabel package, up to and including 0.8.5. MONAI is the base library; the vulnerable code is in the MONAI Label server.

Is turning on authentication enough?

It greatly reduces exposure, but it does not fix the flaw. Any user with the ANNOTATOR role can still write outside the datastore until you upgrade.

Was it the AI that created the exploit?

According to Amazon, the agents identified the framework, mapped the API, tested the parameter and used sitecustomize.py without the operator choosing each step. The techniques are known; what was automated was the search.

Why is it not in KEV?

The latest catalog, version 2026.11.20, predates the CVE and, as of November 22, has not been updated. CISA also requires three things for KEV: an assigned CVE, reliable evidence of exploitation and a clear remediation action. The fixed version did not exist until November 22, although the advisory had listed mitigations since the 18th.

Sources

Blog

Let's talk security

Talks, press or partnerships: get in touch.