Back to skill

Security audit

Soul Transfer

Security checks for vulnerabilities and agentic risk

Overview

This local backup/restore skill has a coherent migration purpose, but it handles credentials, sessions, and restores in ways that are too broad and unsafe without enough controls.

Install only if you fully trust the backup source and are prepared to handle the archive like a password vault. Store backups encrypted, avoid restoring archives from anyone else, inspect contents before restore, do not run npm install from restored workspaces without review, and rotate credentials after migration where possible.

Vulnerability Patterns
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:177
Finding

Untrusted Backup Archives Are Extracted Directly into the User Home Directory

Content
View full analysis
if [ $? -ne 0 ]; then echo "ERROR: Backup file is corrupted" exit 1 fi # Create safety backup SAFETY_DIR=~/.soul-transfer-backup-$(date +%Y%m%d_%H%M%S) mkdir -p "$SAFETY_DIR" cp -r ~/.openclaw "$SAFETY_DIR/" 2>/dev/null cp -r ~/workspace "$SAFETY_DIR/" 2>/dev/null # Extract backup unzip -o -d ~ ``` The alternative restore documentation similarly extracts a TAR archive directly into the home directory: ```bash ### Step 5: Extract Backup ```bash tar -xzf /path/to/backup.tar.gz -C ~ ``` ``` ### Technical Analysis The restore procedure validates only whether the archive is structurally readable. `unzip -t` does not authenticate its contents, validate the expected root directories, or establish that the archive came from a trusted backup process. The archive is then extracted directly into `~` with overwrite enabled. The procedure does not independently inspect and canonicalize entry names, reject absolute paths or parent-directory components, reject unsafe symbolic or hard links, or restrict extraction to an allowlist such as `.openclaw/` and `workspace/`. The TAR-based procedure has the same trust-boundary problem: an externally supplied archive is unpacked into the user's home directory without application-level entry validation. ### Attack Path 1. An attacker creates or modifies a backup archive containing unexpected paths, link entries, or files outside the documented `.openclaw/` and `workspace/` roots. 2. The attacker convinces the user to restore that archive, for example by presenting it as a migration backup. 3. The structural archive test succeeds because the archive itself is well-formed. 4. The restore procedure extracts the entries directly into the us ...[truncated 887 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Error
Location
SKILL.md:193
Finding

Restored Workspace Executes Untrusted npm Lifecycle Scripts

Content
View full analysis
/dev/null ``` The restore reference repeats the same behavior: ```bash ### Step 7: Reinstall npm Dependencies ```bash cd ~/workspace # or wherever workspace is npm install ``` ``` ### Technical Analysis The workspace and its package metadata are restored from the supplied archive. Running `npm install` in that directory crosses a code-execution trust boundary because npm may: - Resolve and download third-party packages. - Execute `preinstall`, `install`, and `postinstall` lifecycle scripts. - Execute lifecycle scripts defined directly by an attacker-controlled restored `package.json`. - Consume an attacker-controlled lockfile or npm configuration. - Contact registries configured by restored project or user settings. The command is automatic in the documented restore flow and does not first validate `package.json`, the lockfile, dependency sources, package integrity, or lifecycle scripts. The `--silent` flag and redirection of standard error also reduce visibility into downloaded components and script execution. This behavior contradicts the skill's stated “zero network dependency” and “No Third-Party” properties. ### Attack Path 1. An attacker prepares a backup containing a workspace with a malicious `package.json`, dependency declaration, lockfile, or npm configuration. 2. The user restores the archive. 3. The restore procedure changes into the attacker-controlled workspace. 4. `npm install` resolves packages and processes lifecycle hooks. 5. A malicious lifecycle script executes with the privileges of the user performing the restore. 6. The script can access the newly restored credentials, tokens, sessions, configuration ...[truncated 736 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:187
Finding

Recursive World-Readable Permissions Expose Restored Credentials and Sessions

