AI agents found a MONAI Label zero day. Read your upload paths

Amazon says autonomous agents found a path traversal flaw in an open source medical imaging application, MONAI Label, and turned it into a root shell. The chain looks like a typical RAG stack, and the fixes are ordinary backend hygiene.

Written by
Baraqix Engineering
Published
Read
5 min
Filed under
security, agents, rag, backend
Points of light joined by thin lines on a dark field, a path of nodes stepping out of a bounded cluster to a single bright point outside it

On 20 November 2026 Amazon Threat Intelligence published an account of a threat actor that pointed autonomous agents at university networks and gave them a goal in plain language: obtain shell access. The agents ran on Cairn, an open source penetration testing framework. Amazon found the operator's Cairn instance on 10 September, running without authentication, so the prompts and the agent output were readable by anyone. The campaign ran for about 48 hours starting 8 September. Amazon attributes it to a Chinese nexus actor with moderate confidence.

The number that draws attention is 11 minutes, the time the agents took to go from mapping an API to writing arbitrary files on the server. We think the more useful part of the report is what they attacked, because it looks a lot like the stack many teams run next to a RAG or agent product.

01

What Amazon and the maintainers describe

  • Against an open source medical imaging AI application, the agents identified the framework, mapped the API, found an upload endpoint with a filename parameter and tested it for path traversal. In about 11 minutes they went from mapping the API to writing arbitrary files on the server.
  • In a later session they wrote a Python reverse shell into sitecustomize.py, a file Python imports at interpreter startup, then called a training API endpoint that spawned a new Python process. The shell ran as root.
  • Against a Redis instance that allowed access without authentication, the agents worked through roughly 16 hours and 148 sequential actions. They then mapped the internal Docker network through an SSRF flaw in a Qdrant instance running alongside it and sprayed credentials at PostgreSQL, SSH and other services. None of it succeeded.
  • Against a university GPU server, they built a list of about 80 real usernames from public sources and tested more than 30,000 credential combinations across several systems. They never found a working login.

Amazon does not name the application in its text, but it links to the maintainers' advisory, and that advisory was originally reported by Amazon's security reporting account. The application is MONAI Label. Its maintainers published `GHSA-qc22-rmgc-vg94` on 18 November and rate it critical for versions 0.8.5 and earlier. The PUT /datastore/image endpoint took a caller controlled image parameter as the image ID, joined it onto the datastore directory and wrote the upload there without checking that the resolved path stayed inside. Authentication is disabled by default (MONAI_LABEL_AUTH_ENABLE=False), and with it enabled the ANNOTATOR role is enough to exploit it.

02

Why this is your problem if you ship RAG or agents

Nothing in the chain was new. Path traversal is CWE-22. Python startup hooks are documented behavior. What the agents added was patience and coverage. They tested every parameter, and when the Redis target held, they kept going for most of a day without anyone steering them. The assumption that an internal tool is safe because nobody will bother with it does not hold against an attacker whose time costs almost nothing.

Now look at a typical RAG deployment. A document upload endpoint that accepts a filename. A vector database and a cache on the same Docker network. An admin or reindex endpoint that starts a worker process. A container running as root because that was the base image default. That is the same shape as the MONAI Label chain. The upload path is the first thing we would read in any review of a system like it.

TAB/01The MONAI Label chain as Amazon and the advisory describe it, with the control that stops each step.
Step in the chainWhat allowed itControl that breaks it
Reach the serverAuthentication off by default, reachable over the networkAuthentication on at deploy time, private network only
Write outside the datastoreClient value used as part of a file pathServer generated IDs, resolve the path and check it against the root
Plant code that runs laterProcess could write to directories Python loads code fromUnprivileged user, read only image, one writable volume for data
Trigger executionTraining endpoint spawned a new Python processSeparate authentication and logging for endpoints that start processes
Root shellService ran as rootUnprivileged user with dropped capabilities
03

What we would do this week

  1. Inventory every service your AI system depends on, including labeling tools, vector databases, Redis, notebooks and admin dashboards. Note which ones ship with authentication off. Turn it on, or take the service off any network an untrusted client can reach.
  2. Search every upload handler for places where a name supplied by the client becomes part of a filesystem path. Replace it with an ID the server generates and keep the original name in a database column.
  3. Run AI services as an unprivileged user on a read only root filesystem with a single writable volume for data. The sitecustomize.py trick then has nowhere to land.
  4. Put endpoints that start processes, such as training, reindexing and evaluation runs, behind their own authorization and log every call.
  5. If you run MONAI Label, apply the workarounds in the advisory now: enable authentication and do not grant the ANNOTATOR role to untrusted users, keep the server off untrusted networks, and run it as an unprivileged user with write access limited to the datastore directory.

For the second item, this is a pattern we would use in Python. The same idea applies in Node.js with path.resolve and a prefix check.

LST/01Python
from pathlib import Path
import uuid

UPLOAD_ROOT = Path("/srv/ingest/uploads").resolve()
ALLOWED = {".pdf", ".docx"}

def store_upload(data: bytes, client_filename: str) -> tuple[str, Path]:
    # The client name is metadata. It never becomes part of a path.
    suffix = Path(client_filename).suffix.lower()
    if suffix not in ALLOWED:
        raise ValueError("unsupported file type")
    doc_id = uuid.uuid4().hex
    target = (UPLOAD_ROOT / f"{doc_id}{suffix}").resolve()
    if not target.is_relative_to(UPLOAD_ROOT):
        raise ValueError("path escapes upload root")
    target.write_bytes(data)
    return doc_id, target  # store client_filename in a database column

Amazon's advice to defenders is to prioritize high confidence detections that trigger automated response, with humans overseeing outcomes rather than reviewing each action. We agree on detection, but we would not start there. An agent that needs 11 minutes is still stopped by a server it cannot reach, a path it cannot write and a process that does not run as root. Those controls work the same whether the attacker is a person or a loop.

If your RAG ingestion, agent tools or AI backend have upload paths and process triggers nobody has reviewed, that is the kind of work our backend and API engineering covers, and a Discovery Sprint is where we would map it first.

Baraqix Engineering. Written by the engineers who did the work.

NOTE/16. First published .

Where this work fits

The services behind this note.

  • SVC/AI-01

    AI integration

    RAG, agents, MCP servers and voice, built into the product you already have.

  • SVC/BE-02

    Backend and APIs

    Node.js and Python services on PostgreSQL that the AI work actually runs on.

  • ENG/SPRINT

    Discovery Sprint

    A fixed price Discovery Sprint. The architecture document and a working spike on your real data, in a repository you own.

If something in this note looks like your problem, the reply comes from the engineers who built it.