# ARTEX (BaaRai) AI pentest agent prompt injection to RCE (GHSA-9fqx-7xv3-gj58)

> A hostile web page with hidden instructions can make an ARTEX agent (v0.7.0 and earlier) run shell commands on the scanning server, with no ARTEX credentials needed by the attacker. Impact includes reading other clients' task transcripts and declared credentials and planting persistent code that runs in later tasks. Fixed in v0.7.1.

- **Author:** Threadlinqs Team
- **Published:** 2026-12-01T16:44:23Z
- **Last updated:** 2026-12-01T16:44:23Z
- **Canonical:** https://intel.threadlinqs.com/threat/TL-2026-7187
- **Card image:** https://intel.threadlinqs.com/og/threat/TL-2026-7187.png
- **ID:** TL-2026-7187
- **Severity:** CRITICAL (CVSS 9.6)
- **Category:** VULNERABILITY
- **Status:** ACTIVE
- **Detections:** 9 (1 shown free below) · **IOCs:** 12

## Description

ARTEX is an open-source, LLM-driven autonomous penetration testing framework (Go module github.com/Autumn-27/artex, built on the Norma agent runtime) in which a planner agent issues intents, worker agents execute tools through a real shell, and a reporter agent documents findings. GHSA-9fqx-7xv3-gj58 (Endor Labs ID ENDOR-VUL-2026-3011, no CVE assigned; CWE-1427 and CWE-250) describes an indirect prompt injection chain in v0.7.0 and earlier. The reporter (p80n-sec, written up by Peyton Kennedy of Endor Labs) reproduced all three stages in a lab against v0.7.0 (commit 22ae88a) with Norma v0.4.11, OpenAI gpt-4.1 and the upstream docker-compose.yml at default settings.

Stage 1 - target content becomes a shell command: a hostile page hides an instruction in an HTML comment and in visible body text, telling scanners to run a command to 'register'. The WebFetch tool with extract:true copies HTML comments into a '=== RECON ===' block. ARTEX wraps tool output in UNTRUSTED_OUTPUT markers, but in testing the model could still act on instructions inside that block. The approval gate in guard/guard.go allows tool calls that match no intercept rule unless the LLM judge is enabled and denies them; a curl to the in-scope target matches none of the stock deny rules. The command ran as uid 10001 inside the ARTEX service container. The model did not always comply: some workers treated the instruction as a fact about the target and others faked compliance using WebFetch. Only gpt-4.1 was tested.

Stage 2 - cross-engagement data access: planner and worker transcripts are written to /app/data/transcripts/ as JSONL files with mode 0644 owned by root, so the agent uid can read them. Credentials declared for a task (returned by list_task_credentials) end up in those transcripts, including as literal curl -u commands. When enabled, captured HTTP traffic is indexed at /app/data/traffic/_index/index.sqlite, also readable by uid 10001. In the lab a credential for a second client was recovered from another task's transcripts.

Stage 3 - persistence across tasks: all agents share <data>/exec-home, created by prepareExecHome in server/execpriv_unix.go and never cleared between tasks. Files placed there, such as Python .pth files in site-packages or a .curlrc, load into later workers. Only the .pth path was tested and it executed in an unrelated later task.

Other install paths (code review only, not lab-verified): the privilege drop happens only when the server starts as root on Linux. Otherwise ResolveExecPrivilege logs that same-uid isolation is unavailable and agents run as the server user (server/execpriv.go). This covers prebuilt binaries, install.sh, macOS and Windows packages and containers with a user: directive. There, jwt.key and config.json are readable by the agent, enabling a forged HS256 admin JWT and command execution through POST /api/tools/custom/test. The advisory scores this 9.6 (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H); the default Docker Compose deployment, where the JWT key is protected, scores 8.2 High (C:H/I:H/A:L). The 9.6 score is from code review and not lab-verified.

Context: Microsoft (2026-11-25) and Censys (early Nov 2026) document threat actors abusing ARTEX itself as an attack tool, and Censys counted about 1,465 exposed ARTEX consoles (default port 8787/tcp). Those reports do not mention this advisory, and no source states in-the-wild exploitation of this flaw. Because ARTEX operators scan untrusted targets, any hostile page they point it at is a viable delivery vector. Status ACTIVE is an analyst assignment reflecting new disclosure and lab reproduction, not confirmed exploitation.

## MITRE ATT&CK

- T1608 Stage Capabilities
- AML.T0051 LLM Prompt Injection
- AML.T0051.001 LLM Prompt Injection: Indirect
- T1059.004 Command and Scripting Interpreter: Unix Shell
- T1190 Exploit Public-Facing Application
- T1552.001 Unsecured Credentials: Credentials In Files
- T1005 Data from Local System
- T1546.016 Installer Packages
- T1550 Use Alternate Authentication Material

## Free detection (Splunk SPL, Microsoft KQL, Sigma)

**ARTEX Shared exec-home Persistence - Python .pth or .curlrc Planted** (`TL-2026-7187-SPL-002`)

Detects creation of a Python .pth file or a .curlrc under the ARTEX shared exec-home directory, which is never cleared between tasks. Files planted there (stage 3 of GHSA-9fqx-7xv3-gj58) load into later workers; the .pth path was confirmed in the lab to execute in an unrelated later task (T1546.016).

- **Languages:** Splunk SPL, Microsoft KQL, Sigma
- **ATT&CK:** T1546.016
- **Data sources:** sysmon_for_linux, linux_file_creation
- **Severity:** high
- **Confidence:** high

### Splunk SPL