Content
View full analysis
-d ~ # Update permissions chmod -R 755 ~/.openclaw/ chmod -R 755 ~/workspace/ ``` The skill explicitly includes sensitive material in the backup: ```text | Credentials | credentials/**/*, tokens/**/* | ``` The documented restored configuration also includes credentials and related state: ```text ├── Configuration │ ├── .openclaw/ │ │ ├── openclaw.json │ │ ├── credentials/ │ │ ├── extensions/ │ │ ├── agents/ │ │ ├── sessions/ │ │ └── ... │ └── .env ``` ### Technical Analysis Applying `chmod -R 755` recursively gives the owner read, write, and execute permissions while granting every other local user read and execute permissions. On regular files, it also unnecessarily adds executable permission. The affected directory tree is documented as containing credentials, tokens, API keys, environment files, channel sessions, private memory, and agent configuration. Consequently, the command can make confidential material readable by any local account capable of traversing the user's home directory or otherwise accessing these paths. A single recursive mode is inappropriate because directories need traversal permissions while sensitive regular files should normally be accessible only to their owner. ### Attack Path 1. A user restores an archive containing credentials, tokens, sessions, `.env` files, and private agent state. 2. The restore procedure recursively changes every restored file and directory to mode `0755`. 3. Another local account or process running under a different user reads the now world-readable files. 4. The attacker reuses exposed API keys, tokens, or session material to access connected services or imperson ...[truncated 615 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:119
Finding

Claimed SHA-256 Backup Verification Is Not Implemented

Content
View full analysis
"$BACKUP_DIR/manifest-$TIMESTAMP.json" << EOF { "version": "1.0.2", "timestamp": "$TIMESTAMP", "files": [], "checksums": {}, "environment": "$(uname -a)" } EOF zip -m "$BACKUP_FILE" "$BACKUP_DIR/manifest-$TIMESTAMP.json" ``` The restore procedure performs only an archive structure test: ```bash # Verify ZIP integrity unzip -t if [ $? -ne 0 ]; then echo "ERROR: Backup file is corrupted" exit 1 fi ``` ### Technical Analysis The skill states that every file receives a SHA-256 checksum for tamper detection, but the provided backup command writes an empty file list and empty checksum object. No hashes are calculated or inserted into the manifest. During restoration, no manifest signature, message authentication code, or per-file checksum is verified. `unzip -t` tests whether compressed entries can be decompressed without structural or checksum errors; it does not prove who created the archive or detect intentional replacement of both content and archive metadata. Even a populated but unsigned checksum manifest would not establish authenticity because an attacker able to modify the archive could replace both the files and their recorded hashes. ### Attack Path 1. An attacker obtains or replaces a legitimate backup archive. 2. The attacker modifies skills, configuration, workspace package metadata, credentials, or other restored content. 3. The attacker rebuilds a structurally valid ZIP archive. 4. `unzip -t` succeeds because the modified archive is internally well-formed. 5. The altered files are restored and trusted by the user. 6. Any malicious workspace package scripts may subsequently execute through the documented `npm install` step. ### Impact Assessment The fl ...[truncated 528 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (15)

Ssd 3

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill explicitly instructs collecting identity files, memory, credentials, sessions, channels, and databases into a transferable archive. In context, this creates a complete exfiltration-ready package of both secrets and personal/behavioral context, making unauthorized reuse or impersonation much easier if misused or stolen.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
98% confidence
Finding

Including .env, credentials, and token directories in the backup scope means the skill gathers direct authentication material and other secrets. In a portable archive, these artifacts can be replayed in other environments, enabling credential theft, lateral access, or account takeover if the backup is exposed.

Content

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

md
| Identity | SOUL.md, IDENTITY.md, USER.md, AGENTS.md, HEARTBEAT.md, TOOLS.md |
| Memory | memory/**/*, self-improving/**/*, proactive/**/* |
| Skills | skills/**/* |
| Config | openclaw.json, config.yaml, .env |
| Credentials | credentials/**/*, tokens/**/* |
| Plugins | extensions/**/*, plugins/**/* |
| Agents | agents/**/* |

Self-Modification

High
Category
Rogue Agent
Confidence
90% confidence
Finding

The restore procedure is designed to replace current configuration and unpack archived state over the live environment, which is a form of persistent self-modification. In context this appears intended for migration, but it can still overwrite trusted configuration, implant unwanted state, or reintroduce compromised settings if the archive is untrusted or stale.

Content

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

md
- Determine correct paths
   
4. Safety check:
   - Ask user: "This will replace current configuration. Continue?"
   - Create safety backup: ~/.soul-transfer-backup-<timestamp>
   
5. Stop gateway (user confirmation required)

Ssd 3

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The narrative states that API keys are stored in the backup and will work immediately elsewhere, and the verification prompts confirm preservation of owner identity/history. That materially lowers the barrier to credential reuse, impersonation, and migration of sensitive personal context into another environment.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
98% confidence
Finding

