Back to skill

Security audit

Yaoyao Cloud Backup V2

Security checks for vulnerabilities and agentic risk

Overview

This cloud-backup skill has a coherent backup purpose, but it handles credentials and local data too broadly and includes unsafe restore and transport behavior.

Review this skill carefully before installing. Use only dedicated, least-privilege backup accounts, do not paste real passwords or API keys into chat, avoid FTP and unverified SFTP, and treat imported backup files as untrusted unless the restore code is fixed.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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 (8)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/backup_restore.py:128
Finding

Arbitrary File Write Through Imported Backup Filenames

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/backup_manager.py:146
Finding

Unsafe Tar Archive Selection and Extraction

Content
View full analysis
bool: """恢复备份""" target = target_dir or MEMORY_DIR backup_file = BACKUP_DIR / f"{backup_id}.tar.gz" if not backup_file.exists(): print(f"备份文件不存在: {backup_file}") return False # 验证 hash current_hash = self.calculate_hash(backup_file) info = next((b for b in self.backups if b.id == backup_id), None) if info and info.hash != current_hash: print("⚠️ 警告: 备份文件 hash 不匹配,可能已损坏") # 解压到临时目录 with tempfile.TemporaryDirectory() as tmpdir: with tarfile.open(backup_file, "r:gz") as tar: tar.extractall(tmpdir) # 移动文件到目标目录 for f in Path(tmpdir).glob("*.md"): dest = target / f.name shutil.copy2(f, dest) ``` The CLI passes user input directly to this method: ```python parser.add_argument("--restore", "-r", help="恢复备份") ... elif args.restore: if manager.restore_backup(args.restore): ``` ### Technical Analysis The user-controlled `backup_id` is interpolated into a filesystem path without checking that it is an exact identifier from the backup index. Traversal components can therefore select a `.tar.gz` file outside `BACKUP_DIR`. The selected archive is then processed using `tar.extractall()` without explicit validation of member names or types. Crafted archive members may contain absolute paths, `../` traversal, symbolic links, hard links, or special filesystem entries. Merely extracting into a temporary directory is not a sufficient security boundary when archive members are untrusted. The hash check does not provide effective protection for an unindexed archive. Even for an indexed archive, a mismatch only prints a warning and extraction co ...[truncated 881 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/cloud_adapter.py:575
Finding

SFTP Server Authentication Is Disabled for Unknown Host Keys

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/cloud_adapter.py:466
Finding

FTP Credentials and Backup Data Can Be Transmitted in Plaintext

