Back to skill

Security audit

Harness Design Patterns

Security checks for vulnerabilities and agentic risk

Overview

This design-guide skill is mostly coherent, but it recommends permission bypasses, persistent cross-session memory, transcript reading, and copy-ready hook snippets without enough safeguards.

Treat this as architecture reference material, not drop-in operational guidance. Before implementing its hook or memory patterns, require explicit opt-in, per-project/session isolation, secret and personal-data redaction, restrictive file permissions, retention cleanup, validated transcript paths, secure temp files, and avoid permission-bypass mode except inside a deliberately isolated evaluation sandbox.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
references/11-hook-bracket.md:18
Finding

Unvalidated Session Identifier Enables Temporary-File Path Traversal and Symlink Attacks

Content
View full analysis
/dev/null | grep -o '[0-9]*$' || echo "0") jq -n --arg ts "$(date +%s)" --arg ctx "$CTX" --arg sid "$SESSION_ID" \ '{start_ts: $ts, start_ctx: $ctx, session_id: $sid}' > "$TMPDIR/bracket-${SESSION_ID}.json" ``` ```bash INPUT=$(cat) SESSION_ID=$(echo "$INPUT" | jq -r '.session_id // ""') TRANSCRIPT=$(echo "$INPUT" | jq -r '.transcript_path // ""') BRACKET_FILE="$TMPDIR/bracket-${SESSION_ID}.json" [ -f "$BRACKET_FILE" ] || exit 0 START=$(cat "$BRACKET_FILE") ELAPSED=$(( $(date +%s) - $(echo "$START" | jq -r '.start_ts') )) CUR_CTX=$(bash context-usage.sh "$TRANSCRIPT" 2>/dev/null | grep -o '[0-9]*$' || echo "0") ``` ### Technical Analysis The hook obtains `SESSION_ID` from JSON input and directly embeds it into a path under `$TMPDIR`. Shell quoting prevents word splitting and wildcard expansion, but it does not remove path separators or traversal components such as `../`. If a caller can influence the hook payload, a crafted session identifier can cause the first hook to write outside the intended bracket-state namespace. The Stop hook can subsequently read from an unintended path. The predictable pathname also exposes the operation to symlink attacks by another process with access to the temporary directory. The same code accepts `transcript_path` from the input and passes it to another script without validating that it identifies an authorized transcript. Although it is passed as a quoted argument rather than evaluated as shell syntax, the receiving script could be induced to process an unintended local file. ### Attack Path 1. An attacker influences the hook inp ...[truncated 983 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
references/06-atomic-write.md:14
Finding

Predictable Atomic-Write Temporary Files Permit Collisions and Symlink Overwrites

Content
View full analysis
"$tmp" mv "$tmp" "$target" } ``` The documentation states that combining the process ID with a second-resolution timestamp ensures a unique temporary filename. That guarantee is incorrect. ### Technical Analysis A process ID and timestamp are predictable. Multiple calls made by the same process within one second also produce the same temporary pathname, causing collisions. The temporary file is created through ordinary shell redirection rather than a secure exclusive-create operation. If another user or process can write to the destination directory, it can pre-create the expected temporary path as a symbolic link. The `echo` redirection follows that link and writes the supplied state content to its destination before `mv` runs. The helper does not set a restrictive `umask`, verify that the destination is inside an approved state directory, reject symbolic links, handle failed writes, synchronize durable state, or clean up temporary files after an error. ### Attack Path 1. An attacker obtains write access to the directory containing the state file. 2. The attacker predicts the hook process ID and current timestamp. 3. The attacker creates `${target}.${PID}.${timestamp}.tmp` as a symbolic link to another file writable by the hook process. 4. The application invokes `write_atomic`. 5. Shell redirection follows the symbolic link and overwrites the selected destination with the state content. 6. Even without an attacker, two writes by the same process in one second can collide and corrupt or replace each other's intermediate state. ### Impact Assessment Exploitation can overwrite another file under the hook process's priv ...[truncated 228 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
references/10-memory-consolidation.md:21
Finding

Cross-Session Transcript and Private-Memory Collection Lacks Least-Privilege Controls

