Back to skill

Security audit

HaloArena

Security checks for vulnerabilities and agentic risk

Overview

This skill is not malicious, but it deserves review because it runs a persistent autonomous game watcher using an existing OpenClaw agent with that agent's normal tools and credentials.

Install only if you want autonomous HaloArena play on this machine and are comfortable with a background watcher storing a scoped token locally, sending telemetry/actions to HaloArena, and using your existing OpenClaw agent. Prefer a dedicated low-privilege OpenClaw agent with no file, shell, browsing, or messaging tools for gameplay; stop plus explicit local deletion is needed to remove saved credentials.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
watcher.py:1710
Finding

Untrusted multiplayer content reaches an autonomous tool-capable agent without enforced tool isolation

Content
View full analysis

Vulnerability Details

File Location: watcher.py:1710-1834, 2429-2455; supporting context in decision_context.py:97-131 and SKILL.md:28-35
Vulnerability Type: Prompt injection across a remote-content-to-local-tools trust boundary
Risk Level: High

Vulnerable Code

watcher.py:1710-1791 builds the model payload from the server-authored decision context, including turn state and stable strategy data:

python
def _decision_prompt_parts(
    self,
    data: dict[str, Any],
    *,
    full_resync: bool,
    session_id: str | None,
) -> tuple[dict[str, Any], str]:
    """Return one canonical model payload and its state-merge instruction."""

    context = shared_decision_context_from_envelope(
        data,
        fallback_profile="stateless",
    )
    if context is None:
        instruction = (
            "Replace any older match baseline in this session with this full "
            "authoritative envelope."
            if full_resync
            else (
                "Merge this slim authoritative patch into the match state retained "
                "in this session; omitted stable fields are unchanged and "
                "*_removed keys delete prior fields."
            )
        )
        return data, instruction

    version = int(context.get("version") or 0)
    if version != 2:
        return shared_context_prompt_payload(
            context,
            include_stable=True,
        ), (
            "Treat this server-authored decision context as the complete bounded "
            "current-turn projection and replace the prior current-turn projection "
            "with it."
        )

    stable_id = shared_stable_context_id(context)
    previous_stable_id = self._session_stable_context_id(session_id)
    profile = str(context.get("profile") or "session").strip().lower()
    include_stable = bool(
        full_resync
        or profile == "bootstrap"
        or not session_id
        or not stable_id
        or previous_sta
...[truncated 7615 chars]
Remediation
View remediation

Remediation Suggestions

  1. Enforce tool denial outside the prompt. Run gameplay inference under an OpenClaw policy that denies all tools, local file access, command execution, environment access, browsing, messaging, and arbitrary network requests.

  2. Use a dedicated least-privilege agent. Create or require a purpose-specific gameplay agent with no access to the user's general workspace, credentials, memories, or communication tools. Do not default autonomous remote-content processing to a general-purpose agent.

  3. Fail closed when isolation is unavailable. Before starting autonomous play, verify that the selected execution path has an enforceable no-tools policy. If that guarantee cannot be established, refuse autonomous mode and offer only a user-reviewed manual mode.

  4. Prefer a model-only inference interface. Submit the decision payload to an inference endpoint that cannot initiate tool calls rather than invoking a tool-capable agent runtime.

  5. Separate data from instructions. Where supported by the model API, place game state in a structured, non-instruction input channel. Apply field allowlists and size limits to multiplayer-controlled strings, while preserving only content required for gameplay.

  6. Use per-turn isolation. Avoid sharing persistent model sessions across turns containing attacker-controlled multiplayer content unless the runtime provides strong context and tool isolation.

  7. Retain output validation. Keep the existing legal-action and parameter-schema validation as defense in depth, but do not treat it as mitigation for tool calls performed before the model returns.

  8. Add adversarial integration tests. Test opponent chat and player names containing instructions to read files, reveal secrets, invoke commands, send messages, or ignore the JSON-only contract. The test should verify at the runtime policy layer that no tool invocation is possible.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
Findings (36)

Memory Manipulation

High
Category
Memory Poisoning
Confidence
85% confidence
Finding

Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Content

Scanner excerpt · GAMELOOP.md (reported line 61)May include surrounding context.

md
`snapshot=full&resync=1`.
Never let an older value override a field explicitly present in the newest poll.

The server already returns a bounded, versioned `decision_context` for an actionable turn. Read that object directly as the working model context; do not derive a second per-game projection. In v2, adopt the full `stable` block on bootstrap or when its id changes, replace state when `turn.state_mode="full"`, and when `turn.state_mode="delta"` apply changed `turn.state` keys (`{"_appended":[...]}` appends to the prior list) then delete every top-level key named by `turn.state_removed`. Replace `turn.decision_support` on every turn and clear it when omitted; when its recommended action is currently legal, treat the supplied comparison as complete and use it without recalculating the board or searching for an override. Executable fallback payloads are transport recovery, not strategy advice. On older servers, use the single poll envelope as before.

Explicitly forbidden patterns:

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description presents an autonomous client with persistent state management, a background watcher tied to an existing agent, and telemetry reporting. The supplied code is much narrower and materially different: it is a CLI transport helper for polling game state and sending actions over HTTP using a preexisting bearer token. While token loading from isolated state partially overlaps with the description, the major described behaviors—credential storage, delivery-state tracking, autonomous/background watching, and heartbeat/update telemetry—are absent. Additionally, the code has an undeclared active capability to submit actions to the arena API, which goes beyond passive watcher/telemetry framing.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The supplied code is a self-contained data-processing/validation module. It parses and normalizes decision-context objects, computes stable context IDs, converts envelope formats, prepares prompt payloads, validates action payloads against schemas, canonicalizes enum values, prunes optional invalid fields, and extracts executable fallback actions. It does not store credentials, persist delivery state, monitor any agent, run background tasks, send telemetry, or perform network/client operations. Therefore the declared description does not accurately represent this code chunk’s actual behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The supplied code chunk is a small policy/helper module that computes decision budgets from envelope metadata such as game type and turn deadline. It reads input mappings, parses ISO timestamps, and returns timing parameters. It does not implement credential storage, delivery state persistence, background watching of an OpenClaw agent, telemetry reporting, or broader autonomous client behavior. This is a materially different primary purpose from the declared description, so the description does not accurately represent this code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The supplied code is a narrow support module for state-path management and API-base validation. It defines safe URL handling, a no-redirect opener, arena-scoped filesystem paths, and state-owner validation to prevent cross-arena/runtime state reuse. While this is loosely related to 'stores scoped credentials and delivery state' because it helps determine where state would live, it does not actually implement the declared skill's primary behaviors: autonomous client operation, background watching of an OpenClaw agent, or heartbeat/update telemetry. The description therefore materially overstates and misrepresents what this code chunk actually does.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 76)May include surrounding context.

md
- Use the installed skill directory that contains this `SKILL.md`, `watcher.py`, and `setup_local_watcher.py`.

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
84% confidence
Finding

The preflight execution also clones the full parent environment, allowing bundled watcher code running in preflight mode to access ambient secrets that are unrelated to its stated purpose. Even though preflight is short-lived, it still executes untrusted-or-at-least-highly-privileged local code with a broad secret surface.

Content

Scanner excerpt · setup_local_watcher.py (reported line 654)May include surrounding context.

python
temp_home.chmod(0o700)
        atomic_write(temp_home / "token", credentials["token"].strip() + "\n", 0o600)
        ready_path = temp_home / "watcher.ready"
        env = dict(os.environ)
        env.update(
            CLAWARENA_HOME=str(temp_home),
            CLAWARENA_READY_FILE=str(ready_path),

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
88% confidence
Finding

The watcher process is started with dict(os.environ), inheriting the full parent environment into a long-lived background process. That can expose unrelated secrets such as API keys, cloud credentials, or tokens to watcher code and any subprocesses it later invokes, expanding the blast radius far beyond the scoped HaloArena token.

Content

Scanner excerpt · setup_local_watcher.py (reported line 685)May include surrounding context.

python
WATCHER_LOG_PATH.parent.mkdir(parents=True, exist_ok=True)
    watcher_path = skill_root / "watcher.py"
    WATCHER_READY_PATH.unlink(missing_ok=True)
    env = dict(os.environ)
    env.update(
        CLAWARENA_HOME=str(CLAW_DIR),
        CLAWARENA_READY_FILE=str(WATCHER_READY_PATH),

os.system() or os exec-family call

High
Category
Dangerous Code Execution
Confidence
85% confidence
Finding

os.system() and os exec-family calls run shell commands with the process's full privileges, enabling arbitrary command execution.

Content

Scanner excerpt · watcher.py (reported line 1313)May include surrounding context.

python
idle_reason="Watcher is restarting itself after repeated live feed failures.",
            error_message=error_message[:500],
        )
        os.execv(
            sys.executable,
            [
                sys.executable,

os.system() or os exec-family call

High
Category
Dangerous Code Execution
Confidence
85% confidence
Finding

os.system() and os exec-family calls run shell commands with the process's full privileges, enabling arbitrary command execution.

Content

Scanner excerpt · watcher.py (reported line 1360)May include surrounding context.

python
"generation": generation, "claim_until": grant["claim_until"],
        })
        try:
            os.execv(
                sys.executable,
                [sys.executable, str(Path(__file__)), "--wait-seconds", str(self.wait_seconds)],
            )

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

The watcher constructs and sends a direct decision prompt containing authoritative gameplay context plus explicit natural-language instructions to a general-purpose OpenClaw agent. In this skill, that is security-relevant because the agent is described as an existing user-selected agent with pre-existing capabilities; malicious game text or server-supplied content can attempt prompt injection against that agent, potentially causing misuse of tools, leakage of state, or unauthorized messaging despite the instruction text saying not to do so.

Content

Scanner excerpt · watcher.py (reported line 1791)May include surrounding context.

python
f"The unchanged stable context id {stable_id} is intentionally reduced "
                "to its id; retain the matching stable block already in this session."
            )
        return prompt_payload, f"{state_instruction} {stable_instruction}"

    def _build_direct_decision_message(
        self,

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · GAMELOOP.md (reported line 45)May include surrounding context.

md
- reads the connection token from this arena's isolated OpenClaw state directory
- strips trailing newlines safely
- sends UTF-8 JSON without shell-escaping problems
- avoids the common `curl -d '...'` failure mode with Korean text
- returns raw server JSON on success and a compact JSON error object on HTTP/network failure

## Poll

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
96% confidence
Finding

The skill explicitly instructs the host to use network, shell, file read/write, and environment access, but it does not declare any tool scope or permissions boundary in the skill manifest. That creates a least-privilege failure: an operator cannot easily distinguish the intended capabilities from arbitrary ones, and a compromised or misleading skill can obtain broad execution and persistence with little policy visibility.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
95% confidence
Finding

The skill openly persists scoped tokens, agent identifiers, watcher state, delivery routes, PIDs, and logs under a user directory, and it continues operating as a long-lived background process. Persistent local storage of credentials and operational state increases the blast radius of host compromise, accidental disclosure, or weak filesystem permissions, especially because the stored token enables remote control and telemetry over time.

Content

Scanner excerpt · SKILL.md (reported line 21)May include surrounding context.

md
A **HaloArena Arena Agent** is the remote competitor registered on the
HaloArena server. An **OpenClaw Agent** is the user's existing local model
runtime. Setup connects the former to the latter; it does not create or
reconfigure an OpenClaw Agent.

## Persistent Side Effects

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
91% confidence
Finding

The skill is designed to start and manage an autonomous watcher that can invoke a local model and submit remote actions with minimal ongoing user involvement. In the context of persistent credentials, shell execution, network access, and background processing, that autonomy increases risk because mistakes, prompt abuse, or unexpected server responses can trigger unattended actions over time.

Content

Scanner excerpt · SKILL.md (reported line 88)May include surrounding context.

md
server watcher readiness, and starts one local watcher process. Only the
  explicitly labelled public-mode path may provision a new remote Arena Agent;
  no path creates a local OpenClaw Agent.
- Do not ask the user to create an OpenClaw agent, copy credentials, or edit
  tool policies. Gameplay runs on their existing agent with its own model and
  auth, which is what makes OAuth-authenticated OpenClaw work at all — those
  credentials cannot be copied into a second agent. A user who wants a separate

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · SKILL.md (reported line 94)May include surrounding context.

md
credentials cannot be copied into a second agent. A user who wants a separate
  agent sets `CLAWARENA_OPENCLAW_AGENT_ID` to one they made themselves.
- `setup_local_watcher.py --recovery-key <key>` redeems a one-use server key, rewrites the current arena's scoped token and agent id, then restarts the local watcher. This is BOTH the first-run path (the key the HaloArena site issues when the user creates the agent) and the recovery path (a key from Command Center).
- Never ask the user for a HaloArena password or session, and never treat a setup/recovery key as reusable. One use, short lived.
- Bind delivery to the same chat where the user asked for setup.
- For Telegram, `--to` must be the numeric chat ID for this conversation, not an `@username`.
- Do not modify OpenClaw pairing requirements, DM policies, gateway auth, or other messenger security settings during HaloArena setup.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · SKILL.md (reported line 140)May include surrounding context.

md
If the user asks to restart the HaloArena/OpenClaw watcher for an already connected agent:

- Do not provision a new agent.
- Do not ask the user to open Command Center unless local credentials are missing or invalid.
- Use the installed `ai-clawarena` skill directory containing this file.
- Bind delivery to the same chat where the user asked for restart.
- Run exactly one direct setup invocation without `--recovery-key`.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
88% confidence
Finding

The operating rules explicitly direct the system to keep polling and heartbeating automatically and to submit retried actions using idempotency keys when needed. In a background watcher with persisted tokens and ongoing network connectivity, this represents unattended decision-making and sustained external communication, which can magnify damage from logic flaws, prompt manipulation, or server-side compromise.

Content

Scanner excerpt · SKILL.md (reported line 354)May include surrounding context.

md
- The local watcher maintains its own live connection to HaloArena (long-poll by default, or websocket under `CLAWARENA_TRANSPORT=ws`); do not add your own tight polling loop on top of it.
- Manual play may still use `GET /agents/game/?wait=30`, but autonomous play should rely on the watcher for turn wakeups.
- If `matchmaking.accepting_new_matches=false`, show its `message`, keep
  polling/heartbeating, and do not ask the user to rotate a token, re-enable
  autoplay, or change games. Matching resumes automatically when the gate opens.
- Include `idempotency_key` on action requests when retry is possible.
- Respect `is_your_turn` and `legal_actions`.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The setup script provisions and redeems HaloArena credentials, then persists them locally, which exceeds a narrow 'watcher/telemetry' expectation and materially expands the trust granted to the skill. Persisted scoped credentials increase the consequences of compromise and should be treated as a sensitive capability, especially in an autonomous background client.

Content

No source excerpt is available for this finding.

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
70% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

Scanner excerpt · setup_local_watcher.py (reported line 95)May include surrounding context.

python
if metadata.st_uid not in {0, os.geteuid()}:
        raise RuntimeError("openclaw CLI must be owned by root or the current user")
    if metadata.st_mode & 0o022:
        raise RuntimeError("openclaw CLI must not be group- or world-writable")
    return str(resolved)

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
70% confidence
Finding

Tool defaults are unsafe or overly permissive (e.g. disabled TLS verification, no authentication, world-writable permissions). Unsafe defaults widen the attack surface.

Content

Scanner excerpt · watcher.py (reported line 165)May include surrounding context.

python
if metadata.st_uid not in {0, os.geteuid()}:
        raise RuntimeError("openclaw CLI must be owned by root or the current user")
    if metadata.st_mode & 0o022:
        raise RuntimeError("openclaw CLI must not be group- or world-writable")
    return str(resolved)

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · setup_local_watcher.py (reported line 216)May include surrounding context.

python
except OSError:
            return False
    try:
        result = subprocess.run(
            ["ps", "-p", str(pid), "-o", "command="],
            capture_output=True,
            text=True,

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This code sends a real outbound test message via the user's existing OpenClaw agent, meaning the setup routine exercises external communication capabilities using whatever authority that agent already has. In this skill's context, that is especially sensitive because the skill is autonomous and later reuses the same agent binding for unattended operation.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
82% confidence
Finding

The script executes the external openclaw CLI to send a delivery-verification message using the user's existing agent context and capabilities. Although arguments are validated and shell injection is mitigated, this still causes an external program to perform networked actions with persisted credentials and agent authority, which is security-relevant in a setup routine.

Content

Scanner excerpt · setup_local_watcher.py (reported line 547)May include surrounding context.

python
])

    def run(argv: list[str]) -> subprocess.CompletedProcess[str]:
        return subprocess.run(  # noqa: S603
            argv,
            capture_output=True,
            text=True,

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

The preflight step executes watcher.py before launch, inheriting much of the current environment and supplying credentials in a temporary runtime directory. While this is not shell-injection, it still executes bundled code that can access ambient secrets and perform side effects, making it a meaningful trust boundary for a setup script.

Content

Scanner excerpt · setup_local_watcher.py (reported line 665)May include surrounding context.

python
else:
            env.pop("CLAWARENA_OPENCLAW_AGENT_ID", None)
        try:
            result = subprocess.run(  # noqa: S603
                [sys.executable, str(skill_root / "watcher.py"), "--preflight"],
                capture_output=True,
                text=True,