T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/interrupt.py:138- Finding
Untrusted PID Marker Allows Arbitrary Process-Tree Termination
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is an emergency agent kill-and-rollback tool, but its broad process-killing and persistent agent-file modification powers have weak safeguards and should be reviewed before use.
Install only if you need emergency interruption and rollback for OpenClaw agents and you trust the local OpenClaw configuration. Use dry-run and single-agent targeting first, avoid enabling the watcher or cron automation unless you accept persistent AGENTS.md changes, and keep separate backups because a bad marker, broad workspace match, or crafted agent ID could stop the wrong process or alter future agent behavior.
scripts/interrupt.py:138Untrusted PID Marker Allows Arbitrary Process-Tree Termination
scripts/interrupt.py:73Workspace Substring Matching Can Kill Unrelated Processes
scripts/run.py:35Unsanitized Agent IDs Enable Marker-Path Traversal
scripts/install.py:32Persistent Agent Instruction Injection Through Unvalidated Configuration Fields
The skill is framed as a targeted interrupt tool, but its broader behavior includes automatic agent discovery, configuration reads, and writing integration content into AGENTS.md files. This expands the trust boundary from a single operational action to persistent modification across agent workspaces, which is more dangerous than the user-facing description suggests.
The skill is framed as a targeted interrupt tool, but its broader behavior includes automatic agent discovery, configuration reads, and writing integration content into AGENTS.md files. This expands the trust boundary from a single operational action to persistent modification across agent workspaces, which is more dangerous than the user-facing description suggests.
The skill is framed as a targeted interrupt tool, but its broader behavior includes automatic agent discovery, configuration reads, and writing integration content into AGENTS.md files. This expands the trust boundary from a single operational action to persistent modification across agent workspaces, which is more dangerous than the user-facing description suggests.
The skill is framed as a targeted interrupt tool, but its broader behavior includes automatic agent discovery, configuration reads, and writing integration content into AGENTS.md files. This expands the trust boundary from a single operational action to persistent modification across agent workspaces, which is more dangerous than the user-facing description suggests.
The rollback deletes the last user message and all subsequent messages, which is more destructive than the stated goal and can erase the very instruction needed for auditability and safe recovery. In this skill context, an interrupt command is explicitly designed for emergency intervention, so incorrect rollback semantics can corrupt agent history, destroy evidence, and enable unauthorized tampering with conversation state.
The skill advertises capabilities that imply shell execution, environment access, and file read/write, but it does not declare any tool scope or permission boundaries. For a skill that can terminate processes, modify transcripts, and write to agent files, missing least-privilege constraints increases the chance of unintended destructive actions or abuse if invoked broadly.
The trigger phrases include broad natural-language terms like 'kill all' and '打断', which can overlap with normal conversation and cause accidental activation. Because the described actions are destructive—terminating processes and rolling back memory—ambiguous triggers materially raise the risk of unintended disruption.
The skill describes process termination and transcript rollback as core behavior but does not present a prominent explicit warning or confirmation requirement. In context, rollback deletes the triggering user message and subsequent history, so accidental or misunderstood use can cause irreversible workflow disruption and loss of state.
The documentation describes a background watcher/cron mechanism that auto-injects content into new agents' files, which is broader and more persistent than an on-demand interrupt skill. Automatic propagation increases blast radius and can silently alter future agents without a fresh user decision.
The installer persistently modifies every target agent's AGENTS.md to change future execution behavior, effectively propagating this skill's control mechanism across agents. That exceeds a narrow 'interrupt/rollback' function and creates a cross-agent trust boundary issue: once installed, many agents are instructed to route long-running Python tasks through this skill's wrapper, giving the skill durable influence over later executions.
The script enumerates all configured agents from openclaw.json and bulk-appends operational instructions into each workspace's AGENTS.md. In the context of a task-kill skill, this broad configuration rewriting is more dangerous because it scales a persistent behavior change across the environment, increasing blast radius if the injected protocol is incorrect, abused, or later coupled with unsafe interrupt logic.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
if sys.platform == "win32":
# Use WMIC which is faster than Get-WmiObject for CommandLine queries
try:
result = subprocess.run(
["wmic", "process", "get", "ProcessId,CommandLine", "/format:csv"],
capture_output=True, text=True, encoding="utf-8", timeout=10
)
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
pass
else:
try:
result = subprocess.run(["ps", "aux"], capture_output=True, text=True, timeout=10)
for line in result.stdout.splitlines():
if workspace in line:
parts = line.split()
The function docstring at L133 says it will kill a PID and all its children recursively, which reads as a general capability. In reality, the implementation unconditionally invokes PowerShell and WMI, so on non-Windows systems it does not perform the documented behavior and would fail if reached.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def kill_pid_tree(pid, dry_run=False):
"""Kill a PID and all its children recursively."""
# Get all descendant PIDs
result = subprocess.run(
["powershell", "-Command",
f"$pids = @({pid}); $queue = @({pid}); while ($queue.Count -gt 0) {{ $p = $queue[0]; $queue = $queue[1..($queue.Count-1)]; $children = Get-WmiObject Win32_Process | Where-Object {{ $_.ParentProcessId -eq $p }} | Select-Object -ExpandProperty ProcessId; foreach ($c in $children) {{ $pids += $c; $queue += $c }}; }}; $pids -join ','" ],
capture_output=True, text=True, encoding="utf-8"
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
print("[interrupt] DRY-RUN: skipping kill")
return True
for p in all_pids:
subprocess.run(
["powershell", "-Command", f"Stop-Process -Id {p} -Force -ErrorAction SilentlyContinue"],
capture_output=True
)
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
for p in procs:
if sys.platform == "win32":
subprocess.run(
["powershell", "-Command", f"Stop-Process -Id {p['pid']} -Force -ErrorAction SilentlyContinue"],
capture_output=True
)
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
capture_output=True
)
else:
subprocess.run(["kill", "-9", str(p["pid"])], capture_output=True)
print(f"[interrupt] Killed PID {p['pid']}")
# Verify all processes are dead
The script rewrites the session transcript immediately after determining what to remove, without any interactive confirmation or equivalent safeguard. In a skill whose purpose is to kill tasks and roll back sessions, this materially increases the chance of accidental or coerced destructive state changes, resulting in loss of audit trail and denial of service to the agent workflow.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
openclaw_home = find_openclaw_home()
proc = subprocess.Popen(cmd_args)
register(openclaw_home, args.agent, proc.pid, args.session)
print(f"[run] Started PID {proc.pid} for agent {args.agent}: {' '.join(cmd_args)}")
This script enumerates all configured agents and persistently appends instructions into each agent's AGENTS.md, which is a cross-agent modification capability not necessary for a narrowly scoped interrupt/rollback function. Because AGENTS.md influences future agent behavior, this creates lasting control-plane changes outside the user’s immediate kill request and expands the skill’s authority beyond its declared purpose.
The script reads the global agent configuration, discovers other agents' workspaces, and writes persistent content into their documentation files in bulk. In the context of a kill/rollback skill, that cross-agent discovery and propagation capability is over-privileged and could be abused to influence multiple agents' future execution patterns without direct user awareness.
The script writes to AGENTS.md automatically and only emits a log message after the fact, providing no prior notice or consent before making persistent behavioral changes. Silent modification of agent instruction files is dangerous because it can alter how agents operate in future sessions and bypass normal user expectations about when workspace content is being changed.
The file documentation frames this as an auto-install script for "agent-interrupt," and the injected block repeatedly instructs agents to use that integration. This conflicts with the provided skill identity and purpose context for "claw-mission-killer," creating intent ambiguity about what skill is actually being installed and invoked.
No suspicious patterns detected.