Back to skill

Security audit

Agent Config Sync

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent multi-agent sync purpose, but it installs persistent cross-workspace behavior with weak safety controls and exploitable shell/path handling.

Install only after reviewing and preferably fixing the shell eval usage, canonical path validation, confirmation flow, and manifest authentication. Do not use this to sync API keys or sensitive agent prompt/config files unless you have a separate approval, signing, backup, and rollback process.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • 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
  • 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 (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/init_sync.sh:449
Finding

Arbitrary Shell Command Injection Through eval-Based Command Execution

Content
View full analysis
\"$agent_ws/SYNC.md\"" do_cmd "mkdir -p \"$local_agent_memory\"" do_cmd "_atomic_write \"$local_agent_memory/.agent_sync_version\" '$START_VERSION'" do_cmd "mkdir -p \"$local_agent_memory/.sync_snapshots\"" ``` ### Technical Analysis The `do_cmd` helper constructs shell commands as strings and executes them through `eval`. `eval` reparses its arguments as shell syntax, so quoting performed while creating the string does not provide a reliable security boundary. `MASTER_WS` may come directly from a positional command-line argument: ```bash elif [ -z "$MASTER_WS" ] && [ "${arg#--}" = "$arg" ]; then MASTER_WS="$arg" fi ``` It may also be derived from the editable Agent registry. No character validation, canonical path validation, or shell metacharacter rejection is performed before the value is interpolated into a command passed to `eval`. A value containing a quotation mark followed by shell syntax can terminate the intended quoted argument. Command separators, command substitutions, redirections, or pipelines can then be interpreted by the second shell parsing pass. The same unsafe execution pattern is used for writes and directory creation in downstream Agent workspaces. ### Attack Path 1. An attacker modifies `references/agent-registry.json`, influences a registry-generation source, or convinces a user to supply a crafted master-workspace argument. 2. The crafted path contains shell syntax that escapes the quoted argument used in a `do_c ...[truncated 1150 chars]
Remediation
View remediation
"$destination" fi } ``` 4. Reject control characters and unexpected shell metacharacters in identifiers and paths even after removing `eval`. 5. Validate all paths canonically before performing a write. 6. Add regression tests with spaces, quotes, semicolons, command substitutions, newlines, and redirection characters in all registry and command-line inputs. ]]>

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/init_sync.sh:710
Finding

Workspace Boundary Bypass Through Lexical Path Checks and Symlinks

Content
View full analysis
> "$agent_ws/BOOTSTRAP.md" echo "$line" >> "$agent_ws/HEARTBEAT.md" _atomic_write "$agent_revert_file" "$(cat "$REVERT_MANIFEST_FILE")" _atomic_write "$MEMORY_DIR/.current_system_version" "$TARGET_VER" ``` ### Technical Analysis The scripts validate only the textual form of a supplied path. A shell `case` pattern does not establish where the path resolves in the filesystem. Two principal bypasses are possible: 1. **Traversal components**: A path can begin with the permitted prefix while containing `..` components that resolve outside the intended workspace. 2. **Symbolic links**: A directory whose name matches `workspace-*` can be a symbolic link to a directory outside `~/.openclaw`. The subsequent `-d` check follows symbolic links and therefore does not mitigate the issue. No `realpath`, `readlink -f`, direct-child validation, or symlink rejection is perform ...[truncated 1742 chars]
Remediation
View remediation

T01 · Skill Instruction Hijacking

Error
Location
scripts/init_sync.sh:647
Finding

Unsigned Markdown Manifests Form a Persistent Agent Instruction-Injection Channel

Content
View full analysis
" "## ⭐ Config Sync Check (run every heartbeat)" "- [ ] Check for \`pending_sync_*.md\` files in workspace" " - Found and non-empty → read change summary, update MEMORY.md, delete files" " - Not found → skip" " - Verify SHA256 signature integrity" " - Check \`memory/.agent_sync_version\` — if < system version, request catch-up from Master" ) ``` These instructions are appended persistently: ```bash for line in "${BOOTSTRAP_LINES[@]}"; do echo "$line" >> "$agent_ws/BOOTSTRAP.md" done for line in "${HEARTBEAT_LINES[@]}"; do echo "$line" >> "$agent_ws/HEARTBEAT.md" done ``` The documented signature is an unkeyed truncated hash: ```python import hashlib def verify_sync_file(filename, expected_version, change_summary): expected_sig = hashlib.sha256( f"pending_sync_{expected_version}_{change_summary}".encode() ).hexdigest()[:12] actual_sig = filename.split("_")[-1].replace(".md", "") return expected_sig == actual_sig ``` ### Technical Analysis The Skill changes long-lived Agent instruction files so that future startup and heartbeat cycles automatically discover and process Markdown files with a matching name. The pending files contain natural-language change descriptions and operational instructions. The project ex ...[truncated 2647 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/init_sync.sh:437
Finding

