mech.app

The mech.app newsletter

Agentic AI, minus the noise.

Get practical field notes on AI agents, automation, developer tools and security delivered to your inbox.

No spam. Unsubscribe anytime.

AI Agents

Cairn AI Agents Found a Zero-Day Autonomously: What AWS's Incident Report Reveals About Offensive Agent Capabilities

AWS documented the first confirmed case of AI agents autonomously discovering and exploiting a zero-day. Here's the plumbing that made it possible.

Source: theregister.com
Cairn AI Agents Found a Zero-Day Autonomously: What AWS's Incident Report Reveals About Offensive Agent Capabilities

AWS CISO CJ Moses just documented something that changes the threat model for every exposed service: AI agents working autonomously for nearly 24 hours to discover a zero-day in MONAI Label, exploit it, and take full control of a university server. No human operator. No manual fuzzing. Just Cairn, an open-source penetration-testing framework, chaining reconnaissance, vulnerability discovery, and exploitation without intervention.

This is not a proof-of-concept. Chinese-nexus attackers deployed these agents in the wild. The agents succeeded.

What Cairn Actually Does

Cairn is a multi-agent orchestration framework built for offensive security. It wraps large language models with tool-calling primitives that let agents interact with target systems, parse responses, and decide next steps. The architecture looks like this:

  • Reconnaissance agent: Maps attack surface by probing endpoints, parsing error messages, and identifying software versions.
  • Vulnerability research agent: Correlates discovered software with known CVEs, searches exploit databases, and generates hypotheses about exploitable behavior.
  • Exploit generation agent: Writes payloads, tests them against the target, and iterates based on server responses.
  • Post-exploitation agent: Establishes persistence, escalates privileges, and exfiltrates data.

Each agent has access to a shared state store. When the reconnaissance agent identifies an endpoint running MONAI Label, it writes that finding to state. The vulnerability research agent picks it up, searches for known issues, finds none, and begins behavioral analysis. The exploit generation agent takes over when it detects anomalous error handling.

The Zero-Day Discovery Loop

The agents found a vulnerability in MONAI Label that had no public CVE. Here’s the likely sequence:

  1. Endpoint enumeration: The reconnaissance agent sent HTTP requests to common paths (/api, /admin, /upload) and logged response codes, headers, and error messages.
  2. Behavioral fuzzing: When it found an upload endpoint, the agent sent malformed files, oversized payloads, and edge-case inputs. It logged which inputs triggered 500 errors versus 400 errors.
  3. Error message parsing: The agent extracted stack traces from verbose error responses. It identified the Python framework, library versions, and file paths.
  4. Hypothesis generation: The vulnerability research agent noticed that certain file types triggered path traversal errors. It hypothesized that insufficient input validation allowed directory traversal.
  5. Exploit crafting: The exploit generation agent wrote a payload that embedded ../ sequences in a filename. It tested variations until one returned a 200 status with unexpected file contents.
  6. Privilege escalation: The post-exploitation agent used the file read primitive to access configuration files, extract credentials, and gain shell access.

The entire loop ran for nearly 24 hours. The agents retried failed exploits, adjusted payloads based on server feedback, and persisted state across restarts.

State Management and Rollback

Offensive agents need durable state. If an exploit crashes the target service, the agent must resume from the last known-good checkpoint. Cairn likely uses a state machine with these components:

ComponentPurposeFailure Mode
Action logRecords every tool call and responseDisk full, log corruption
Checkpoint storeSnapshots agent state after each successful stepCheckpoint desync, stale reads
Retry queueHolds failed actions for re-executionQueue overflow, priority inversion
Kill switchTerminates agent on timeout or detectionFalse positives, delayed trigger

The action log is append-only. Each entry includes the agent ID, tool name, input parameters, output, and timestamp. If the agent crashes, it replays the log to reconstruct state.

The checkpoint store uses a key-value database. After the reconnaissance agent maps an endpoint, it writes:

{
  "agent_id": "recon-001",
  "timestamp": "2026-11-19T14:23:11Z",
  "discovered_endpoints": [
    {
      "url": "https://target.edu/api/upload",
      "method": "POST",
      "content_type": "multipart/form-data",
      "response_code": 200
    }
  ]
}

The vulnerability research agent reads this checkpoint and begins analysis. If it finds an exploitable behavior, it writes a new checkpoint with the hypothesis and payload.

Observability and Detection

Defenders need to see what the agent is doing. Traditional security tools look for known exploit signatures. Agents generate novel payloads that bypass signature-based detection.

