Back to skill

Security audit

Execution Harness

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed agent-reliability hook suite, but it asks for broad persistent control over Claude sessions and includes several under-scoped automatic actions.

Install only if you are comfortable giving this package persistent hook influence over Claude Code sessions. Prefer project-scoped settings, validate or sanitize session IDs before use, avoid enabling the tmux recovery script on a schedule unless panes are allowlisted, and change npx diagnostics to use an already-installed local compiler or no-install mode.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
execution-loop/scripts/ralph-init.sh:11
Finding

Unvalidated session identifiers permit filesystem path traversal

Content
View full analysis
[max-iterations] [original-task]}" MAX_ITERATIONS="${2:-50}" ORIGINAL_TASK="${3:-}" SESSION_DIR="${HOME}/.openclaw/shared-context/sessions/${SESSION_ID}" mkdir -p "$SESSION_DIR/handoffs" STATE_FILE="${SESSION_DIR}/ralph.json" ``` Representative code from `context-memory/scripts/compaction-extract.sh`: ```bash INPUT=$(head -c 20000) SESSION_ID=$(echo "$INPUT" | jq -r '.session_id // ""' 2>/dev/null) [ -z "$SESSION_ID" ] && SESSION_ID="${NC_SESSION:-}" [ -z "$SESSION_ID" ] && echo '{"continue":true}' && exit 0 SESSION_DIR="${SESSIONS_DIR}/${SESSION_ID}" HANDOFFS_DIR="${SESSION_DIR}/handoffs" STATE_FILE="${SESSION_DIR}/compaction-extract.json" mkdir -p "$HANDOFFS_DIR" ``` Representative code from `execution-loop/scripts/ralph-cancel.sh`: ```bash SESSION_ID="${1:?Usage: ralph-cancel.sh [reason]}" REASON="${2:-user_abort}" SESSION_DIR="${HOME}/.openclaw/shared-context/sessions/${SESSION_ID}" mkdir -p "$SESSION_DIR" NOW=$(date -u +%FT%TZ) EXPIRES=$(date -u -v+30S +%FT%TZ 2>/dev/null || date -u -d '+30 seconds' +%FT%TZ) CANCEL_FILE="${SESSION_DIR}/cancel.json" ``` ### Technical Analysis Multiple scripts accept a session identifier from hook JSON, the `NC_SESSION` environment variable, or a com ...[truncated 2734 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
quality-verification/scripts/post-edit-check.sh:33
Finding

Automatic post-edit diagnostics may fetch and execute an unpinned npm package

Content
View full analysis
/dev/null && { [ -f "$(dirname "$FILE")/tsconfig.json" ] || [ -f "tsconfig.json" ]; }; then # tsc --noEmit without file arg checks whole project respecting tsconfig.json TYPE=$(npx tsc --noEmit 2>&1 | grep -E 'error TS' | grep -i "$(basename "$FILE")" | head -3) || true [ -n "$TYPE" ] && ERRORS="${ERRORS}tsc: ${TYPE}\n" fi ;; ``` ### Technical Analysis The PostToolUse hook automatically invokes `npx tsc --noEmit` after a TypeScript or TSX file is edited. The command does not: - Disable automatic installation - Require a local TypeScript installation - Pin a package version - Verify the dependency against a reviewed lockfile - Validate package provenance before execution Depending on the installed npm/npx version and local project state, `npx` may resolve a missing command through the npm registry. This changes a local diagnostic action into a potential network retrieval and code-execution operation. The trigger is broad: a TypeScript edit and the presence of a `tsconfig.json` are sufficient. Therefore, the operation can run automatically as part of normal agent editing rather than through a separate, explicit dependency-installation decision. ### Attack Path 1. A user or agent opens an untrusted repository containing `tsconfig.json` and a TypeScript file. 2. The repository does not contain a trusted local TypeScript compiler, or command resolution otherwise causes `npx` to query the registry. 3. The agent edits a `.ts` or `.tsx` file. 4. The PostToolUse hook invokes `npx tsc --noEmit`. 5. `npx` resolves and may download an external package or command implementation. 6. Retrieved package code executes with the permissions and environment of the user running the hook. ...[truncated 591 chars]
Remediation
View remediation
&1 | ...) fi ``` 2. If `npx` must be retained, explicitly prohibit installation: ```bash npx --no-install tsc --noEmit ``` 3. Verify that `typescript` is declared in the project manifest and pinned by a reviewed lockfile before execution. 4. Do not automatically install dependencies from a PostToolUse hook. 5. Require explicit user approval before any diagnostic operation that may access a package registry. 6. Use package-manager immutable or offline modes where applicable. 7. Document that repository-provided compiler plugins and configuration can themselves execute code, and avoid running diagnostics automatically in untrusted repositories. 8. Add tests confirming that the hook exits without network access when no trusted local compiler exists. ]]>

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
error-recovery/scripts/rate-limit-recovery.sh:25
Finding

Rate-limit recovery can send input to unrelated tmux panes

Content
View full analysis
/dev/null | while read -r PANE_ID; do CONTENT=$(tmux capture-pane -p -t "$PANE_ID" -S -20 2>/dev/null || echo "") # The script detects rate-limit text and performs a second confirmation-prompt check. tmux send-keys -t "$PANE_ID" Enter 2>/dev/null || true done ``` The corresponding Skill documentation describes the behavior as periodically scanning tmux panes for `429`, `too many requests`, `usage limit`, or similar messages and automatically sending Enter after a second content check. ### Technical Analysis The script enumerates all panes in the user's tmux server by using `tmux list-panes -a`. It does not restrict operation to panes explicitly created by or registered with the execution harness. The second-stage confirmation guard reduces risk by checking for known prompts such as confirmation, deletion, overwrite, or force-push messages. However, a denylist of prompt text cannot establish that: - The pane belongs to Claude Code - The pane belongs to the current harness session - The rate-limit message is the pane's current active prompt rather than historical output - Pressing Enter is safe for the process currently attached to the pane - The prompt uses one of the known confirmation strings Terminal panes may host shells, editors, database clients, deployment tools, or administrative programs. Sending Enter is an active input operation and may submit a pending command or accept a default selection. When the script is run periodically through cron, the exposure persists across unrelated tmux sessions and extends beyond a single Skill invocation. ### Attack Path 1. An unrelated tmux pane contains a recent line matching a rate-limit k ...[truncated 1228 chars]
Remediation
View remediation
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (263)

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
95% confidence
Finding

