Back to skill

Security audit

百度网盘

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent for Baidu Netdisk file management, but it includes high-impact install, self-update, and uninstall paths with under-scoped safeguards.

Install only if you are comfortable granting a skill access to your Baidu Netdisk files and selected local agent-memory files. Review installer/update behavior carefully, avoid --yes/--force for install, update, restore, or uninstall, confirm public shares before creation, and do not run the uninstaller with custom BDPAN_CONFIG_DIR values unless you have verified the exact path.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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 (3)

T08 · Insecure Dependencies

Error
Location
scripts/install.sh:184
Finding

Downloaded installer can execute without successful integrity verification

Content
View full analysis
/dev/null; then curl -fsSL -O "${installer_url}" elif command -v wget &> /dev/null; then wget -q "${installer_url}" else log_error "未找到 curl 或 wget,请手动下载安装器" exit 1 fi # 添加执行权限(非 Windows) if [ "$os" != "windows" ]; then chmod +x "${installer_name}" fi log_info "安装器下载完成,正在校验完整性..." # SHA256 完整性校验 local platform_key="${os}-${arch}" local expected_checksum expected_checksum="$(get_checksum "$platform_key")" if [ -n "$expected_checksum" ]; then local actual_checksum="" if command -v sha256sum &> /dev/null; then actual_checksum=$(sha256sum "${installer_name}" | awk '{print $1}') elif command -v shasum &> /dev/null; then actual_checksum=$(shasum -a 256 "${installer_name}" | awk '{print $1}') else log_warn "未找到 sha256sum/shasum 工具,跳过完整性校验" fi if [ -n "$actual_checksum" ]; then if [ "$actual_checksum" != "$expected_checksum" ]; then log_error "SHA256 校验失败!文件可能被篡改" log_error " 期望: ${expected_checksum}" log_error " 实际: ${actual_checksum}" rm -f "${installer_name}" exit 1 fi log_info "SHA256 校验通过" fi else log_warn "当前平台 ${platform_key} 无预置校验值,跳过完整性校验" fi ``` ```bash echo "" echo -e "${YELLOW}即将执行已下载的安装器:${NC}" echo " 路径: ./${installer_name}" echo " 来源: ${installer_url}" echo " SHA256: 已校验通过" echo "" echo "该安装器将向系统写入 bdpan CLI 二进制(通常位于 ~/.local/bin)。" if [ "$force" = "yes" ]; then log_warn "检测到 --yes/--force,跳过最终确认(非交互模式)。" else read -p "是否现在执行安装器?[y/N] " -n 1 -r echo if [[ ! $REPLY =~ ^[Yy]$ ]]; then log_info "已取消执行。安装器文件保留在当前目录:./${installer_name}" log_info "您可以先审查内容,或稍后手动执行:./${installer_name}" exit 0 fi fi # 执行安装器(非交互模式) ./${ins ...[truncated 2037 chars]
Remediation
View remediation
/dev/null 2>&1; then actual_checksum=$(sha256sum "$installer_path" | awk '{print $1}') elif command -v shasum >/dev/null 2>&1; then actual_checksum=$(shasum -a 256 "$installer_path" | awk '{print $1}') else log_error "No SHA-256 verification tool is available; refusing to execute." exit 1 fi [ -n "$expected_checksum" ] || { log_error "No pinned checksum exists for this platform; refusing to execute." exit 1 } [ "$actual_checksum" = "$expected_checksum" ] || exit 1 ``` ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/update.sh:180
Finding

Self-update archive is extracted without validating archive entry paths

Content
View full analysis
/dev/null; then curl -fsSL -o "$zip_path" "$remote_url" || { log_error "下载 Skill 更新包失败" return 1 } elif command -v wget &> /dev/null; then wget -q -O "$zip_path" "$remote_url" || { log_error "下载 Skill 更新包失败" return 1 } fi # SHA256 完整性校验(强制) local checksum=$(query_get "$SKILLS_INFO" "checksum") if [ -z "$checksum" ]; then log_error "配置接口未提供 checksum,无法验证更新包完整性,拒绝更新" return 1 fi local actual="" if command -v sha256sum &> /dev/null; then actual=$(sha256sum "$zip_path" | awk '{print $1}') elif command -v shasum &> /dev/null; then actual=$(shasum -a 256 "$zip_path" | awk '{print $1}') else log_error "未找到 sha256sum/shasum 工具,无法验证更新包完整性" return 1 fi if [ "$actual" != "$checksum" ]; then log_error "SHA256 校验失败!文件可能被篡改" log_error " 期望: ${checksum}" log_error " 实际: ${actual}" return 1 fi log_info "SHA256 校验通过" # 解压覆盖 log_info "正在解压更新..." if command -v unzip &> /dev/null; then unzip -qo "$zip_path" -d "$SKILL_DIR" || { log_error "解压失败" return 1 } else log_error "未找到 unzip 工具" return 1 fi ``` ### Technical Analysis The updater validates the download URL against an HTTPS domain allowlist and requires a matching SHA-256 checksum. These controls protect against accidental corruption and unauthorized download hosts. However, the archive is passed directly to `unzip -d "$SKILL_DIR"` without inspecting its entries. ZIP archives can contain: - Absolute paths. - Entries containing `../` traversal components. - Symbolic links followed by files written through those links. - Unexpected files outside the documented Skill file set. Depending on the installed `unzip` implementation and archive structu ...[truncated 1663 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/uninstall.sh:57
Finding