Content
View full analysis
bool: """上传到 FTP""" try: if self.secure: from ftplib import FTP_TLS ftp = FTP_TLS() else: from ftp import FTP ftp = FTP() ftp.connect(self.host, self.port) ftp.login(self.username, self.password) dirs = Path(remote_path).parts[:-1] for d in dirs: try: ftp.mkd(d) except: pass with open(local_path, "rb") as f: ftp.storbinary(f"STOR {remote_path}", f) ftp.quit() return True except Exception as e: print(f"FTP upload failed: {e}") return False def download(self, remote_path: str, local_path: Path) -> bool: """从 FTP 下载""" try: from ftplib import FTP ftp = FTP() ftp.connect(self.host, self.port) ftp.login(self.username, self.password) local_path.parent.mkdir(parents=True, exist_ok=True) with open(local_path, "wb") as f: ftp.retrbinary(f"RETR {remote_path}", f.write) ftp.quit() return True except Exception as e: print( ...[truncated 1876 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/cloud_adapter.py:274
Finding

WebDAV Credentials and Memory Data May Be Sent Over HTTP

Content
View full analysis
bool: """上传到 WebDAV""" try: import requests with open(local_path, "rb") as f: response = requests.put( f"{self.url.rstrip('/')}/{remote_path}", data=f, auth=(self.username, self.password) ) return response.status_code in [200, 201, 204] except Exception as e: print(f"WebDAV upload failed: {e}") return False def download(self, remote_path: str, local_path: Path) -> bool: """从 WebDAV 下载""" try: import requests response = requests.get( f"{self.url.rstrip('/')}/{remote_path}", auth=(self.username, self.password) ) if response.status_code == 200: local_path.parent.mkdir(parents=True, exist_ok=True) with open(local_path, "wb") as f: f.write(response.content) return True return False except Exception as e: print(f"WebDAV download failed: {e}") return False ``` The `list()`, `delete()`, and `exists()` methods use the same unvalidated base URL and credentials. ### Technical Analysis `WEBDAV_URL` is loaded from a plaintext configuration file and used directly without parsing or enforcing HTTPS. A URL beginning with `http://` is accepted, causing HTTP Basic credentials and memory content to traverse the network without encryption. No finite request timeouts are configured, and there ...[truncated 776 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/auto_detect.py:278
Finding

Automatic Discovery Reads Sensitive Infrastructure Configuration Beyond the Claimed Scope

Content
View full analysis
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/sync_to_nas.py:11
Finding

NAS Synchronization Uploads the Entire Top-Level Memory Directory

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/migrate.py:43
Finding

IMA API Credentials Are Written Without Explicit Restrictive Permissions

Content
View full analysis
bool: """迁移 IMA 配置到文件""" config_dir = Path.home() / ".config" / "ima" config_dir.mkdir(parents=True, exist_ok=True) (config_dir / "client_id").write_text(client_id) (config_dir / "api_key").write_text(api_key) return True ``` ### Technical Analysis The migration function duplicates IMA credentials into plaintext files without explicitly applying owner-only permissions. The effective permissions depend on the process umask and any pre-existing directory or file modes. The implementation also does not verify that the destination files are not symbolic links. If an attacker with local access can prepare a malicious link in the destination directory, credential contents may be redirected to another writable location. This behavior also conflicts with the documentation's assertion that all credentials are stored in `~/.openclaw/credentials/secrets.env`. ### Attack Path 1. The user invokes the migration function with an IMA client ID and API key. 2. The directory and files are created using inherited filesystem permissions. 3. On a permissively configured system, another local account or process reads the plaintext API key. 4. Alternatively, a pre-existing malicious symbolic link redirects the secret write. 5. The attacker uses the recovered credentials against the IMA API. ### Impact Assessment A local attacker may obtain the IMA client ID and API key and perform actions permitted by those credentials. The exact scope depends on the IMA API account and key permissions. The files persist after migration, increasing the duration of exposure. ]]>
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (119)

Tainted flow: 'req' from os.environ.get (line 55, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/sync_ima.py (reported line 58)May include surrounding context.

python
req = urllib.request.Request(url, data=data, headers=headers, method="POST")
    
    try:
        with urllib.request.urlopen(req, timeout=30) as response:
            result = json.loads(response.read().decode("utf-8"))
            # 兼容两种返回格式:code 或 retcode
            if "code" in result and "retcode" not in result:

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The finding points to undeclared local filesystem discovery and plugin checks unrelated to the stated backup purpose. Such host reconnaissance broadens access to local state and can expose installation details or sensitive paths that users would not expect from a simple backup guide.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The finding points to undeclared local filesystem discovery and plugin checks unrelated to the stated backup purpose. Such host reconnaissance broadens access to local state and can expose installation details or sensitive paths that users would not expect from a simple backup guide.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The finding points to undeclared local filesystem discovery and plugin checks unrelated to the stated backup purpose. Such host reconnaissance broadens access to local state and can expose installation details or sensitive paths that users would not expect from a simple backup guide.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The finding points to undeclared local filesystem discovery and plugin checks unrelated to the stated backup purpose. Such host reconnaissance broadens access to local state and can expose installation details or sensitive paths that users would not expect from a simple backup guide.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The finding points to undeclared local filesystem discovery and plugin checks unrelated to the stated backup purpose. Such host reconnaissance broadens access to local state and can expose installation details or sensitive paths that users would not expect from a simple backup guide.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The finding points to undeclared local filesystem discovery and plugin checks unrelated to the stated backup purpose. Such host reconnaissance broadens access to local state and can expose installation details or sensitive paths that users would not expect from a simple backup guide.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
88% confidence
Finding

The finding points to undeclared local filesystem discovery and plugin checks unrelated to the stated backup purpose. Such host reconnaissance broadens access to local state and can expose installation details or sensitive paths that users would not expect from a simple backup guide.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The finding points to undeclared local filesystem discovery and plugin checks unrelated to the stated backup purpose. Such host reconnaissance broadens access to local state and can expose installation details or sensitive paths that users would not expect from a simple backup guide.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The finding points to undeclared local filesystem discovery and plugin checks unrelated to the stated backup purpose. Such host reconnaissance broadens access to local state and can expose installation details or sensitive paths that users would not expect from a simple backup guide.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The finding points to undeclared local filesystem discovery and plugin checks unrelated to the stated backup purpose. Such host reconnaissance broadens access to local state and can expose installation details or sensitive paths that users would not expect from a simple backup guide.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The finding points to undeclared local filesystem discovery and plugin checks unrelated to the stated backup purpose. Such host reconnaissance broadens access to local state and can expose installation details or sensitive paths that users would not expect from a simple backup guide.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The finding points to undeclared local filesystem discovery and plugin checks unrelated to the stated backup purpose. Such host reconnaissance broadens access to local state and can expose installation details or sensitive paths that users would not expect from a simple backup guide.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The finding points to undeclared local filesystem discovery and plugin checks unrelated to the stated backup purpose. Such host reconnaissance broadens access to local state and can expose installation details or sensitive paths that users would not expect from a simple backup guide.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
88% confidence
Finding

The skill's documented auto-detection includes reading environment variables and secrets.env, which are high-value credential sources. Accessing these stores during broad detection flows expands exposure of unrelated secrets beyond what is necessary for simple provider recommendation.

Content

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

md
|------|------|----------|
| ☁️ 本地云客户端 | iCloud Drive、Dropbox、OneDrive | 自动检测已安装的客户端 |
| 🌐 WebDAV | 坚果云、Nextcloud、ownCloud | 客户端/配置 |
| 🪣 云存储 API | 阿里云 OSS、腾讯云 COS、IMA | 环境变量/secrets.env |
| 🖥️ 服务器存储 | Samba/NAS、SFTP | 已挂载/配置文件 |
| 📡 SFTP | 远程服务器 | SSH 配置 |

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill explicitly asks the user to share an email and application password in conversation so the assistant can configure WebDAV access. Collecting credentials through chat is dangerous because conversation channels may be logged, retained, or exposed to other tools, and users are not warned about safer alternatives.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The documentation instructs users to disclose account passwords and cloud access keys directly to the assistant for configuration. This is a textbook insecure secret-handling pattern that can lead to credential leakage via chat logs, prompt history, model tooling, or downstream storage.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

Requesting cloud AccessKey ID/Secret directly from the user without warning about sensitivity or least privilege creates a clear secret-exposure path. These credentials can grant broad remote storage access and may enable data theft, deletion, or account abuse if disclosed improperly.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The guide similarly asks users to share NAS and SFTP login details with the assistant. Because these accounts may expose internal network storage or remote hosts, prompting conversational disclosure significantly raises the risk of unauthorized access and lateral movement if the secrets are mishandled.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

The documentation directs storage of Samba credentials in a plaintext secrets.env file, signaling handling of sensitive credentials without mention of file-permission hardening or secret-manager protection. Plaintext secret files are common attack targets and become more risky when the skill also performs automatic detection and configuration.

Content

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

  1. 在 NAS 上创建共享文件夹(如 memory 或 家庭共享)
  2. 告诉我 NAS 的 IP 地址、共享名称和登录信息,我帮你配置

凭证配置:在 ~/.openclaw/credentials/secrets.env 中添加:

bash
SAMBA_HOST=192.168.10.216
SAMBA_USER=你的用户名

Credential Access

High
Category
Privilege Escalation
Confidence
92% confidence
Finding

Centralizing all provider credentials in a single secrets.env file creates a concentrated credential target, and the document provides no guidance on encryption, permission restrictions, or isolation by backend. Compromise of that file would expose multiple external storage services at once.

Content

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

凭证管理

所有凭证存储在 ~/.openclaw/credentials/secrets.env:

bash
# 坚果云 WebDAV

Credential Access

High
Category
Privilege Escalation
Confidence
98% confidence
Finding

Accessing ~/.ssh/config is credential-adjacent behavior because the file can contain host aliases, usernames, jump hosts, identity file paths, and other sensitive connection metadata. In the context of a backup setup skill, reading this file for automatic discovery is unnecessary and expands access into sensitive user infrastructure configuration.

Content

Scanner excerpt · scripts/auto_detect.py (reported line 426)May include surrounding context.

python
services = []
        
        # 检测 SSH 配置
        ssh_config = Path.home() / ".ssh" / "config"
        if ssh_config.exists():
            try:
                content = ssh_config.read_text()

Credential Access

High
Category
Privilege Escalation
Confidence
99% confidence
Finding

Reading ~/.ssh/known_hosts performs discovery of a user's historical server connections and can reveal private hostnames and internal network assets. This is sensitive operational metadata and constitutes credential/infrastructure access beyond what is necessary for normal onboarding.

Content

Scanner excerpt · scripts/auto_detect.py (reported line 448)May include surrounding context.

python
pass
        
        # 检测 known_hosts 中的服务器
        known_hosts = Path.home() / ".ssh" / "known_hosts"
        if known_hosts.exists():
            try:
                content = known_hosts.read_text()

Credential Access

High
Category
Privilege Escalation
Confidence
99% confidence
Finding

Referencing a secrets.env path under a credentials directory indicates deliberate probing for stored secrets. Even checking for existence in this context is risky because it normalizes secret-file discovery and may lead to future expansion into secret extraction, while already exceeding expected scope for auto-detection.

Content

Scanner excerpt · scripts/auto_detect.py (reported line 528)May include surrounding context.

python
)
            services.append(service)
        
        # 检测 secrets.env
        secrets_file = Path.home() / ".openclaw" / "credentials" / "secrets.env"
        if secrets_file.exists():
            try:

Credential Access

High
Category
Privilege Escalation
Confidence
99% confidence
Finding

The code reads the contents of secrets.env, which is direct access to locally stored credentials or credential-bearing material. This is highly sensitive behavior and unnecessary for merely determining whether a service may be available, making the onboarding flow materially more dangerous.

Content

Scanner excerpt · scripts/auto_detect.py (reported line 529)May include surrounding context.

python
services.append(service)
        
        # 检测 secrets.env
        secrets_file = Path.home() / ".openclaw" / "credentials" / "secrets.env"
        if secrets_file.exists():
            try:
                content = secrets_file.read_text()