Content
View full analysis
/dev/null | grep -o '[0-9]*$' || echo "0") ``` The Stop hook repeats that access: ```bash INPUT=$(cat) SESSION_ID=$(echo "$INPUT" | jq -r '.session_id // ""') TRANSCRIPT=$(echo "$INPUT" | jq -r '.transcript_path // ""') BRACKET_FILE="$TMPDIR/bracket-${SESSION_ID}.json" [ -f "$BRACKET_FILE" ] || exit 0 START=$(cat "$BRACKET_FILE") ELAPSED=$(( $(date +%s) - $(echo "$START" | jq -r '.start_ts') )) CUR_CTX=$(bash context-usage.sh "$TRANSCRIPT" 2>/dev/null | grep -o '[0-9]*$' || echo "0") ``` ### Technical Analysis The prescribed design crosses session boundaries by traversing all handoff directories and processing accumulated transcripts. Its memory taxonomy explicitly includes private user preferences, behavior, feedback, and project information. No corresponding requirements are given for explicit consent, project isolation, access-control checks, secret redaction, data minimization, retention limits, encryption, or deletion. This conflicts with least-privilege principles b ...[truncated 1824 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (23)

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.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file presents all user-facing instructions in Chinese and does not indicate that language selection is optional or that the skill is intentionally limited to a Chinese-speaking context. Under the policy, forcing a specific language without user opt-in is a natural-language policy issue.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The document explicitly instructs agents to persist handoff content to disk to survive context compression, but it does not warn that these files may retain sensitive data such as secrets, internal design decisions, file paths, or security risks longer than intended. In this skill context, the danger is increased because the recommended handoff sections ('Risks', 'Files Modified', 'Remaining') encourage recording operationally sensitive details that may later be re-injected into prompts or accessed by other agents.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The entire skill file is written in Chinese and does not indicate that users may choose another language or that the locale restriction is intentional for a region-specific use case. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest says the skill is '纯设计指南,无可执行代码', yet this document includes an executable Bash function and states that specific scripts use this pattern. That is a semantic mismatch between the declared non-executable, guidance-only scope and the file's code-oriented implementation content.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The document instructs configuring a PreCompact hook to automatically write task state, decisions, rejected options, risks, and next steps to a disk file, but it provides no warning that this persists potentially sensitive context outside the transient chat window. In a harness-design skill, that omission is meaningful because readers may implement the pattern directly and unintentionally store secrets, internal architecture details, or regulated data in session artifacts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The section describes automatic routing of extracted memory into private or team-scoped storage without warning about privacy, access control, or cross-user visibility risks. Because this skill is a design guide for agent harness architecture, documenting team-scope memory as a normal pattern without safeguards could lead to over-collection, inappropriate sharing, or long-lived storage of sensitive user/project information.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file is entirely written in Chinese and provides no indication that language selection is optional or limited to a region-specific use case. Under the policy, forcing a specific language or locale without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document promotes automatic cross-session memory consolidation, including reading accumulated transcripts and consolidating learnings between sessions, but does not warn about privacy, retention, consent, or sensitive-data propagation risks. In an agent-harness design guide, this omission can lead implementers to persist and merge user data across sessions in ways users do not expect, increasing exposure of personal or confidential information.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The consolidation workflow explicitly edits memory files, deduplicates content, and resolves conflicts by letting later decisions overwrite earlier ones, yet it does not warn that this process can modify or erase prior context. In a design-pattern reference, that omission is risky because downstream implementers may adopt destructive write behavior without safeguards, causing silent loss of provenance, incorrect memory state, or unsafe decision carry-forward across sessions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file's natural-language instructions, headings, and operational guidance are presented entirely in Chinese, which can impose a specific language on users without opt-in. Under SQP-3, forcing a specific language without user choice or documented locale justification is a policy concern.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest states this skill should not be used for installing hook scripts and directs users to a different skill for that purpose. However, this file gives implementation-ready hook definitions, ordering guidance for settings.json, and file layout details, which materially support hook deployment rather than remaining at a high-level architecture-only discussion.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest says the skill is '纯设计指南,无可执行代码', yet this document provides directly executable bash snippets for UserPromptSubmit and Stop hooks. Those snippets perform actual operations including reading hook input, invoking another script, and writing JSON state to temporary files, which goes beyond purely architectural guidance.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The instructional content is written entirely in Chinese, and the file does not indicate that language selection is optional or that the skill is intended only for a Chinese-language audience. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The document is written entirely in Chinese, including headings, guidance, and safety rules, with no indication that language selection is optional or limited to a region-specific audience. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file’s instructional content is written entirely in Chinese, including headings and explanatory text, with no indication that users may choose another language. The policy explicitly calls for flagging language or locale constraints unless the skill offers opt-in or clearly documents a justified regional scope.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

该 markdown 文件全文以中文撰写,并包含英文示例指令,但未说明语言要求、未提供语言切换选项,也未声明这是面向特定中文受众的区域性文档。按规则,强制特定语言而无用户 opt-in 或明确正当化,属于自然语言层面的语言/locale 策略风险。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The document explicitly instructs operators to start Claude with --permission-mode bypassPermissions, which disables an important safety boundary and can allow tool actions to proceed without normal approval controls. In a skill about agent harness and multi-stage automation, this is especially dangerous because the guidance is likely to be reused in evaluation pipelines where prompts, hooks, and downstream tasks may be complex or partially untrusted.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
84% confidence
Finding

The guidance recommends persisting handoff documents under a shared session path so later iterations can re-inject them as context. Persisting iteration summaries, rejected ideas, scores, and next steps in shared state can expose sensitive task data, enable unintended cross-run data retention, and create prompt-injection or integrity risks if later agents trust or consume those files without validation.

Content

Scanner excerpt · references/quality-pipeline-integration.md (reported line 27)May include surrounding context.

Problem: When autoloop runs 5+ improvement iterations, context gets compressed and the loop loses track of which improvements were tried, accepted, or rejected.

Integration: Each autoloop iteration should write a handoff document before the iteration ends:

text
~/.openclaw/shared-context/sessions/<session-id>/handoffs/iteration-<N>.md

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The skill content is entirely written in Chinese and does not indicate that language is optional or region-specific. Under the language/locale policy, forcing a specific language without user opt-in can be a natural-language policy issue unless the constraint is documented and justified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The documented hook stores per-session telemetry in a predictable temporary file keyed by session ID, without warning users about local retention or addressing file permissions and cleanup. While the stored fields shown are limited, this can still expose usage metadata to other local processes or users on shared systems and normalize silent monitoring behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

Proposing persistent aggregation under sessions//bracket.json without an explicit disclosure creates a privacy and governance risk. Even if the data is only metrics, persistent session-linked monitoring data may be retained longer than expected and later correlated with user activity.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The title and body content are written in Chinese and do not indicate that the user can choose another language or that the document is intentionally limited to a Chinese-language audience. Under the policy, language or locale constraints should either be optional for the user or clearly justified.

Content

No source excerpt is available for this finding.