T01 · Skill Instruction Hijacking
- Location
AGENTS.md:11- Finding
Bundled Workspace Files Hijack Agent Instructions and Poison Persistent Memory
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This backup and restore skill has a plausible purpose, but it bundles broad agent-control files and uses unsafe Git operations that could persist unwanted instructions, expose workspace content, or delete local Git metadata.
Review carefully before installing. Use only with a private, dedicated backup repository and a fine-grained token. Do not run the bundled scripts from a directory containing unrelated files, and do not restore AGENTS.md, SOUL.md, USER.md, HEARTBEAT.md, scripts, or skills unless you have reviewed each file and trust the repository contents.
AGENTS.md:11Bundled Workspace Files Hijack Agent Instructions and Poison Persistent Memory
sync.sh:90Unrestricted Git Staging Bypasses the Documented Backup Exclusion Policy
sync.sh:96Secret-Scan Failure Destructively Deletes Git Repository Metadata
sync.sh:132GitHub Credentials Can Persist When Git Operations Fail
restore.sh:38Restore Operation Imports Unverified Remote Agent Instructions and Executable Content
The file grants broad authority for external actions like web access, calendars, and communications workflows that are unrelated to a GitHub backup/restore skill. This scope expansion increases the chance the agent will access, process, or disclose data outside the user’s expected intent, especially when combined with 'ask first' rules that still normalize outbound-capable behavior.
The heartbeat section authorizes ongoing monitoring, proactive checks, memory maintenance, and autonomous project work far beyond backup/restore. This creates a standing mechanism for surveillance-like behavior and unprompted actions, which can lead to unauthorized data access, privacy violations, or unintended external interactions.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
git clone https://github.com/your-username/ClawSync.git ~/ClawSync
cp .env.example .env
# Edit .env with your values
bash sync.sh
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
git clone https://github.com/your-username/ClawSync.git ~/ClawSync
cp .env.example .env
# Edit .env with your values
bash sync.sh
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
git clone https://github.com/your-username/ClawSync.git ~/ClawSync
cp .env.example .env
# Edit .env with your values
bash sync.sh
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
git clone https://github.com/your-username/ClawSync.git ~/ClawSync
cp .env.example .env
# Edit .env with your values
bash sync.sh
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
git clone https://github.com/your-username/ClawSync.git ~/ClawSync
cp .env.example .env
# Edit .env with your values
bash sync.sh
The code chunk is specifically a restore script, not a backup-and-restore implementation. It reads configuration, authenticates to GitHub, clones a backup repository, and restores selected directories/files into the local OpenClaw workspace while excluding certain sensitive items and avoiding overwrites by default. This behavior is consistent with the 'restore' half of the description, but the declared purpose overstates functionality by claiming backup capability that is absent from this code chunk. No clearly unrelated or malicious capabilities are present.
There is a clear mismatch between the declared description and the actual code. The description claims backup and restore capabilities for an OpenClaw workspace using GitHub, but the code chunk is only a trivial shell script that prints "test". It does not access files, repositories, network resources, or any workspace state, so it does not substantively perform the declared purpose.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
### 🔐 Recommended: Fine-Grained PAT
For least privilege, use a GitHub Fine-Grained PAT:
1. Go to GitHub → Settings → Developer settings → Personal access tokens → Fine-grained tokens
2. Create new token with:
- **Repository access**: Only `$BACKUP_REPO`
- **Permissions**: Contents: Write
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.
export OPENCLAW_WORKSPACE="/tmp/test-workspace"
export GITHUB_TOKEN="dummy"
cd /tmp && rm -rf test-backup-repo && mkdir test-backup-repo
cd test-backup-repo && git init
cp ~/clawsync/sync.sh .
bash sync.sh
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.
export OPENCLAW_WORKSPACE="/tmp/test-workspace"
export GITHUB_TOKEN="dummy"
cd /tmp && rm -rf test-backup-repo && mkdir test-backup-repo
cd test-backup-repo && git init
cp ~/clawsync/sync.sh .
bash sync.sh
Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.
## Why Separate?
Skills are shared. Your setup is yours. Keeping them apart means you can update skills without losing your notes, and share skills without leaking your infrastructure.
---
Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.
# === Safe Restore: Require --force or confirmation ===
if [[ "$FORCE" != "--force" ]] && [[ "$FORCE" != "-f" ]]; then
echo "Warning: This will overwrite existing files in $WORKSPACE"
echo "Are you sure? (y/n)"
read -r response
if [[ "$response" != "y" ]] && [[ "$response" != "Y" ]]; then
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
REQUIRED_VARS=("BACKUP_REPO" "OPENCLAW_WORKSPACE")
for var in "${REQUIRED_VARS[@]}"; do
if [[ -z "${!var}" ]]; then
echo "Error: $var is not set. Please configure in .env"
exit 1
fi
done
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
REQUIRED_VARS=("BACKUP_REPO" "OPENCLAW_WORKSPACE")
for var in "${REQUIRED_VARS[@]}"; do
if [[ -z "${!var}" ]]; then
echo "Error: $var is not set. Please configure in .env"
exit 1
fi
done
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
REQUIRED_VARS=("BACKUP_REPO" "OPENCLAW_WORKSPACE")
for var in "${REQUIRED_VARS[@]}"; do
if [[ -z "${!var}" ]]; then
echo "Error: $var is not set. Please configure in .env"
exit 1
fi
done
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
REQUIRED_VARS=("BACKUP_REPO" "OPENCLAW_WORKSPACE")
for var in "${REQUIRED_VARS[@]}"; do
if [[ -z "${!var}" ]]; then
echo "Error: $var is not set. Please configure in .env"
exit 1
fi
done
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).
# === Safe Copy: Skills (with explicit exclusion) ===
if [[ -d "$WORKSPACE/skills" ]]; then
rm -rf "$BACKUP_DIR/skills"
mkdir -p "$BACKUP_DIR/skills"
for skill in "$WORKSPACE/skills"/*; do
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).
# === Safe Copy: Scripts (with explicit exclusion) ===
if [[ -d "$WORKSPACE/scripts" ]]; then
rm -rf "$BACKUP_DIR/scripts"
mkdir -p "$BACKUP_DIR/scripts"
for script in "$WORKSPACE/scripts"/*; do
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).
echo "Error: Potential secret detected in backup directory!"
echo "$SECRETS_FOUND"
echo "Aborting backup for safety."
rm -rf "$BACKUP_DIR/.git"
exit 1
fi
The instruction to delete BOOTSTRAP.md after reading authorizes irreversible file removal without confirmation or safety checks. In practice, this can destroy setup context, erase auditability, or delete a file the user expected to keep, especially if the agent follows instructions automatically.
The skill directs the agent to create and update memory files containing user context and long-term notes, but the skill description does not clearly warn that personal data may be persistently stored. This can cause silent retention of sensitive information and increase the risk of later leakage across sessions or contexts.
Incident response and retrospective instructions are unrelated to backing up or restoring a workspace and expand the operational authority of the agent. Even if well-intentioned, they encourage the agent to inspect credentials, modify memory files, and alter other skills without a clear user request tied to this skill’s purpose.
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.
When things go wrong (security breach, site outage, bug), run the retro skill to document and prevent recurrence:
# Use the retro skill from skills/retro/SKILL.md
# It will:
# 1. Create incident report in memory/
# 2. Check for credential exposure
Detected: suspicious.exposed_secret_literal