Back to skill

Security audit

Baidu Netdisk Skills

Security checks for vulnerabilities and agentic risk

Overview

This Baidu Netdisk skill is mostly purpose-aligned, but it asks agents to run broad shell file-transfer commands, background downloads, and agent-memory backup/restore workflows with unclear safeguards.

Install only if you trust this publisher with your Baidu Netdisk account and local workspace. Before use, require explicit confirmation for uploads, deletes, shares, downloads, memory backup, and restore; avoid using it on sensitive memory files unless backups are encrypted and reviewed; and do not let agents pass user-provided paths directly into shell commands.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:109
Finding

Shell Command Injection Through Unquoted User-Controlled Paths

Content
View full analysis
nohup bdpan download > /tmp/bdpan-dl-$$.log 2>&1 & echo $! bdpan share [additional-paths...] [--period ] [--json] ``` ### Technical Analysis The Skill directs the Agent to insert user-selected local and remote paths directly into shell command strings. These arguments are not quoted, are not passed through an argument-array execution interface, and are not separated from options using `--`. The documented validation only prohibits path traversal indicators such as `..`, `~`, and out-of-scope absolute remote paths. Such validation does not prevent shell metacharacters including semicolons, command substitutions, redirections, pipes, or control operators. If an Agent follows these templates using a shell-based `exec` tool, a malicious filename or path can be interpreted as shell syntax rather than as a single `bdpan` argument. ### Attack Path 1. An attacker asks the Agent to upload, download, or share a file whose supplied path contains shell syntax. 2. For example, the attacker supplies a path structurally similar to: ```text report.pdf; attacker-command ``` 3. The path may pass the documented traversal checks because it contains neither `..` nor `~`. 4. The Agent interpolates the path into one of the documented command templates. 5. The shell treats the semicolon as a command separator. 6. The injected command executes with the operating-system privileges and environment available to the Agent process. Other shell constructs, such as command substitution or output redirection, may produce equivalent exploitation paths. ### Impact Assessment Successful exploitation permits arbitrary command execution wit ...[truncated 548 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:183
Finding

Sensitive Agent Memory Is Backed Up to Cloud Storage Without Required Confidentiality Controls

Content
View full analysis
//manual// Backup contents: Seven workspace files, memory/*.md, and manifest.json Backup operation: bash ${CLAUDE_SKILL_DIR}/ backup ``` The preceding security constraint also states that memory backups must be processed through `memory-backup.sh`, but that script is not included in the audited project. ### Technical Analysis The Skill is designed to collect persistent Agent state and upload it to Baidu Netdisk. The listed content includes workspace instruction files and `memory/*.md`, which may contain private user context, operational details, persistent Agent instructions, or secrets copied into memory. No mandatory client-side encryption, secret scanning, content filtering, file-level allowlist, retention policy, or confidentiality classification is specified before upload. The project also does not include the required backup implementation, so the audit cannot verify whether the missing script performs encryption, redaction, safe authentication, or integrity checking. This behavior is presented as an intended backup feature rather than covert exfiltration. Nevertheless, storing potentially sensitive Agent state externally without enforceable confidentiality controls creates a material disclosure risk. ### Attack Path 1. A user requests an Agent memory backup. 2. The Skill instructs the Agent to collect workspace and memory documents. 3. The collected documents are uploaded to the configured Baidu Netdisk account. 4. The backup remains remotely stored without a documented encryption or retention requirement. 5. An attacker who compromises the Netdisk account, authorization token, or an unint ...[truncated 1157 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:128
Finding

Predictable Temporary Log Path Enables Symlink Attacks and Leaves Residual Logs