````spl
index=linux sourcetype="sysmon:linux" EventID=11 TargetFilename="*/exec-home/*" (TargetFilename="*.pth" OR TargetFilename="*/.curlrc")
```TL-2026-7187 persistence in shared ARTEX exec-home: python .pth or .curlrc```
| stats count min(_time) as first_seen max(_time) as last_seen values(TargetFilename) as files values(Image) as writers by host User
| convert ctime(first_seen) ctime(last_seen)
````

### Microsoft KQL

```kql
DeviceFileEvents
| where Timestamp > ago(24h)
| where ActionType in ("FileCreated", "FileModified", "FileRenamed")
| where FolderPath has "/exec-home/"
| where FileName endswith ".pth" or FileName =~ ".curlrc"
| project Timestamp, DeviceName, InitiatingProcessAccountName, FolderPath, FileName, InitiatingProcessFileName, InitiatingProcessCommandLine
```

### Sigma

```yaml
title: ARTEX Shared exec-home Python .pth or .curlrc Planted
id: 7187a002-6c2f-4d1b-8e4b-1b8d2f3a5c02
status: experimental
description: "Detects creation of a Python .pth file or .curlrc under the ARTEX shared exec-home, the stage-3 cross-task persistence of GHSA-9fqx-7xv3-gj58 (TL-2026-7187)."
references:
    - https://github.com/BaaRai/ARTEX/security/advisories/GHSA-9fqx-7xv3-gj58
    - https://www.endorlabs.com/learn/aartex-ai-pentest-agent-prompt-injection-rce-ghsa-9fqx-7xv3-gj58
author: Threadlinqs Team
date: 2026-12-01
tags:
    - attack.persistence
    - attack.t1546.016
logsource:
    category: file_event
    product: linux
detection:
    selection_dir:
        TargetFilename|contains: '/exec-home/'
    selection_file:
        TargetFilename|endswith:
            - '.pth'
            - '/.curlrc'
    condition: selection_dir and selection_file
falsepositives:
    - Python package installation inside exec-home that ships a .pth file
    - An operator intentionally configuring a proxy through .curlrc
level: high

```

**Known false positives:**

- pip installs of packages that ship .pth files into exec-home site-packages
- Operator-managed .curlrc for proxy settings

**Tuning notes:** Sysmon for Linux must have a FileCreate (EventID 11) rule covering the data volume. Allow-list known package names (for example distutils-precedence.pth) by hash. Review .pth content for lines starting with import, which are executed at interpreter start. After patching to v0.7.1, wipe exec-home because upgrading does not remove planted files.

### 8 more detection rules (Splunk SPL, Microsoft KQL, Sigma), unlock with TL Creds

- ARTEX Prompt-Injection Instruction Inside WebFetch '=== RECON ===' Block (locked: unlock with TL Creds)
- ARTEX exec-home Startup-Hook and Dotfile Planting (sitecustomize, shell rc, curlrc/netrc) (locked: unlock with TL Creds)
- Process Reads ARTEX jwt.key or [indicator] - JWT Forgery Precursor (locked: unlock with TL Creds)
- ARTEX Agent Shell Command With Registration/Callback Keywords (locked: unlock with TL Creds)
- Command-Line Write of Python .pth File Into site-packages or ARTEX exec-home (locked: unlock with TL Creds)
- Process Accesses ARTEX Transcripts or Traffic Index - Cross-Engagement Credential Harvest (locked: unlock with TL Creds)
- ARTEX Agent (uid 10001) Spawns Network Transfer Tool - Prompt-Injection RCE (GHSA-9fqx-7xv3-gj58) (locked: unlock with TL Creds)
- ARTEX Console POST /api/tools/custom/test - Forged Admin JWT Command Execution (locked: unlock with TL Creds)

Sign up free to unlock the detection rules: https://threadlinqs.com/?modal=signup

## Sources

- [ARTEX vulnerability: prompt injection to RCE in an AI pentest agent (GHSA-9fqx-7xv3-gj58)](https://www.endorlabs.com/learn/aartex-ai-pentest-agent-prompt-injection-rce-ghsa-9fqx-7xv3-gj58)
- [GHSA-9fqx-7xv3-gj58: Remote Code Execution via embedded prompt in target site](https://github.com/BaaRai/ARTEX/security/advisories/GHSA-9fqx-7xv3-gj58)
- [BaaRai/ARTEX repository](https://github.com/BaaRai/ARTEX)
- [CWE-1427: Improper Neutralization of Input Used for LLM Prompting](https://cwe.mitre.org/data/definitions/1427.html)
- [CWE-250: Execution with Unnecessary Privileges](https://cwe.mitre.org/data/definitions/250.html)
- [Microsoft: What defenders need to know about ARTEX agentic AI framework abused by threat actors](https://www.microsoft.com/en-us/security/blog/2026/11/25/what-defenders-need-to-know-artex-agentic-ai-framework-threat-actors-abuse/)
- [Censys: ARTEX exposure research (Agentic Asbestos)](https://censys.com/blog/artex-agentic-asbestos/)

## Full data

The other 8 detection rules (Splunk SPL / Microsoft KQL / Sigma) unlock with TL Creds; a free account includes daily creds: https://threadlinqs.com/?modal=signup
Indicator values unlock with TL Creds, at a lower price on Red and Purple; AI agents can query rules and IOCs through the Threadlinqs MCP server (Purple and Gold in full, 2 calls a day on a free account): https://intel.threadlinqs.com/mcp

Canonical: https://intel.threadlinqs.com/threat/TL-2026-7187