The later backup inventory again confirms .env is part of the agent 'soul,' reinforcing that environment secrets are intentionally preserved and restored. This encourages insecure portability of sensitive configuration and credentials between systems.

Content

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

md
│   │   ├── agents/
│   │   ├── sessions/
│   │   └── ...
│   └── .env
│
├── Database
│   └── db/

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
91% confidence
Finding

rm -rf ~/.openclaw is a forceful recursive deletion command presented as a rollback step. Although intended for recovery, documentation that normalizes direct destructive shell commands can be dangerous if copied blindly, if shell expansion resolves unexpectedly, or if the directory contains credentials and irreplaceable state.

Content

Scanner excerpt · references/restore.md (reported line 89)May include surrounding context.

md
openclaw gateway stop

# Remove failed restore
rm -rf ~/.openclaw

# Restore safety backup
mv ~/.openclaw-backup-YYYYMMDD ~/.openclaw

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
91% confidence
Finding

rm -rf ~/.openclaw is a forceful recursive deletion command presented as a rollback step. Although intended for recovery, documentation that normalizes direct destructive shell commands can be dangerous if copied blindly, if shell expansion resolves unexpectedly, or if the directory contains credentials and irreplaceable state.

Content

Scanner excerpt · references/restore.md (reported line 89)May include surrounding context.

md
openclaw gateway stop

# Remove failed restore
rm -rf ~/.openclaw

# Restore safety backup
mv ~/.openclaw-backup-YYYYMMDD ~/.openclaw

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill packages highly sensitive material such as credentials, tokens, sessions, databases, and API keys into a portable ZIP archive while emphasizing convenience, but it does not clearly warn users that the archive becomes a concentrated secret bundle. If the ZIP is copied, stored insecurely, or shared, it can enable broad account compromise and privacy loss.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
83% confidence
Finding

The skill is built to preserve and restore sessions, agent state, and working context across environments, which constitutes persistence of operational identity and session material. While consistent with the migration purpose, this becomes dangerous if session artifacts or remembered context are moved into systems where they should not persist or can be abused for unauthorized continuity.

Content

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

| 飞牛 NAS | ~/trim.openclaw/data/home/.openclaw/ | ~/trim.openclaw/data/workspace/ | | Windows | %USERPROFILE%/.openclaw/ | %USERPROFILE%/workspace/ |

Phase 2: Backup (Create ZIP)

text
1. Ask user: "Where should I save the backup?"

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill claims every backed-up file is protected by SHA256-based integrity checking, but the provided implementation never computes per-file hashes or stores them in the manifest. This creates a false sense of security: users may trust the archive as tamper-evident when modified or substituted contents would go undetected.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation advertises rollback and dry-run safety controls, but the shown restore flow only overwrites files and runs npm install without any rollback procedure or no-op preview path. Users may perform destructive restores believing they have recovery and preview safeguards that do not actually exist.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The restore procedure instructs users to replace stateful directories and extract an archive into the home directory without an explicit warning immediately before the destructive steps. Even if intended as legitimate admin guidance, this can cause accidental overwrite of configuration, credentials, and workspace data if the archive path or target environment is wrong.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
72% confidence
Finding

This restore guide explicitly preserves and reinstates ~/.openclaw, described elsewhere as containing complete config and credentials, then restarts the gateway and verifies retained identity and memory. In context, this is intentional session/state persistence across environments, but it also transfers authentication material and agent memory wholesale, which can expose secrets or improperly rebind trusted state on a different host.

Content

Scanner excerpt · references/restore.md (reported line 51)May include surrounding context.

Move to correct location for this environment

mv ~/.openclaw ~/.openclaw-temp mkdir ~/.openclaw mv ~/.openclaw-temp/* ~/.openclaw/

text

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The rollback section includes rm -rf ~/.openclaw without an immediate warning that it irreversibly deletes the current restore state. In operational documentation, omission of a nearby warning increases the chance of a user deleting the wrong directory or losing data during a stressful recovery event.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The section title Any → 飞牛 NAS introduces Chinese-language product terminology in an otherwise English document without opt-in or explanation. This can violate language/locale consistency expectations because the skill content implicitly mixes languages without giving the user a choice.

Content

No source excerpt is available for this finding.