Skip to content
RCE Write-up Advanced

CVE-2025-67511: Tricking a Security AI Agent Into Pwning Itself

The CAI framework's SSH command tool did not fully escape shell input, so a hostile target could inject commands. An attacker could therefore run arbitrary commands on the machine hosting the AI agent.

Edoardo Ottavianelli Follow

Published on hacktivesecurity.com

AI Application Security

Edoardo Ottavianelli, on hacktivesecurity.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the tool concatenated untrusted input into a shell command without complete escaping, so shell metacharacters were interpreted.

Impact

An attacker controlling a target the agent connects to could achieve remote command execution on the agent's host.

What the attacker needed

AI agent uses the SSH tool; attacker controls the SSH target

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

An AI agent is a program that can use tools, such as running commands on another computer over SSH. This tool built a command line from text it received without properly neutralising special characters, so text from a malicious target could add extra commands. Those extra commands then ran on the agent's own machine.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by Edoardo Ottavianelli

View all

2 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.