Back to skill

Security audit

Agent Config Manager

Security checks for vulnerabilities and agentic risk

Overview

The skill is purpose-aligned but needs review because it changes OpenClaw agent configuration and handles sensitive config files through unsafe shared temporary paths.

Review before installing. The skill appears intended to manage OpenClaw configuration, not to exfiltrate or deceive, but it can persistently change agent behavior and may leave full configuration backups, including API-key-bearing config content, under /tmp. Use only in a trusted local environment and prefer secure temp files and protected backup locations before relying on it.

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

Warning
Location
scripts/set_agent_model.sh:46
Finding

Predictable Temporary File Enables Symlink-Based File Overwrite and Configuration Corruption

Content
View full analysis
/tmp/openclaw.json.tmp mv /tmp/openclaw.json.tmp "$CONFIG_FILE" ``` ### Technical Analysis The script writes generated configuration data to the fixed, globally predictable path `/tmp/openclaw.json.tmp`. Files in `/tmp` can generally be created by any local user. The script neither creates this file securely nor verifies that it is a regular file owned by the executing user. A local attacker can create `/tmp/openclaw.json.tmp` as a symbolic link before the script runs. Shell output redirection follows symbolic links, so the `jq` output will overwrite the symlink target using the script user's privileges. The subsequent `mv` operation can also replace the OpenClaw configuration path with the attacker-created symbolic link. The vulnerability becomes security-relevant when the script is executed by a privileged account or an account with access to files unavailable to the attacker. ### Attack Path 1. A local attacker predicts the fixed temporary path `/tmp/openclaw.json.tmp`. 2. The attacker creates that path as a symbolic link to a file writable by the account expected to run the script. 3. A more privileged user or service invokes `scripts/set_agent_model.sh`. 4. The shell follows the symbolic link during output redirection and truncates or overwrites its target with generated JSON. 5. The `mv` command then moves the attacker-created symbolic link over `/data/.openclaw/openclaw.json`. 6. The OpenClaw configuration may consequently become corrupted or remain redirected to another file, disrupting subsequent configuration operations. ### Impact Assessment A successful attacker can cause arbit ...[truncated 667 chars]
Remediation
View remediation
"$TMP_FILE" jq empty "$TMP_FILE" chmod --reference="$CONFIG_FILE" "$TMP_FILE" chown --reference="$CONFIG_FILE" "$TMP_FILE" mv -- "$TMP_FILE" "$CONFIG_FILE" trap - EXIT ``` Additional hardening measures should include: 1. Refuse to operate if the configuration path itself is a symbolic link unless that behavior is explicitly required. 2. Restrict access to the configuration directory to trusted users. 3. Use a cleanup trap so interrupted executions do not leave temporary files behind. 4. Check every filesystem operation for failure. 5. Preserve configuration ownership and permissions when atomically replacing the file. ]]>
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
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep