Dev.to Security πŸ” Cybersecurity πŸ‘ 0 πŸ“– 12 min read

AI Agent Attackers Bring Patience, Not Genius: A Defender Checklist From the Cairn Case

The instruction was three words long: "obtain shell access." That was the goal an attacker gave to a set of AI agents in September, according to Amazon Threat Intelligence. The agents planned their own steps, tried them

The instruction was three words long: "obtain shell access."

That was the goal an attacker gave to a set of AI agents in September, according to Amazon Threat Intelligence. The agents planned their own steps, tried them, and changed course when something failed. Against one target they found an unknown bug (a zero-day) and took over the server as root. Against two others they worked for hours and got nothing.

Both halves of that story matter. The win shows how fast an agent can move. The failures show what still stops it. This article walks through what Amazon reported, adds related reports from the past few months, and turns it into a checklist you can run against your own servers this week.

A note on sources: everything below comes from the published reports linked in each section. I have not run Cairn or reproduced the attacks. The code samples are illustrations written for this article. They follow the bug class described in the advisory and were checked only against small synthetic inputs.

What Amazon found

On September 10, 2026, Amazon found a server running a public copy of Cairn with no login. Cairn is an open-source framework that coordinates several AI agents for penetration testing (authorized hacking to find weaknesses). It was built for defenders. You give it a starting point and a goal in plain language, and the agents look for a path to that goal.

Because the operator left the console open, anyone on the internet could read its history. That included project settings, the operator's prompts and the AI output. The prompts were in Simplified Chinese and the script timestamps used China Standard Time. Amazon attributes the campaign to a China-nexus actor with moderate confidence. The targets were IP addresses linked to universities in East Asia outside mainland China, over about 48 hours starting September 8.

Amazon published the findings on November 20. Three operations stand out.

Redis: 16 hours, 148 actions, no success. The agents went after a Redis server (an in-memory database) that allowed access without a password. Over roughly 16 hours and 148 sequential actions, they worked through known Redis takeover methods. These included abusing replication to load code, escaping the scripting sandbox, writing to config files and corrupting memory. They also tried Log4Shell against another service on the same machine. Next they used a server-side request forgery bug (SSRF, where a server is tricked into making requests for you) in a Qdrant instance to map the internal Docker network. Then they sprayed passwords at PostgreSQL, SSH and other services. None of it worked.

A GPU server: 6 hours, 30,000 logins, no success. The agents built a list of about 80 real usernames from the university's public pages, such as faculty directories, lab sites, archived pages and papers. They then tried more than 30,000 username and password combinations. The targets were SSH, an admin dashboard, a storage device, a VPN server and the campus portal. They never found a working login.

MONAI Label: 11 minutes to file write, then root. The third target ran MONAI Label, an open-source tool that helps researchers label medical images with AI. The agents identified the framework, mapped its API, and found an upload endpoint that took a filename parameter. They tested it for path traversal (using ../ in a name to escape the intended folder), and it worked. Amazon says the agents went from mapping the API to writing arbitrary files in about 11 minutes.

In a later session, the agents used the same bug to write a Python reverse shell into sitecustomize.py. Python imports that file automatically every time the interpreter starts, as the site module docs explain. The agents then called a training API endpoint, which started a new Python process. That process loaded the payload and opened a reverse shell running as root.

After that, a human stepped in. The operator gave the agents a proxy into a second university network that ran the same vulnerable software, and pointed them at other machines there.

The MONAI Label bug, in plain terms

Amazon reported the bug to the maintainers. The GitHub advisory GHSA-qc22-rmgc-vg94, rated critical and published November 18, describes it like this:

  • PUT /datastore/image takes an image query parameter and uses it as the image ID without checking it.
  • The code adds a file extension, joins the result onto the datastore folder, and copies the upload there.
  • Nothing checks that the final path is still inside the datastore. A value like ../../../tmp/x writes the file anywhere the server process can write.
  • PUT /datastore/label builds its path the same way.
  • Authentication is off by default (MONAI_LABEL_AUTH_ENABLE=False), so any client that can reach the server can use the bug.

The fix (pull request #1915) resolves each destination path and rejects anything outside the datastore. It also cuts the image ID down to its base name and rejects empty or dot-prefixed IDs. The fix shipped in MONAI Label 0.8.6, a security release from November 22. Its notes list the bug as CVE-2026-133968, affecting all versions up to 0.8.5. The same release fixes a second path traversal in session uploads.

This was not a one-off

Three other recent reports point the same way.

  • Gambit Security, September 22. Gambit's report describes a financially motivated operator running three open-source AI harnesses, with Cairn doing end-to-end exploitation, against hundreds of online retailers. Gambit counts at least 600,000 stolen card records from two companies. The operator's own cost review showed a mean of $25.46 per completed scan across 101 scans.
  • Google Threat Intelligence Group, November 16. GTIG reported that in the past quarter it saw attackers use LLM frameworks to fully automate finding and exploiting bugs "without a human in the loop for the first time." It also saw Cairn used against targets including the US aerospace sector.
  • Bell Canada, November 20. Bell told BleepingComputer that an "agentic threat actor" got into some of its systems on November 17 and took enterprise customer data. Its customer notice says the intruder accessed a pre-production environment of Bell's Maximo system, which is used to order and provision network connections. Bell has not published its indicators of compromise and says it does not know who the attacker is.

GTIG also warns about the other side of this: a flood of AI-written exploits that are claimed to work but do not. That creates extra checking work for defenders.

What the agents were good at, and what stopped them

The agents did not invent new attack science. The Redis attempts were a list of known methods. The credential attack was a classic password spray with better username research. The MONAI Label bug was path traversal, one of the oldest bug classes on the web. What the agents added was patience and breadth: 148 actions against one server, 30,000 login attempts against another, and 11 minutes from API map to file write on a third. In Amazon's words, the agents "kept adapting for nearly a full day without human direction."

What stopped them was ordinary hardening. Amazon calls the Redis server a "hardened" target even though it had no password. The report does not say which setting held, but 148 attempts did not get through. No password in the 30,000 tries worked. The one success came from software that ships with authentication off by default and wrote files without checking paths.

That gives a practical rule. You cannot out-wait a machine, so do not depend on the attacker getting bored. Remove the easy wins, and make your detection fast enough to act before a human would have even read the alert. Amazon's own advice is to "prioritize high-confidence detections that trigger automated response, with humans overseeing outcomes rather than reviewing every individual action."

The defender checklist

1. Find every service that answers without a login

Count the unauthenticated services in this story: an open Redis, a MONAI Label server with auth off by default, and the attacker's own Cairn console. Start by listing what you expose.

For Redis, a quick test from a machine outside the server:

redis-cli -h <your-redis-host> ping

If that returns PONG without a password, anyone on that network can talk to it. The Redis security docs recommend firewalling the port and binding to the interfaces you need, for example:

bind 127.0.0.1

Since Redis 3.2.0, protected mode makes a default, password-less Redis answer only on loopback, but an admin can turn it off. Redis 6 added ACLs (named users with their own permissions), which the docs recommend over the older single requirepass password. The docs also show how to rename or disable risky commands such as CONFIG with rename-command, though they mark that method as deprecated in favor of ACL rules.

2. Patch MONAI Label, then check for changes

If you run MONAI Label, upgrade to 0.8.6:

pip install -U monailabel==0.8.6

Then follow the release notes for every version: turn authentication on (MONAI_LABEL_AUTH_ENABLE=True), keep the server off untrusted networks, and run it as an unprivileged user that can only write to the datastore. The notes also say that if a 0.8.5 or older server was reachable from an untrusted network, you should review it for unexpected file changes before putting it back in service.

3. Fix the bug class in your own upload code

Path traversal is not a MONAI problem. Any endpoint that builds a file path from user input can have it. Here is a short Python pattern that follows the same idea as the fix: keep only the base name, resolve the final path, and refuse anything outside the base folder.

from pathlib import Path

def safe_destination(base_dir: str, image_id: str, ext: str) -> Path:
    base = Path(base_dir).resolve()
    name = Path(image_id).name  # drop any directory parts
    if not name or name.startswith("."):
        raise ValueError("invalid image id")
    dest = (base / f"{name}{ext}").resolve()
    if not dest.is_relative_to(base):
        raise ValueError("path escapes the datastore")
    return dest

With a base of /tmp/ds, the input ../../../tmp/x becomes /tmp/ds/x.nii.gz, inside the folder. Empty and dot-prefixed names raise an error. Path.is_relative_to needs Python 3.9 or newer. The OWASP path traversal page has more input variants worth adding to your tests.

4. Do not run network services as root

The reverse shell ran as root, which means the Python process the service started was running as root. A file-write bug in a service running as a limited user would still be serious, but the attacker would not get root automatically. Give each service its own user, and limit its write access to the folders it needs.

5. Watch Python startup files

The payload went into sitecustomize.py, a file that runs on every Python start. On servers that run Python services, it is cheap to check whether one exists and when it changed. To see where your interpreter looks:

python3 -c "import site; print(site.getsitepackages())"

Then list any sitecustomize.py or usercustomize.py in those folders. A file that appeared recently, on a server where nobody set one up, deserves a look. File integrity monitoring (tools that alert when watched files change) can cover these paths permanently.

6. Look for machine pacing in your logs

The failed operations were long and repetitive: 148 actions over 16 hours against one server, and more than 30,000 login attempts over 6 hours against others, nearly all of them failures. People tend to work in bursts and stop. An agent can keep going. For web-facing services, here is a simple script that scans a standard nginx or Apache access log and flags sources that behave like that.

import re
import statistics
import sys
from collections import defaultdict
from datetime import datetime

LINE = re.compile(r'^(\S+) \S+ \S+ \[([^\]]+)\] "(\S+) (\S+)[^"]*" (\d{3})')

def load(path):
    hits = defaultdict(list)
    with open(path, errors="replace") as f:
        for line in f:
            m = LINE.match(line)
            if not m:
                continue
            ip, ts, method, url, status = m.groups()
            t = datetime.strptime(ts, "%d/%b/%Y:%H:%M:%S %z")
            hits[ip].append((t, url, int(status)))
    return hits

def score(events):
    events.sort()
    times = [e[0] for e in events]
    gaps = [(b - a).total_seconds() for a, b in zip(times, times[1:])]
    hours = (times[-1] - times[0]).total_seconds() / 3600
    errors = sum(1 for e in events if e[2] >= 400) / len(events)
    paths = len({e[1].split("?")[0] for e in events})
    mean_gap = statistics.mean(gaps) if gaps else 0
    spread = statistics.pstdev(gaps) / mean_gap if mean_gap > 0 else 0
    return hours, errors, paths, spread

def main(path, min_requests=100, min_hours=2.0):
    for ip, events in load(path).items():
        if len(events) < min_requests:
            continue
        hours, errors, paths, spread = score(events)
        if hours >= min_hours and errors >= 0.5:
            print(f"{ip}: {len(events)} requests over {hours:.1f}h, "
                  f"{errors:.0%} errors, {paths} distinct paths, gap spread {spread:.2f}")

if __name__ == "__main__":
    main(sys.argv[1])

It flags any source with at least 100 requests over two or more hours where at least half returned an error. It also prints the "gap spread": how much the time between requests varies. A value near zero means very regular timing. On a small synthetic log made for this article, with one steady scanner and one normal visitor, it flagged only the scanner (400 requests over 6.1 hours, 77% errors, gap spread 0.05).

Treat this as a starting point, not a detector you can trust as-is. Agents can add random delays and spread work across many IP addresses, and some real tools (monitoring checks, backup jobs) also look steady. The thresholds are guesses you should tune to your own traffic. The better long-term home for this logic is your existing log pipeline or SIEM (the system that collects and searches security logs), with an automatic response such as a temporary block.

7. Make the 30,000th password guess as useless as the first

The GPU server held for a plain reason: none of the username and password pairs the agents tried was valid. The agents built their username list from public faculty pages and papers, so assume your usernames are known too. For SSH, use keys and turn off password login with PasswordAuthentication no in sshd_config. Put MFA in front of VPNs, admin dashboards and portals, and rate-limit or lock out repeated failures.

8. Treat pre-production like production

In Bell's case, the system the intruder reached was a pre-production environment, and the data at risk was still real enterprise contact information such as names, job titles, work emails and phone numbers. If a staging copy holds real customer data, it needs production-level access control, logging and patching. If it does not need real data, use fake data and make the copy less valuable to an attacker.

9. Check the indicators you do have

Amazon published two IP addresses seen in records dated September 8 to 10, 2026: 142[.]4.98.145 and 142[.]4.107.34. They are more than two months old and the actor may have moved on, but a quick search of your logs for that window costs little. Gambit's report also lists skimmer domains and URLs if you run an online shop.

What this does not mean

It does not mean AI agents break into everything. In the three operations Amazon described, two failed. The one success depended on software that ships with authentication off by default and had no path checks. A human still chose the targets and handed over a proxy to the second network.

It does mean, as GTIG puts it, that the patch window is shrinking, and that a long, boring attack now costs the attacker very little. Gambit's numbers put the operator's cost at a few dollars to a few tens of dollars per target. The defenses that held in these reports were the plain ones: logins on every service, strong credentials, limited privileges, and patches applied quickly.

Which of these nine checks would turn up something on your own servers today?

Sources

πŸ“° Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.