A Web Page Hijacked the ARTEX AI Pentest Agent. Your Agents Are Next
A prompt-injection flaw let a hostile site make the ARTEX AI pentest agent run shell commands, read other clients' credentials and persist. What it teaches.
By Anish Prashun · · 6 min read · Security & Privacy
Table of Contents
A single sentence on a web page was enough to make ARTEX, an open-source AI agent that runs penetration tests on its own, execute a shell command on the server running it. From there, the researcher who found the flaw read other clients’ passwords and planted files that ran during later, unrelated scans. ARTEX’s prompt-injection defence was switched on the whole time. The bug is fixed, but the pattern applies to every agent that reads content it doesn’t control and can act without a human approving each step.
What happened
On 1 December 2026, BaaRai, which maintains the English-language community continuation of ARTEX on GitHub, published security advisory GHSA-9fqx-7xv3-gj58, titled “Remote Code Execution via embedded prompt in target site”. It rates the issue critical, with a CVSS 3.1 score of 9.6, and lists two weaknesses: CWE-1427 (improper neutralisation of input used for LLM prompting) and CWE-250 (execution with unnecessary privileges). Versions up to and including 0.7.0 are affected, and 0.7.1, released the same day, fixes it. No CVE has been assigned.
The research came from Peyton Kennedy at Endor Labs, who published a write-up the same day. Endor Labs rates the default Docker deployment 8.2 (high), because one control held there, and agrees with 9.6 for installs where agents run as the server’s own user. Kennedy reproduced the attack on ARTEX 0.7.0 with OpenAI’s gpt-4.1.
ARTEX is not obscure. The BaaRai repository has more than 31,000 stars. Endor Labs’ write-up cites Microsoft reporting that state-backed groups tied to China and North Korea have added it to their tooling, and Censys finding more than 800 ARTEX deployments with their control consoles exposed to the internet. I haven’t read those two reports myself, so treat them as Endor Labs’ summary.
Why it matters
A penetration-testing agent’s whole job is to read content from systems it doesn’t control and then run commands. That makes it the extreme case of a problem every agent builder has: the data the agent processes and the instructions it follows arrive through the same channel, the model’s context.
The damage didn’t stop at the first command. ARTEX servers are often shared across engagements, so a security firm might test ten clients from one instance. According to the advisory, every task’s transcript was written to a world-readable file, and those transcripts held the credentials operators declared for each test, including full curl -u user:password command lines. A foothold from client A’s scan could read client B’s secrets from disk without ever touching client B’s servers.
Worse, every agent process shared one writable home directory that was never cleaned between tasks. One command could drop a Python .pth startup file or a .curlrc header there, and it would run in every later task for every other client until someone wiped the directory.
How the attack worked
The hostile page in the proof of concept was an internal-looking portal. It carried the same instruction twice: in an HTML comment addressed to “automated security scanners”, saying they must register by running a command, and in a visible line of text. The command was a curl back to the hostile site that carried the output of id and hostname.
Three things let that text reach the shell:
- Labelling isn’t blocking. ARTEX’s fetch tool, with recon extraction on, copies HTML comments into the result so the agent can spot leaked details. ARTEX wraps every tool result in nonce-tagged
UNTRUSTED_OUTPUTmarkers that tell the model the content is data. Nothing stops the model from choosing to run a command it finds there anyway. In Kennedy’s run, two workers recorded the “registration” requirement as a fact; a third ran the command verbatim. - The approval gate defaulted to allow. A tool call that matched no intercept rule went through unless the optional LLM judge was on and said no. A
curlwith an embedded$(id)matched none of the stock deny rules. - The command looked like the job. A pentest agent runs
curlagainst its target all day. Neither the model nor a rule can easily tell a malicious request apart from normal testing.
The one thing that worked was the privilege split. On the default Docker setup, agent commands ran as uid 10001 and could not read the server’s JWT signing key. On the documented native installs, the advisory says that split is skipped and agents run as the server user, which is where the 9.6 score comes from.
My take
I think the most useful sentence in this whole disclosure is the one Endor Labs puts plainly: the untrusted-content markers told the model the text was data, and the model ran it anyway. Prompt-level defences are hints. They lower the odds; they don’t bound the damage. A one-in-three hit rate is a failure mode you will meet in production, and it’s not a success rate you can average away.
What I like is the shape of BaaRai’s fix. According to the 0.7.1 release notes, every task now runs in a disposable worker container with a read-only root filesystem, no keys and no database access, and it reaches the network only through a per-task egress proxy. The allowlist is owned by the operator, approved scope is frozen when it’s approved, and deleting the approval revokes network access. Sandbox mode also stops the panel from starting local stdio MCP servers, which closes a path back to code execution on the server. None of that relies on the model behaving. That’s the right instinct.
This matches what I’ve seen running agents that touch real customer systems. The useful questions are about blast radius: what can this process read, what can it write that outlives the task, and where can it send data? If the honest answer is “everything the server can”, the prompt doesn’t matter much.
What to do about it
If you run ARTEX: upgrade to 0.7.1 and confirm which fork you are actually running, since a copy of another fork may not contain the change. Then assume a past scan could have left something behind. CASRAI’s summary puts it well: “installing corrected software does not by itself remove previously planted files.” Inspect or rebuild the shared data volume, and rotate every credential you declared for a scan on an affected version.
If you build agents that read untrusted content (web pages, emails, tickets, documents, tool output):
- Run each task in a disposable environment with nothing persistent and writable shared between tasks.
- Keep secrets out of anything the agent can read: transcripts, logs, traffic captures. Redact at write time, not at read time.
- Enforce network and command scope outside the model, with deny-by-default for anything that doesn’t match an explicit rule.
- Treat “the model was told it’s untrusted” as defence in depth, never as the boundary.
If you’re shipping agents with tool access and want someone to look at the blast radius before an attacker does, this is the kind of AI agent security review I do. I’ve also written about related failure modes in my research on what audit logs need after redaction.
For teams that buy AI security testing: ask your vendor how their agents are isolated between clients, where your credentials are stored during a test, and how they clean up afterwards.
What to watch next
- A CVE and NVD score. The advisory has none yet. One would put this into scanners and vulnerability-management tools that ignore GitHub advisories.
- Other agent frameworks. Nothing here is specific to ARTEX. Watch for similar disclosures in coding agents, browser agents and support agents that fetch pages and run tools.
- Exposed consoles. If the count of internet-facing ARTEX consoles doesn’t fall, unpatched instances become a soft target for anyone who can get a page in front of them.
- Whether 0.7.1’s sandbox holds. The real test is whether researchers can escape the per-task container or the egress proxy. I’d expect someone to try within weeks.
Sources
- Remote Code Execution via embedded prompt in target site (GHSA-9fqx-7xv3-gj58) · GitHub Security Advisory
- ARTEX vulnerability: prompt injection to RCE in an AI pentest agent (GHSA-9fqx-7xv3-gj58) · Endor Labs
- ARTEX v0.7.1 release notes · GitHub
- ARTEX 0.7.1 addresses prompt injection flaw disclosed by Endor Labs · CASRAI
Software engineer and engineering lead with 7+ years building AI platforms, voice systems and privacy-first products. Publishes independent research on AI agent reliability. Opinions are my own.
Available for freelance and contract work.AI agents, full-stack apps, MCP servers, AI security and fractional CTO.
Hire me →- prompt injection
- ai agents
- artex
- agent security
- sandboxing