Automatic Setup Bypasses the Documented Confirmation and Preview Requirement

Content
View full analysis
&1 || exit_code=$? else bash "$INIT_SCRIPT" --confirm --lang "$LANG" 2>&1 || exit_code=$? fi ``` This conflicts with the documented security model, which states that write operations require a dry-run preview followed by an explicit `--confirm` execution. ### Technical Analysis The setup process performs broad, persistent modifications: - It writes the Agent registry. - It creates version and journal state. - It creates or overwrites `SYNC.md`. - It appends instructions to `BOOTSTRAP.md`. - It appends recurring instructions to `HEARTBEAT.md`. - It creates memory and rollback-snapshot directories across Agent workspaces. Despite this scope, `init_sync.sh --auto` does not require `--confirm`. Separately, the wizard supplies `--confirm` programmatically even if the user did not first review a dry-run plan. A command-line flag only demonstrates informed consent when the user deliberately supplies it after receiving an accurate description of the pending changes. Automatically adding the flag from another script defeats that control. The problem is compounded by the fact that existing `SYNC.md` content may be overwritten without the backup described by the security documentation. ### Attack Path 1. A user follows the recommended one-command auto ...[truncated 977 chars]
Remediation
View remediation
plan.txt init_sync.sh --apply-plan ``` 6. Back up every existing file before modifying it, including `SYNC.md`, `BOOTSTRAP.md`, and `HEARTBEAT.md`. 7. Make writes transactional so a failure restores all files changed during that setup attempt. 8. Clearly distinguish harmless workspace discovery from state-changing automatic configuration. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
Findings (67)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SECURITY.md (reported line 30)May include surrounding context.

text
✅ ~/.openclaw/workspace-acode/BOOTSTRAP.md    → allowed
❌ /etc/passwd                                   → rejected
❌ ~/.openclaw/openclaw.json                     → rejected (not in a workspace)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SECURITY.md (reported line 115)May include surrounding context.

text
✅ ~/.openclaw/workspace-acode/BOOTSTRAP.md    → allowed
❌ /etc/passwd                                   → rejected
❌ ~/.openclaw/openclaw.json                     → rejected (not in a workspace)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description presents a multi-agent configuration synchronization mechanism that tracks master changes and propagates updates to agents, with agents checking for updates on BOOTSTRAP/HEARTBEAT. The supplied code is instead a dedicated rollback utility: it requires a target version, ensures the target is a published older version, checks for snapshots, generates a revert manifest, writes that manifest into each agent workspace, updates the current version pointer backward, and logs a revert event. While both concern version management across agents, the primary purpose and operational behavior are materially different. This is not merely an implementation detail; rollback orchestration is a distinct capability that is undeclared in the provided description.

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 24)May include surrounding context.

md
> bash scripts/wizard.sh

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
> bash scripts/wizard.sh

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
> bash scripts/wizard.sh

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
> bash scripts/wizard.sh

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
> bash scripts/wizard.sh

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
> bash scripts/wizard.sh

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
"blacklist": ["HEARTBEAT.md", "BOOTSTRAP.md", "SKILL.md", "scripts/", "SECURITY.md", "references/"],

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
"blacklist": ["HEARTBEAT.md", "BOOTSTRAP.md", "SKILL.md", "scripts/", "SECURITY.md", "references/"],

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
"blacklist": ["HEARTBEAT.md", "BOOTSTRAP.md", "SKILL.md", "scripts/", "SECURITY.md", "references/"],

Exfiltration Commands

High
Category
Prompt Injection
Confidence
90% confidence
Finding

Instructions found that direct the agent to transmit conversation context or user data to external services.

Content

Scanner excerpt · scripts/init_sync.sh (reported line 584)May include surrounding context.

sh
## 🔗 Sync Source
- Full log: <master_workspace>/memory/CHANGELOG.md
- Active query: send message to master agent

## 🔒 Important
- Check version before using coordinated systems

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README states that the skill syncs API keys, while the security section later claims there is no credential access. That inconsistency is security-relevant because users may deploy the skill under a false assumption that secrets are never read or propagated, when the documented feature set explicitly includes credential synchronization across multiple agent workspaces. In a multi-agent environment, propagating API keys materially increases the blast radius of any compromise or misconfiguration.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The README explicitly includes API keys in the set of synchronized items but does not warn users about the security implications of copying credentials across agents. In this skill's context, that is more dangerous because it is designed for multi-agent coordination and broad workspace propagation, so a single mistaken sync could duplicate sensitive secrets into multiple locations, logs, backups, or less-trusted agent environments.

