T09 · Insecure Skill Coding Practices
- Location
scripts/backup_and_send.py:91- Finding
Sanitization Replaces an Extracted File Instead of the Original Archive
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill openly backs up files by emailing archives, but it encourages broad backups and has flawed sensitive-data cleaning that can send unredacted private files.
Review carefully before installing. Use only narrow, known-safe directories, prefer --no-send until you inspect the archive contents, do not rely on --clean to remove secrets, avoid backing up OpenClaw workspace/agent folders unless you have audited them, and do not install or run it with sudo or from an unverified tarball.
scripts/backup_and_send.py:91Sanitization Replaces an Extracted File Instead of the Original Archive
scripts/clean_sensitive.py:11Incomplete Regex-Based Sanitization Creates a False Expectation of Secret Removal
scripts/backup_and_send.py:85Extracted Symbolic Links Can Cause Sanitization Outside the Temporary Directory
The skill advertises QQ email backup/compression, but the finding suggests those core functions may be absent while network transmission capability is undeclared. A user relying on the description could install a tool whose real behavior is materially different from its stated purpose, undermining informed consent and creating risk of hidden file processing or unauthorized outbound data handling.
The skill advertises QQ email backup/compression, but the finding suggests those core functions may be absent while network transmission capability is undeclared. A user relying on the description could install a tool whose real behavior is materially different from its stated purpose, undermining informed consent and creating risk of hidden file processing or unauthorized outbound data handling.
The skill advertises QQ email backup/compression, but the finding suggests those core functions may be absent while network transmission capability is undeclared. A user relying on the description could install a tool whose real behavior is materially different from its stated purpose, undermining informed consent and creating risk of hidden file processing or unauthorized outbound data handling.
The instructions direct the user/agent to download a remote tarball via curl, extract it, mark scripts executable, and run a Python script, but they provide no authenticity verification, integrity checking, or warning that this executes untrusted code. This creates a clear software supply chain risk: a compromised URL, package, or transport path could lead to arbitrary code execution in the user's environment.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
try:
# 检查文件类型
file_ext = os.path.splitext(filepath)[1].lower()
text_extensions = ['.md', '.json', '.py', '.js', '.ts', '.env', '.config', '.yaml', '.yml', '.txt', '.sh', '.bash']
if file_ext not in text_extensions:
return False
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.
# 创建 skills 目录(如果不存在)
mkdir -p ~/.openclaw/workspace/skills
# 下载并解压
cd ~/.openclaw/workspace/skills
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.
# 创建 skills 目录(如果不存在)
mkdir -p ~/.openclaw/workspace/skills
# 下载并解压
cd ~/.openclaw/workspace/skills
Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.
# 检查文件结构
ls -la ~/.openclaw/workspace/skills/email-backup/
# 应该看到:
# SKILL.md
Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.
# 检查文件结构
ls -la ~/.openclaw/workspace/skills/email-backup/
# 应该看到:
# SKILL.md
The documented workflow explicitly encourages packaging local OpenClaw directories such as agents and workspace contents and sending them via email, which creates a clear exfiltration path for potentially sensitive user data, credentials, prompts, logs, and project files. Even with an optional 'clean' flag, README-level guidance normalizes exporting large local state to an external mailbox, and incomplete sanitization can easily miss secrets.
The skill declares no tool scope or permissions, yet its documented behavior requires reading directories, creating archives, writing files, accessing environment variables, and transmitting data over SMTP. This mismatch is dangerous because it prevents users and the platform from accurately understanding or constraining the skill's effective capabilities, increasing the chance of unintended data access or exfiltration.
The description says the skill will package a directory and send it via QQ email, but it does not prominently warn that archive contents may include sensitive personal, credential, workspace, or system data. This raises privacy and exfiltration risk because users may treat 'backup' as routine without appreciating that full directory contents are being transmitted to an external email service.
The examples explicitly encourage backing up agent and workspace directories, which commonly contain configuration, prompts, credentials, logs, session artifacts, and other sensitive data. In the context of an email-sending skill, this substantially increases the risk of privacy breaches or credential exposure because whole directories may be exfiltrated to external mail infrastructure.
The installation guidance asks users to install a skill whose stated purpose is to package files and send them to QQ Mail, but it does not prominently warn that this can exfiltrate local data to an external service. In a security-sensitive skill, omission of a data-transmission warning can mislead users into authorizing behavior with privacy and compliance consequences.
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.
# 创建脚本目录
mkdir -p ~/.openclaw/scripts
# 创建安装脚本
cat > ~/.openclaw/scripts/install-email-backup.sh << 'EOF'
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.
fi
# 创建目录
mkdir -p ~/.openclaw/workspace/skills
# 下载 Skill
cd ~/.openclaw/workspace/skills
The document instructs users to configure a QQ Mail SMTP authorization code but does not clearly warn that this is a sensitive credential or that use of the skill sends data outside the host. This increases the risk of credential mishandling and unnoticed off-system transmission of potentially sensitive archives.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# Ubuntu/Debian
sudo apt install -y python3
# CentOS/RHEL
sudo yum install -y python3
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# Ubuntu/Debian
sudo apt install -y python3
# CentOS/RHEL
sudo yum install -y python3
Advising users to run sudo openclaw skill install email-backup elevates installation of a third-party skill to root, increasing the blast radius if the package or install hooks are unsafe. For a skill designed to package files and send them externally, privileged installation makes the context more dangerous because it can grant broad filesystem access and persistence opportunities.
# 使用 sudo
sudo openclaw skill install email-backup
This is part of the same recommendation to use sudo for skill installation, which unnecessarily normalizes elevated execution for untrusted add-ons. Running install workflows as root can expose system-wide files and configuration to modification if the package is compromised or behaves unexpectedly.
# 使用 sudo
sudo openclaw skill install email-backup
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.
1. 检查 OpenClaw 是否安装:openclaw --version
2. 检查 Python 是否安装:python3 --version
3. 创建 skills 目录:mkdir -p ~/.openclaw/workspace/skills
4. 下载 Skill 文件:cd ~/.openclaw/workspace/skills && curl -L -o email-backup-skill.tar.gz https://example.com/email-backup-skill.tar.gz
5. 解压 Skill 文件:tar -xzf email-backup-skill.tar.gz
6. 设置执行权限:chmod +x ~/.openclaw/workspace/skills/email-backup/scripts/*.py
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.
1. 检查 OpenClaw 是否安装:openclaw --version
2. 检查 Python 是否安装:python3 --version
3. 创建 skills 目录:mkdir -p ~/.openclaw/workspace/skills
4. 下载 Skill 文件:cd ~/.openclaw/workspace/skills && curl -L -o email-backup-skill.tar.gz https://example.com/email-backup-skill.tar.gz
5. 解压 Skill 文件:tar -xzf email-backup-skill.tar.gz
6. 设置执行权限:chmod +x ~/.openclaw/workspace/skills/email-backup/scripts/*.py
The trigger phrase "安装 email-backup skill" is overly broad and can cause an agent to infer and perform a multi-step installation workflow without explicit, bounded user approval for downloading, unpacking, and preparing executable code. In an agent setting, underspecified install triggers increase the chance of unreviewed tool use or accidental installation of the wrong package.
The file instructs users to place QQ email credentials in environment variables without warning about shell history, process environment leakage, or scope of exposure to child processes. While common, this handling can expose SMTP secrets to local users, logs, debugging tools, or other software running in the same session.