Environment-controlled configuration path enables arbitrary recursive deletion

Content
View full analysis
Remediation
View remediation
/dev/null && pwd -P) || { log_error "Unable to resolve configuration directory" exit 1 } case "$CONFIG_DIR_REAL" in ""|"/"|"$HOME"|".") log_error "Refusing to delete unsafe path: $CONFIG_DIR_REAL" exit 1 ;; esac case "$CONFIG_DIR_REAL" in "$HOME/.config/bdpan"|"$HOME/.config/"*/bdpan) ;; *) log_error "Refusing to recursively delete a non-bdpan directory" exit 1 ;; esac rm -rf -- "$CONFIG_DIR_REAL" ``` ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
Findings (32)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The skill includes self-update behavior that downloads remote content and modifies the local skill installation, while the declared purpose is user-facing Netdisk file management and memory backup. Silent or loosely gated self-update logic increases supply-chain risk because remote code/content can change local behavior outside the user's expected file operation scope.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill includes self-update behavior that downloads remote content and modifies the local skill installation, while the declared purpose is user-facing Netdisk file management and memory backup. Silent or loosely gated self-update logic increases supply-chain risk because remote code/content can change local behavior outside the user's expected file operation scope.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill includes self-update behavior that downloads remote content and modifies the local skill installation, while the declared purpose is user-facing Netdisk file management and memory backup. Silent or loosely gated self-update logic increases supply-chain risk because remote code/content can change local behavior outside the user's expected file operation scope.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill includes self-update behavior that downloads remote content and modifies the local skill installation, while the declared purpose is user-facing Netdisk file management and memory backup. Silent or loosely gated self-update logic increases supply-chain risk because remote code/content can change local behavior outside the user's expected file operation scope.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
88% confidence
Finding

The command template rm -f /tmp/bdpan-dl-.log performs file deletion based on a variable-derived path. In an agent/tooling context, if PID substitution or path construction is not strictly validated as numeric and locally generated, this pattern can become unsafe deletion or parameter-injection into a shell command.

Content

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

bash
# 3. 下载完成后清理日志
rm -f /tmp/bdpan-dl-<PID>.log

Agent 执行大文件后台下载时的行为规范:

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

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).

Content

Scanner excerpt · reference/bdpan-commands.md (reported line 481)May include surrounding context.

md
|------|------|
| `--config-path <path>` | 指定配置文件完整路径(适用于 AI Agent 集成) |
| `--json` | JSON 格式输出 |
| `--no-check-update` | 禁用版本更新检查 |
| `--help` | 显示帮助 |
| `--version` | 显示版本 |

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · reference/bdpan-commands.md (reported line 644)May include surrounding context.

md
import subprocess
import os

env = os.environ.copy()
env["BDPAN_CONFIG_PATH"] = "/home/user/.config/bdpan/config.json"

result = subprocess.run(

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

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).

Content

Scanner excerpt · reference/examples.md (reported line 380)May include surrounding context.

bdpan upload "/tmp/${BACKUP_FILE}" "backup/${BACKUP_FILE}"

清理

rm "/tmp/${BACKUP_FILE}"

echo "备份完成: ${BACKUP_FILE}"

text

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

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).

Content

Scanner excerpt · reference/troubleshooting.md (reported line 61)May include surrounding context.

解决方案:

bash
# 清除配置并重试
rm ~/.config/bdpan/config.json
bash ${CLAUDE_SKILL_DIR}/scripts/login.sh

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

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).

Content

Scanner excerpt · reference/troubleshooting.md (reported line 258)May include surrounding context.

解决方案:

bash
# 删除现有二进制文件
rm ~/.local/bin/bdpan

# 重新安装
bash ${CLAUDE_SKILL_DIR}/scripts/install.sh

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
93% confidence
Finding

This file implements a general remote package installer capability that is unrelated to the declared purpose of Netdisk file operations and memory backup/restore. That mismatch expands the skill’s effective authority: an attacker who can influence the config API or official hosting can deliver new scripts/content that alter behavior far beyond what users expect from the manifest.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script downloads a remote ZIP from a server-controlled URL and unpacks it directly over the local skill directory, effectively replacing code and prompts outside the skill’s stated Baidu Netdisk functionality. Although it includes HTTPS, domain allowlisting, and SHA256 checking, the trust root is still the remote config service, so compromise or misuse of that update channel can push arbitrary skill changes to users.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
84% confidence
Finding

Using nohup to launch downloads in the background creates a process that persists beyond the immediate agent session. In an agent context, session-persistent jobs are risky because they can continue consuming bandwidth, writing files, or operating without active supervision, and users may not realize the task remains active after the interaction ends.

Content

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

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

bash
# 1. 启动后台下载(nohup + 进度日志)
nohup bdpan download <远端路径> <本地路径> > /tmp/bdpan-dl-$$.log 2>&1 & echo $!

Session Persistence

Medium
Category
Rogue Agent
Confidence
65% confidence
Finding

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.

Content

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

bash
# 1. 启动后台下载(nohup + 进度日志)
nohup bdpan download <远端路径> <本地路径> > /tmp/bdpan-dl-$$.log 2>&1 & echo $!
bash

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The documentation shows how to create public Baidu Netdisk share links and explicitly displays extraction codes, but it does not warn about privacy, unintended redistribution, or the sensitivity of the files being shared. In a file-management skill, this omission matters because users may be encouraged to expose private cloud files without understanding the disclosure risk.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

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.

Content

Scanner excerpt · reference/bdpan-commands.md (reported line 585)May include surrounding context.

}

text

### mv/cp/rename/mkdir 命令输出

```json
{

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

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.

Content

Scanner excerpt · reference/bdpan-commands.md (reported line 585)May include surrounding context.

}