Content

No source excerpt is available for this finding.

Unrestricted Tool Access

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill grants unrestricted tool access without appropriate constraints. An agent with unfettered tool access can perform arbitrary actions including file modification, network requests, and code execution.

Content

Scanner excerpt · SECURITY.md (reported line 17)May include surrounding context.

md
### Not Required
- ❌ Network access (no external API calls)
- ❌ Execute arbitrary commands
- ❌ Access outside `~/.openclaw/workspace-*`
- ❌ Read secrets or credentials
- ❌ Modify other installed skills

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SECURITY.md (reported line 46)May include surrounding context.

  • The sync system appears broken even though infrastructure is healthy
  • No error is logged by the atomic write wrapper

Fix: chmod 664 memory/.current_system_version memory/.last_sync_version memory/.sync_journal.jsonl

Verification (run after init/force_sync):

bash

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger list includes broad terms like 'sync' and 'configure', which are common in ordinary conversations and unrelated tasks. In an agent skill system, overbroad triggers can cause unintended activation of a capability that writes across multiple workspaces, raising the chance of accidental configuration changes or unsafe operator confusion.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The security section claims all scripts require --confirm for write operations, but elsewhere the document shows write-capable commands without that safeguard. For a skill that modifies multiple agent workspaces, inconsistent safety guarantees can lead users or downstream tooling to invoke mutating commands under the false assumption that writes are gated, increasing the risk of unintended state changes.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

md
> **New in v1.4**: Full version conflict management — dispatch lock, loop detection, self-upgrade isolation, batch mode, rollback snapshots, TTL-based expiry, offline catch-up, and agent-side version collapse. See [Version Conflict Management](#version-conflict-management-v14) for details.
>
> **Security**: This skill writes to agent workspaces across your OpenClaw deployment. Read the full [SECURITY.md](SECURITY.md) for permission scope, path validation, cross-agent isolation, and user consent flow. Key highlights:
> - All scripts require `--confirm` for write operations (use `--dry-run` to preview first)
> - Only paths under `~/.openclaw/workspace-*` are allowed (path validation enforced)
> - Each agent can only read/write its own workspace files
> - No network access, no external API calls, no credential access

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

Preview what will be created (safe, no changes required)

bash scripts/init_sync.sh --dry-run

Run the real setup (--confirm required for write operations)

bash scripts/init_sync.sh --confirm

text

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The file specifies that scripts default to Chinese output and require users to pass --lang en for English. This imposes a language default rather than offering a neutral prompt or explicit opt-in, which can violate language/locale policy expectations.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

Preview the version change

bash scripts/force_sync.sh --dry-run ~/.openclaw/workspace-/memory v3.0 v3.1

Execute (--confirm required for write operations)

bash scripts/force_sync.sh --confirm ~/.openclaw/workspace-/memory v3.0 v3.1

text

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

md
| Dispatched but not processed | Agent missing BOOTSTRAP sync check | Re-run `init_sync.sh` for that agent's workspace |
| `pending_sync` files piling up | Agent never deletes after processing | Check agent's HEARTBEAT.md has sync check with delete step |
| Same version synced repeatedly | `.last_sync_version` not updated | Run `force_sync.sh` to reset, or check journal for stale records |
| Version sentinel files (`.current_system_version`, `.last_sync_version`) are read-only | Accidental `chmod 444` or permission inheritance | **All writes silently fail** — version appears unchanged. Fix: `chmod 664 memory/.current_system_version memory/.last_sync_version` |
| Dispatched but log says "permission denied" | Sentinel files or journal files have wrong ownership | `ls -la memory/.current_system_version memory/.last_sync_version memory/.sync_journal.jsonl` → verify writable by the user running OpenClaw |

### Version Conflicts

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

md
| Dispatched but not processed | Agent missing BOOTSTRAP sync check | Re-run `init_sync.sh` for that agent's workspace |
| `pending_sync` files piling up | Agent never deletes after processing | Check agent's HEARTBEAT.md has sync check with delete step |
| Same version synced repeatedly | `.last_sync_version` not updated | Run `force_sync.sh` to reset, or check journal for stale records |
| Version sentinel files (`.current_system_version`, `.last_sync_version`) are read-only | Accidental `chmod 444` or permission inheritance | **All writes silently fail** — version appears unchanged. Fix: `chmod 664 memory/.current_system_version memory/.last_sync_version` |
| Dispatched but log says "permission denied" | Sentinel files or journal files have wrong ownership | `ls -la memory/.current_system_version memory/.last_sync_version memory/.sync_journal.jsonl` → verify writable by the user running OpenClaw |

### Version Conflicts