Content
View full analysis
> /tmp/bdpan-dl-$$.log 2>&1 & echo $! kill -0 2>/dev/null && echo "running" || echo "done"; ls -l 2>/dev/null; tail -5 /tmp/bdpan-dl-.log 2>/dev/null rm -f /tmp/bdpan-dl-.log ``` ### Technical Analysis The log is created in the shared `/tmp` directory using the current shell process identifier (`$$`). The path is predictable and is opened through ordinary shell redirection without exclusive creation or symlink protection. On a multi-user system, another local process may predict or observe the filename and create a symbolic link at that path before redirection occurs. The shell can then follow that link and truncate or overwrite a file writable by the Agent account. The workflow also records the background download PID through `$!`, but later reads and deletes a filename based on that background PID. The created filename uses the shell PID, while polling and cleanup use the child PID. These values are generally different, so the real log can remain in `/tmp` while the workflow reads or deletes the wrong path. ### Attack Path 1. A local attacker predicts or observes the shell PID used by the Agent. 2. The attacker creates `/tmp/bdpan-dl-.log` as a symbolic link to another file writable by the Agent. 3. The Agent starts the documented background download. 4. Shell redirection follows the symbolic link and truncates or writes to the linked target. 5. Cleanup targets `/tmp/bdpan-dl-.log`, not the actual shell-PID log. 6. The real log or modified target remains after the operation. Even without a local attacker, the PID mismatch can leave logs containing filenames, paths, and error ...[truncated 553 chars]
Remediation
View remediation
Vulnerability Patterns
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (11)

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill advertises that all actions are restricted to /apps/bdpan/, yet later documents local filesystem writes for downloads and memory restore backups. That discrepancy weakens trust boundaries: an agent or user may authorize the skill believing it cannot touch local files, while it can in fact write arbitrary local download destinations and restore/backup workspace content.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill repeatedly claims operations are confined to /apps/bdpan/, but the documented memory restore workflow writes to local workspace files such as AGENTS.md, SOUL.md, MEMORY.md, and backup directories outside that scope. This mismatch can mislead operators and downstream agents into approving actions under a false assumption of confinement, enabling broader filesystem modification than advertised.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
91% confidence
Finding

The documented cleanup command rm -f /tmp/bdpan-dl-<PID>.log is dangerous if <PID> is derived from untrusted or malformed input, because shell metacharacters or path manipulation could turn a log cleanup into arbitrary file deletion. In an exec-enabled skill, documenting unsafe shell interpolation encourages implementations vulnerable to command/parameter injection.

Content

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

轮询进度

kill -0 2>/dev/null && echo "running" || echo "done"; ls -l <本地路径> 2>/dev/null; tail -5 /tmp/bdpan-dl-.log 2>/dev/null

清理日志

rm -f /tmp/bdpan-dl-.log

text
**分享链接下载(先转存再下载):**
```bash

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The manifest-facing fields such as displayName and summaries are entirely in Chinese, and the document consistently instructs user-facing responses like confirmation prompts in Chinese. There is no explicit statement that users may choose another language or locale, which can violate a language/locale choice policy.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
84% confidence
Finding

The skill explicitly promotes nohup-based background execution, creating persistent processes beyond the initiating session. In an agent environment, that reduces oversight, complicates attribution, and can leave long-running transfers or side effects active after the interaction ends.

Content

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