text

### mv/cp/rename/mkdir 命令输出

```json
{

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The login flow instructs the agent to execute an external bash script, which expands the skill from direct tool use into arbitrary subprocess execution. Because the script contents are not visible in this file and login handles sensitive OAuth material, this creates unnecessary trust in external code and raises the risk of token theft, unsafe prompts, or unintended local side effects.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The transfer examples write files into the user's cloud storage without any warning, preview of destination, or confirmation step. This can cause unwanted persistence of external shared content, accidental import of malicious or sensitive files, and user confusion about where data was written.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The move, copy, rename, and mkdir examples modify remote user data but do not require confirmation or even warn that the cloud file layout will change. In a high-risk file-management skill, omission of these safeguards increases the chance of destructive or unintended reorganization of user data, especially when commands are composed across multiple steps.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest describes a skill for Baidu Netdisk operations plus memory backup/restore, but these examples instruct users to run general-purpose local shell automation including for loops, tar, writing to /tmp, and rm. Those capabilities are not part of the declared skill purpose itself; they expand the skill documentation into local system backup scripting rather than just operating the Baidu Netdisk interface.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

L100-L125 明确要求“展示给用户时”将 API 路径转换为中文名,并把暴露 API 路径视为错误示例。这构成了对输出语言/本地化的强制要求,但文档没有说明这是用户可选项,也没有给出语言偏好协商机制。

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · reference/troubleshooting.md (reported line 305)May include surrounding context.

安装所需依赖(特定于发行版):

bash
# Debian/Ubuntu
sudo apt-get install libc6

# Fedora/RHEL
sudo dnf install glibc

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · reference/troubleshooting.md (reported line 308)May include surrounding context.

安装所需依赖(特定于发行版):

bash
# Debian/Ubuntu
sudo apt-get install libc6

# Fedora/RHEL
sudo dnf install glibc

File System Enumeration

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.

Content

Scanner excerpt · reference/troubleshooting.md (reported line 349)May include surrounding context.

bash
# 检查配置文件是否存在及权限
ls -la ~/.config/bdpan/

# 检查登录状态和 Token 有效期
bdpan whoami

Static analysis

No suspicious patterns detected.