T01 · Skill Instruction Hijacking
Error
- Location
- scripts/import-soul.sh:42
- Finding
- Untrusted SOUL instructions are installed and registered without security review<![CDATA[ ## Vulnerability Details **File Location**: `scripts/import-soul.sh:42-65` **Vulnerability Type**: Untrusted agent instruction installation **Risk Level**: High ### Vulnerable Code ```bash [[ -f "$SRC/manifest.json" && -f "$SRC/SOUL.md" ]] || { echo "Invalid package: missing manifest.json or SOUL.md"; exit 1; } python3 - <<'PY' "$SRC/manifest.json" import json,sys p=sys.argv[1] obj=json.load(open(p)) req=['name','version','createdAt','files'] for k in req: assert k in obj, f'missing field: {k}' files=set(obj.get('files',[])) for need in ['SOUL.md','preview.md','manifest.json']: assert need in files, f'missing in files[]: {need}' print('manifest: ok') PY mkdir -p "$WS" if [[ -f "$WS/SOUL.md" && "$FORCE" != "1" ]]; then echo "Refusing to overwrite existing $WS/SOUL.md (use --force)" exit 1 fi cp "$SRC/SOUL.md" "$WS/SOUL.md" [[ -f "$SRC/preview.md" ]] && cp "$SRC/preview.md" "$WS/preview.md" || true cp "$SRC/manifest.json" "$WS/soul-manifest.json" # Add agent if not exists if openclaw agents list | grep -q "\b$AGENT\b"; then echo "Agent exists: $AGENT" else openclaw agents add "$AGENT" --workspace "$WS" fi ``` ### Technical Analysis The importer treats `SOUL.md` from an externally supplied package as trusted agent instructions. Validation only verifies that selected manifest keys exist and that the `files` array names the expected files. It does not inspect, constrain, authenticate, or request approval for the behavioral instructions in `SOUL.md`. After copying the untrusted file into the target workspace, the script immediately registers that workspace through `openclaw agents add`. Consequently, a package can introduce instructions that attempt to change the agent's role, weaken safety constraints, induce unsafe tool use, request sensitive information, or direct data to attacker-controlled destinations. The `--force` option increases the impact by allowing an existing workspace's `SOUL.md` to be replaced. ### Attack Path 1. A ...[truncated 1129 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Treat every imported `SOUL.md` as untrusted content. 2. Display the complete instruction changes and require explicit user approval before installing them. 3. Do not automatically register or activate the agent during import; separate extraction, review, installation, and activation into distinct steps. 4. Add package authenticity controls, such as signatures, trusted publisher identities, or user-verified checksums. 5. Scan imported instructions for attempts to override safety rules, access secrets, invoke high-risk tools, or transmit data. 6. When `--force` is used, show a diff and require a second confirmation before replacing an existing `SOUL.md`. 7. Run newly imported agents with restricted filesystem, credential, tool, and network permissions until the package has been reviewed. ]]>