The README instructs users to add hooks to ~/.claude/settings.json, which grants the skill influence over the agent's global configuration rather than a project-local scope. In security terms, modifying an agent config directory is high impact because it can persist behavior across repositories and future sessions, causing automatic script execution in contexts the user did not intend.

Content

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

cd execution-harness

text

最小配置——把 3 个 hook 加到 `~/.claude/settings.json`:

```jsonc
{

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · README.md (reported line 129)May include surrounding context.

md
| 2.3 | Checkpoint + rollback | script | `rm -rf` 等破坏性命令前自动 `git stash` |
| 2.4 | Graduated permission rules | config | 按风险分层:读文件放行,写文件确认,`rm` 拦截 |
| 2.5 | Component-scoped hooks | config | 不同任务启用不同 hook 组合 |
| 2.6 | Tool input guard | script | 拦截 `rm -rf /`、`curl \| sh` 等已知危险模式 |

### Context & Memory (8) — [SKILL.md](context-memory/SKILL.md)

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description is for a passive navigation/dispatch entrypoint about agent reliability topics and explicitly states that it does not carry out specific operations. The actual code is an active shell hook that executes on stop events, parses JSON input, tracks stop counts, and periodically persists assistant context to disk in session-specific handoff files. Its primary purpose is context compaction/extraction for continuity, not answering or routing reliability questions. This is a material description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description says this skill is only a routing/navigation entry point for reliability-related questions and does not execute specific actions. The supplied code instead implements a concrete shell utility for inspecting a transcript file and reporting input token counts from usage metadata. This is a materially different primary purpose and introduces undeclared file-access and transcript-analysis behavior unrelated to the declared triggers about execution harness, reliability architecture, patterns, or hook configuration.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description says this skill is only a navigation入口 for reliability topics and explicitly does not perform specific operations. The supplied code instead implements tests for an operational stop-hook mechanism: invoking a shell script, setting session environment variables, counting stops, triggering extraction at configured intervals, and verifying snapshot file creation with extracted content. That is a materially different purpose and includes concrete file/state/subprocess behavior not represented in the description. Therefore this is a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description says this skill is a non-operational navigation入口 for agent reliability topics such as execution harness, hooks, and architecture patterns. The supplied code does something entirely different: it is a test suite for a context-usage script that reads transcript files and extracts token counts. This is a materially different primary purpose and introduces undeclared capabilities around file handling, subprocess invocation, and transcript usage analysis. There is no evident connection to routing reliability questions, harness documentation, hook configuration, or the listed triggers.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description says this skill is only a navigation入口 for reliability-system questions and explicitly states it does not perform concrete operations. The actual code is an executable recovery script that inspects tmux panes, detects rate-limit conditions, and actively sends Enter to resume processes, while maintaining cooldown state on disk. This is a materially different primary purpose and includes undeclared capabilities: terminal inspection, stateful cooldown management, and process interaction. The behavior is operational automation, not informational routing or explanation, so this is a clear mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description says this skill is only a navigation入口 for agent reliability documentation/topics and explicitly states it does not perform concrete operations. The supplied code instead is operational test code for a rate-limit-recovery script, with behavior focused on subprocess execution, filesystem effects, and tmux/cooldown handling. This is a materially different primary purpose from informational routing about execution harness, patterns, hooks, or reliability architecture. Therefore the description does not accurately represent the code.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description says this skill is only a navigation入口 for the reliability system and does not perform concrete operations, delegating action to sub-skills. The supplied code, however, is an operational shell hook that enforces behavior at stop time: it parses input JSON, reads the assistant's last message, scans for speculative language, creates/removes a session guard file, and emits a block decision instructing the agent to verify evidence before completion. That is a materially different primary purpose and includes undeclared runtime read/write capabilities, so this is a clear mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description says this skill is only a navigation入口 for reliability topics and does not execute concrete operations. The supplied code, however, is operational: it functions as a stop hook, reads JSON input, accesses session directories and state files, initializes and updates reanchor.json, reads original-task.md, increments turn counters, and conditionally emits additionalContext to influence subsequent agent behavior. That is a concrete reliability mechanism, not merely a routing or informational entrypoint. While the code is related to the broad theme of agent reliability and hooks, its primary purpose and capabilities are materially different from the declared non-operational navigation role.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description says this skill is only a navigation entry for reliability-related questions and explicitly states it does not execute concrete operations. The supplied code does the opposite: it carries out a concrete control action by signaling cancellation for a session via filesystem state. Its primary purpose is operational session control, not routing or explaining the reliability system. The expected triggers about execution harness, patterns, architecture, or hook configuration also do not align with a cancel script's behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

The declared description says this skill is only a routing/navigation entry for reliability-related questions and does not execute specific actions. The supplied code, however, is an executable shell script that directly initializes and resumes persistent execution state for sessions. It writes session state to disk, manages active/inactive recovery logic, sets iteration limits, and stores the original task for later re-anchoring. That is a materially different primary purpose and includes undeclared operational capabilities, so this is a clear mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description says this skill is only a routing/navigation入口 for reliability topics and explicitly 'does not perform concrete operations.' The supplied code does the opposite: it is an implementation hook that enforces persistent execution-loop behavior by preventing stop events when 'ralph mode' is active, except under specific safety conditions. This is a materially different primary purpose and includes undeclared capabilities such as filesystem state management, hook input processing, and stop-blocking control flow. While the topic area is related to agent reliability and hooks, the code is not merely informational/navigation behavior, so this is a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The description says this skill is only a navigation入口/dispatcher for reliability topics and explicitly states it does not execute specific operations. The supplied code does the opposite: it is an operational shell hook that enforces a task-completion gate by inspecting session state and checklist files and returning a blocking decision. That is a materially different primary purpose and an undeclared capability. While the topic area is loosely related to 'execution harness' and hooks, the code is not merely descriptive or routing logic; it performs concrete runtime control over agent stopping behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description says this skill is a non-operational navigation entry for the agent reliability system that should match user questions about reliability topics and delegate to sub-skills without doing concrete work. The supplied code instead is a concrete automated test file for a particular hook (doubt-gate.sh). It runs subprocesses, feeds JSON input, checks blocking/allowing logic for speculative language in English and Chinese, and depends on session state under ~/.openclaw/shared-context/sessions. That is a materially different primary purpose from a routing/explanatory entrypoint. While the topic area overlaps with reliability/hooks, the actual code is not just supportive text matching or delegation logic; it validates implementation behavior of one hook.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description says this skill is only a navigation entry point for documentation/concept routing about agent reliability and does not perform concrete operations. The supplied code, however, is operational test code for a specific reliability hook implementation. It runs bash scripts, persists and reads state files, uses environment variables, and validates hook output behavior. That is materially different from a passive navigation skill. While the domain is loosely related to agent reliability and hooks, the primary behavior is implementation testing of drift-reanchor mechanics rather than serving as a conceptual entry point. Therefore this is a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description says this skill is only a navigation入口 that matches reliability-related questions and does not execute specific operations. The supplied code is not a router or matcher at all; it is an automated test suite for operational Ralph persistence/stop-hook/cancel scripts. It invokes shell scripts, manipulates session files, and validates concrete execution-control behaviors such as crash recovery, iteration limits, stale timeout handling, auth-error safety valves, and cancellation. While the topic domain overlaps with 'agent reliability' and 'Ralph', the actual behavior is materially different from a passive navigation skill and includes undeclared operational/file/subprocess capabilities.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description says this skill is only a navigation入口 for reliability-system topics and explicitly states it does not perform concrete operations, leaving handling to sub-skills. The supplied code, however, is not a router or conceptual navigator: it is a test suite for a specific execution-harness stop hook. It runs a shell script, creates .harness-tasks.json files in session directories, checks stale timestamps, and verifies block/allow decisions based on incomplete tasks. While this is thematically related to agent reliability and hooks, its primary behavior is concrete implementation/testing of task-completion gating, which materially differs from a non-operational navigation skill.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description says this skill is only a routing/navigation entry point for reliability topics and should not execute specific actions. The supplied code, however, is an actual operational stop-hook implementation: it consumes input, determines a session ID, creates directories, reads/writes JSON state files, tracks turns and elapsed time, and returns warning context for long-running sessions. While the topic is loosely related to reliability and hooks, the primary behavior is materially different from a passive documentation/navigation skill. Therefore this is a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description says this skill is only a navigation入口 for discussing an agent reliability system and explicitly states it does not perform concrete operations. The supplied code instead implements an operational hook script that automatically analyzes edited files and reports errors. Its primary purpose, triggers, and resource usage are all different from the declared purpose: it reacts to Write/Edit/MultiEdit events, reads file paths, checks file existence, and runs language-specific diagnostic tools. This is a clear description-behavior mismatch, not merely an implementation detail.

Content

No source excerpt is available for this finding.