md
/apps/bdpan/ 目录范围内。支持完整的文件生命周期管理与 Agent 记忆备份恢复能力.
  核心能力:
  - 文件操作:上传、下载、转存、分享、搜索、移动、复制、重命名、创建文件夹、删除
  - 大文件下载策略:根据文件大小自动选择直接下载或 nohup 后台下载,避免 Bash 超时
  - 分享链接处理:支持从分享链接(含提取码)转存或下载到本地
  - 记忆备份与恢复:支持 4 种 Claw 产品(kimiclaw/maxclaw/qc...
tags:

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The capability boundary explicitly states that the Agent is forbidden from using the --yes parameter when running helper scripts for update/login. Later, the FAQ states that non-interactive memory restore 'must' use --yes, creating an active contradiction in the skill's own operational guidance about confirmation bypass behavior.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
95% confidence
Finding

This section gives concrete instructions for launching detached nohup bdpan download jobs and polling them later. That creates unattended execution and local file writes outside the normal request lifecycle, increasing the chance of abuse, orphaned processes, or unreviewed data transfer.

Content

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

大文件(> 50MB)后台下载流程:

bash
# 启动后台下载
nohup bdpan download <远端路径> <本地路径> > /tmp/bdpan-dl-$$.log 2>&1 & echo $!
# 轮询进度
kill -0 <PID> 2>/dev/null && echo "running" || echo "done"; ls -l <本地路径> 2>/dev/null; tail -5 /tmp/bdpan-dl-<PID>.log 2>/dev/null
# 清理日志

Session Persistence

Medium
Category
Rogue Agent
Confidence
93% confidence
Finding

The example workflow normalizes use of detached downloads for large files, reinforcing persistent execution as standard behavior. In a skill with exec capability and file transfer semantics, this increases operational risk because network and file activities continue without active supervision.

Content

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

md
bdpan ls --json ./downloaded/
# ...
# 4. 根据大小选择下载策略(假设视频 > 50MB,使用后台下载)
nohup bdpan download ./downloaded/video.mp4 ./local-video.mp4 > /tmp/bdpan-dl-$$.log 2>&1 & echo $!
# ...
# 5. 轮询进度并报告用户
kill -0 <PID> 2>/dev/null && echo "running" || echo "done"; tail -5 /tmp/bdpan-dl-<PID>.log

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

The troubleshooting guidance prescribes switching to nohup whenever large downloads time out, which institutionalizes persistence as the fallback path. That makes the risk more dangerous in context because the skill already handles downloads to local paths and can continue acting after the session ends.

Content

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

md
| 上传远端路径以 `/` 结尾 | 单文件上传远端路径格式错误 | 提示远端路径须为文件名而非目录,修正后 |
| 远端文件不存在 | `bdpan ls` 返回空,下载/移动目标缺失 | 用 `bdpan search <文件名>` 搜索确认,或检查路径拼写 |
| 分享链接格式无效 | 链接非 `pan.baidu.com/s/` 格式或已失效 | 提示用户检查链接格式,确认是否需要提取码(`-p` 参数) |
| 大文件下载超时 | 未按大小策略执行,Bash 超时中断 | 改用 nohup 后台下载,轮询进度,设 timeout 为 300000 |
| 同名文件已存在 | 上传/下载目标路径已有同名文件 | 列出现有文件,询问覆盖还是重命名,确认后执行 |
| 记忆备份环境不支持 | 当前非 kimiclaw/maxclaw/qclaw/skill-platform | 报错说明不支持当前环境,不执行备份/恢复操作 |
| 分享接口报付费错误 | 百度网盘开放平台服务未购买 | 提示分享为付费接口,需在开放平台购买服务后使用 |

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

The FAQ tells operators that files over 50MB must use nohup, effectively making persistent detached execution mandatory for a common use case. This increases likelihood of misuse and reduces human oversight over network downloads and local file creation.

Content

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

md
| 直接调用 bdpan login 被拦截 | Agent 误用裸 `bdpan login` 命令 | 禁止该调用,必须通过 `(请参考skill目录中的脚本文件)` 执行登录 |
## 问答汇总
### Q1:大文件下载总是超时怎么办?
A:先用 `bdpan ls --json <远端路径>` 获取文件 `size` 字段。超过 50MB 的文件必须使用 `nohup bdpan download ... > /tmp/bdpan-dl-$$.log 2>&1 &` 后台下载,Agent 轮询 `kill -0 <PID>` 与日志判断进度。Bash 工具 timeout 设为 300000(5 分钟)仅适用于 ≤50MB 的小文件.
### Q2:从分享链接下载和转存有什么区别?
A:`bdpan download "https://pan.baidu.com/s/未指定?pwd=yyy" ./local/` 会先转存到网盘再下载到本地;`bdpan transfer "https://pan.baidu.com/s/未指定" -p yyy` 只转存到网盘不下载本地。若只需保存到网盘用 transfer,需本地文件用 download.
### Q3:分享链接的有效期怎么选?

Session Persistence

Medium
Category
Rogue Agent
Confidence
82% confidence
Finding

The summary section codifies nohup as part of the skill's normal operating constraints, showing this is not incidental but a designed behavior. In context, persistent execution is more dangerous because the skill also supports downloads, transfers, sharing, and memory-related operations with shell execution privileges.

Content

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

md
- 分享功能为百度网盘开放平台付费接口,需购买服务.
- 记忆备份/恢复仅支持 4 种 Claw 产品环境.
- 登录必须通过 `(请参考skill目录中的脚本文件)`,禁止直接调用 `bdpan login`.
- 大文件下载受 Bash 超时限制,需使用 nohup 后台策略.
- 禁止读取或输出 `~/.config/bdpan/config.json` 等敏感凭据配置.
## 触发条件
- 用户明确提及百度网盘/bdpan/baidu drive 等关键词且有文件操作意图时激活.

Static analysis

No suspicious patterns detected.