T09 · Insecure Skill Coding Practices
- Location
scripts/clawctl.mjs:3238- Finding
Sensitive Files Inside Installed Skills Are Exported Without Filtering
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a real OpenClaw backup/import tool, but it handles sensitive local files and imported archives with enough under-scoped safeguards that users should review it carefully before installing.
Install only if you are comfortable reviewing .claw archives and the generated export contents yourself. Do not rely on the stated automatic credential stripping for shared packages, avoid importing from arbitrary URLs or untrusted senders, and use dry-run plus a separate backup before allowing it to write workspace or skill files.
scripts/clawctl.mjs:3238Sensitive Files Inside Installed Skills Are Exported Without Filtering
scripts/clawctl.mjs:3546Workspace Files Are Exported Verbatim Without Content Sanitization
scripts/clawctl.mjs:3144Configuration Arrays Bypass Recursive Credential Sanitization
scripts/clawctl.mjs:3036Archive Integrity Verification Does Not Cover Undeclared Installed Files
scripts/clawctl.mjs:3024Imported Archive Symbolic Links Can Expose Files Outside the Extraction Directory
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
- **User wants to export + share in one step**: After export, suggest easy transfer methods (AirDrop, scp, cloud drive).
- **Multiple .claw files**: If the user says "install all claw packages", iterate through them one by one with preview for each.
- **Rollback chain**: Each rollback creates a safety backup, so the user can always undo a rollback. Explain this when asked.
- **Disk space**: If the user has many backups, suggest cleaning old ones: `rm -rf ~/.openclaw/.zhuaxia-backups/<old-id>`.
## What Gets Exported
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
- **User wants to export + share in one step**: After export, suggest easy transfer methods (AirDrop, scp, cloud drive).
- **Multiple .claw files**: If the user says "install all claw packages", iterate through them one by one with preview for each.
- **Rollback chain**: Each rollback creates a safety backup, so the user can always undo a rollback. Explain this when asked.
- **Disk space**: If the user has many backups, suggest cleaning old ones: `rm -rf ~/.openclaw/.zhuaxia-backups/<old-id>`.
## What Gets Exported
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
- **User wants to export + share in one step**: After export, suggest easy transfer methods (AirDrop, scp, cloud drive).
- **Multiple .claw files**: If the user says "install all claw packages", iterate through them one by one with preview for each.
- **Rollback chain**: Each rollback creates a safety backup, so the user can always undo a rollback. Explain this when asked.
- **Disk space**: If the user has many backups, suggest cleaning old ones: `rm -rf ~/.openclaw/.zhuaxia-backups/<old-id>`.
## What Gets Exported
The skill directs the agent to read files, inspect environment/state, and execute shell commands, but the manifest does not declare any explicit tool scope or allowed-tools boundary. That makes the skill's effective privilege unclear and increases the chance an agent will run sensitive local operations without a clear authorization model.
The trigger list includes broad natural-language phrases that could match ordinary requests and invoke a high-impact skill that reads local state, writes config, imports files, and installs bundled skills. Over-broad activation increases the chance of unintended execution of privileged workflows.
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.
node {baseDir}/scripts/clawctl.mjs backup [--source ] [--label ]
Create a snapshot of current workspace + config. Stored in `~/.openclaw/.zhuaxia-backups/<id>/`.
### List Backups
The workflow says to run when the user says things like broad export/backup phrases, without strong boundaries that this only applies to OpenClaw instance packaging. In context, that ambiguity is risky because the skill performs filesystem discovery and package operations that should require precise user intent.
The import workflow can trigger on generic 'install' or 'load' requests, which may cause the agent to treat unrelated files or tasks as OpenClaw package installs. Because import modifies workspace, config, and skills, accidental invocation has meaningful integrity impact.
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.
> New items to merge: [list]
> Shall I merge the non-sensitive settings?
If the user agrees, read both JSON files, merge intelligently (keep current credentials, add new non-sensitive settings), and write back to `openclaw.json`.
3. **Credential checklist** — For each `$CLAW_PLACEHOLDER` in the imported config, tell the user exactly what they need to set:
The skill tells the agent to fetch an arbitrary URL with curl and then proceed with import, which extends a local backup/migration workflow into untrusted network retrieval. This can introduce malicious .claw packages, SSRF-style access to internal resources, or accidental retrieval of attacker-controlled content without validation.
The skill instructs network download of external content without warning the user about network access, provenance, or the risk of importing untrusted packages. In a workflow that later installs package contents and bundled skills, lack of a trust warning materially increases the likelihood of compromise.
The manifest describes portable export/import for backing up, migrating, restoring, and rolling back an OpenClaw setup, but the backup/restore path only copies workspace/ and openclaw.json. It does not preserve or restore other state the exporter scans or excludes elsewhere, such as bundled skill install state unless present in the imported package, so 'rollback' and 'backup my instance' do not actually restore the full setup they imply.
Rollback copies backed-up files over the current workspace and config without deleting files added after the backup or warning about overwrites. This can leave a mixed state where stale or attacker-planted files persist, undermining rollback expectations and potentially preserving malicious content after a supposed recovery.
The load command writes workspace files and bundled skill files from an imported archive directly into the user's target directory without explicit approval. In this skill's context, packages are meant to be shared and imported, so untrusted archives are plausible; that makes silent installation more dangerous because a malicious package can place executable or deceptive content into the user's environment.
The skill is described primarily as exporting and importing OpenClaw instances as portable packages, but runLoad also installs bundled skills into the target skills directory as a separate capability. That behavior is related, but materially broader than just restoring an instance backup because it performs package-managed skill deployment into the local installation.
Detected: suspicious.destructive_delete_command