Sysdig marimo: When an LLM Agent Drives Post-Exploitation After RCE
Sysdig observed a May 10 intrusion where an attacker used CVE-2026-39987 to reach an internet-facing marimo notebook (marimo is a Jupyter-like interactive Python notebook that runs in the browser), then let an LLM agent drive post-exploitation: credential harvesting, AWS Secrets Manager access, SSH through a bastion, and an internal PostgreSQL dump. The lesson is not only to patch marimo. AI and data-science runtimes need early authentication, narrow credentials, egress limits, segmentation, and telemetry that follows goals rather than fixed command sequences.
Threat Analysis
- Initial access was a notebook shell. The attacker connected to
/terminal/wson a vulnerable, internet-reachable marimo instance and gained command execution through CVE-2026-39987. - The first pivot was credential harvest. The session read environment files,
.envpaths, process environments, and~/.aws/credentials, then used harvested AWS keys to call STS and Secrets Manager. - The second pivot turned a secret into SSH reach. The attacker retrieved an SSH private key, used Cloudflare Workers as an egress pool, and opened eight short SSH sessions to a downstream bastion.
- The agent signature appears in the command stream. Sysdig cites a leaked planning comment, delimiter-heavy shell blocks, bounded output captures, a single
psqlheredoc, and values lifted from prior tool output. - The payload was an internal database dump. The bastion phase enumerated PostgreSQL tables, guessed high-value AI-workflow tables, and exfiltrated schema and contents in under two minutes.
Applicable AIDEFEND Defenses (6)
What Defenders Should Do Now
- Upgrade marimo to 0.23.0 or later. If upgrade is delayed, restrict access to
/terminal/ws, disable the terminal feature, and place notebook services behind strong authentication and private network paths. - Inventory internet-facing notebooks, AI sandboxes, data-science UIs, and MCP or agent development surfaces. Record whether each one can execute shell commands, read environment variables, or reach cloud APIs.
- Rotate credentials on any marimo host that was exposed. Include AWS keys, API keys, database passwords, SSH keys, local secrets, and service credentials mounted into the runtime.
- Move notebook and code-execution workloads into sandboxes with default-deny egress. Add only reviewed outbound destinations, and keep cloud APIs, bastions, and internal databases off the default route.
- Segment internal databases and bastions away from AI experimentation hosts. A public notebook should not be able to discover, SSH into, or query production data stores without an explicit, logged path.
- Add detections for credential-file reads,
secretsmanager:GetSecretValuebursts, per-request egress pools, unusual SSH fan-out, delimiter-heavy shell probes, and database dumps after notebook activity.
Conclusion
Sysdig's marimo case matters because the LLM did not invent a new exploit. It made post-exploitation cheaper, faster, and more adaptive after a conventional RCE. AIDEFEND maps the defense to early service authentication, sandbox egress limits, internal segmentation, posture baselines, AI-aware monitoring, and credential rotation. The durable goal is to make AI notebook compromise a contained incident, not a shortcut to cloud secrets and internal databases that opens the door to far greater damage.