Effective observability requires:

  • Request pattern analysis: Agents send bursts of similar requests with small variations. Rate limiting catches this, but agents can throttle themselves.
  • Error message suppression: Verbose error messages leak implementation details. Agents parse stack traces to infer code structure. Suppress stack traces in production.
  • Behavioral anomaly detection: Agents retry failed requests with modified payloads. Track retry patterns and flag sequences that suggest automated fuzzing.
  • Credential access monitoring: After exploitation, agents read configuration files and environment variables. Alert on file access patterns that indicate credential harvesting.

AWS likely detected the Cairn agents by correlating request patterns with post-exploitation behavior. The agents spent hours probing the upload endpoint, then suddenly accessed configuration files and established outbound connections.

Containment Challenges

You cannot sandbox an agent designed to escape sandboxes. Offensive agents need network access, file system access, and the ability to execute arbitrary code. Traditional isolation techniques fail.

Containment strategies:

  • Network segmentation: Run agents in isolated VLANs with strict egress filtering. Block outbound connections except to approved targets.
  • Filesystem jails: Use chroot or containers to limit file system access. Agents can still exploit kernel vulnerabilities to escape.
  • Resource quotas: Limit CPU, memory, and disk I/O. Agents can still run indefinitely within quotas.
  • Time-based kill switches: Terminate agents after a fixed duration. Agents can checkpoint state and resume in a new instance.

The Cairn agents ran for 24 hours. That suggests either no kill switch or a kill switch with a very long timeout. Offensive agents need time to iterate, but 24 hours is enough to cause serious damage.

Exploit Generation Primitives

The agents wrote payloads that exploited a zero-day. That requires:

  • Code generation: The agent must write syntactically valid exploit code in the target language (Python, JavaScript, shell script).
  • Payload encoding: The agent must encode payloads to bypass input validation (URL encoding, base64, hex).
  • Response parsing: The agent must parse server responses to determine if the exploit succeeded.
  • Iteration logic: The agent must adjust payloads based on failure modes (timeout, 500 error, 403 forbidden).

Here’s a simplified example of how an agent might generate a path traversal payload:

def generate_traversal_payload(base_path, target_file):
    """Generate path traversal payloads with increasing depth."""
    payloads = []
    for depth in range(1, 10):
        traversal = "../" * depth
        payload = f"{base_path}/{traversal}{target_file}"
        payloads.append(payload)
    return payloads

def test_payload(url, payload):
    """Send payload and check if target file is returned."""
    response = requests.post(url, files={"file": payload})
    if response.status_code == 200 and "root:" in response.text:
        return True  # Successfully read /etc/passwd
    return False

# Agent loop
for payload in generate_traversal_payload("/upload", "etc/passwd"):
    if test_payload("https://target.edu/api/upload", payload):
        log_success(payload)
        break

The agent generates payloads, tests them, and logs results. If a payload succeeds, it moves to the next stage. If all payloads fail, it adjusts the hypothesis and tries a different attack vector.

Attribution and Operational Security

AWS attributed the attack to Chinese-nexus actors. That attribution likely came from:

  • Infrastructure analysis: The agents connected to command-and-control servers with known Chinese IP ranges.
  • Tool fingerprinting: Cairn has a distinctive request pattern. AWS correlated that pattern with known Chinese APT groups.
  • Timing analysis: The attack occurred during Chinese business hours and paused during Chinese holidays.

Offensive agents leave traces. Every tool call generates logs. Every network request exposes infrastructure. Defenders can fingerprint agent behavior by analyzing request timing, payload structure, and error handling.

Deployment Shape

Cairn agents likely run in one of two configurations:

  1. Centralized orchestration: A single controller spawns agents, distributes tasks, and aggregates results. The controller is a single point of failure but simplifies state management.
  2. Distributed swarm: Each agent runs independently and communicates via a message queue. This is more resilient but harder to coordinate.

The 24-hour runtime suggests centralized orchestration. A distributed swarm would have more variance in timing and behavior.

The agents probably ran on rented cloud infrastructure. Spinning up a VM, installing Cairn, and pointing it at a target takes minutes. Defenders cannot rely on infrastructure-based blocking.

Technical Verdict

Use offensive agents when:

  • You need to test defenses against adaptive adversaries. Agents iterate faster than human red teams.
  • You have strict containment and observability. Run agents in isolated environments with comprehensive logging.
  • You accept the risk of unintended exploitation. Agents can discover vulnerabilities you did not anticipate.

Avoid offensive agents when:

  • You cannot contain them. Agents designed to break containment will eventually succeed.
  • You lack observability. Without detailed logs, you cannot reconstruct what the agent did.
  • You operate in regulated environments. Autonomous exploitation raises legal and compliance questions.

The Cairn incident proves that offensive agents work. They find zero-days. They exploit them. They do it without human guidance. Defenders must assume that every exposed service is under continuous, automated attack by agents that learn and adapt.