Back to skill

Security audit

Baidu Drive

Security checks for vulnerabilities and agentic risk

Overview

The skill’s Baidu Drive purpose is coherent, but installation and update paths can run or replace code from remote endpoints with weak independent authenticity controls.

Review this skill before installing. It is suitable only if you trust the Baidu-hosted installer/update channel and are comfortable granting a shell-backed agent authority over your Baidu Drive app folder, local download paths, and share-link creation. Avoid using automatic update/install modes in sensitive environments, confirm destinations before upload/download/share, and do not run uninstall with custom BDPAN_CONFIG_DIR values unless you have verified the exact directory that will be deleted.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
Findings (3)

T08 · Insecure Dependencies

Error
Location
scripts/install.sh:181
Finding

Downloaded Native Installer Executes When Integrity Verification Is Unavailable

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 or wget was not found; download the installer manually" exit 1 fi if [ "$os" != "windows" ]; then chmod +x "${installer_name}" fi local platform_key="${os}-${arch}" local expected_checksum="${CHECKSUMS[$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 was not found; skipping integrity verification" fi if [ -n "$actual_checksum" ]; then if [ "$actual_checksum" != "$expected_checksum" ]; then log_error "SHA-256 verification failed" rm -f "${installer_name}" exit 1 fi fi else log_warn "No checksum is available for the current platform; skipping verification" fi ./${installer_name} --yes ``` ### Technical Analysis The script downloads a native executable from an external CDN and immediately grants it execution permission. Although expected SHA-256 values are embedded for supported platforms, verification fails open in two cases: 1. Neither `sha256sum` nor `shasum` is installed. 2. No checksum exists for the detected platform. In either case, the script continues to `./${installer_name} --yes`. HTTPS protects the transport connection but does not replace artifact-level authenticity verification. A compromised CDN origin, certificate trust chain, release pipeline, or local network environme ...[truncated 1360 chars]
Remediation
View remediation

T03 · Remote Payload Retrieval and Execution

Error
Location
scripts/update.sh:86
Finding

Updater Trusts a Mutable Remote URL and Checksum from the Same Configuration Response

Content
View full analysis
/dev/null; then response=$(curl -fsSL --connect-timeout 10 --max-time 30 "$CONFIG_API" 2>/dev/null) || { return 1 } elif command -v wget &> /dev/null; then response=$(wget -qO- --timeout=30 "$CONFIG_API" 2>/dev/null) || { return 1 } else return 1 fi local errno=$(echo "$response" | grep -o '"errno"[[:space:]]*:[[:space:]]*[0-9]*' | head -1 | grep -o '[0-9]*$') if [ "$errno" != "0" ]; then return 1 fi local skills_info=$(echo "$response" | sed 's/\\u0026/\&/g' | grep -o 'version=[^"]*' | head -1 | sed 's/\\//g') if [ -z "$skills_info" ]; then return 1 fi echo "$skills_info" } do_update() { local remote_url="$1" local remote_version="$2" if [ -z "$remote_url" ]; then return 1 fi local tmp_dir=$(mktemp -d) trap "rm -rf '$tmp_dir'" EXIT local zip_path="${tmp_dir}/baidu-drive.zip" if command -v curl &> /dev/null; then curl -fsSL -o "$zip_path" "$remote_url" || { return 1 } elif command -v wget &> /dev/null; then wget -q -O "$zip_path" "$remote_url" || { return 1 } fi local checksum=$(query_get "$SKILLS_INFO" "checksum") if [ -z "$checksum" ]; then 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 return 1 fi if [ "$actual" != "$checksum" ]; then return 1 fi if c ...[truncated 2682 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/uninstall.sh:56
Finding

Environment-Controlled Configuration Path Can Cause Arbitrary Recursive Deletion

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (26)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill explicitly permits self-update/install flows that download and execute remote code, and even notes that install.sh does not perform local SHA256 verification. This creates a real supply-chain risk: a compromised CDN, update endpoint, or script source could lead to arbitrary code execution on the host running the agent.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill explicitly permits self-update/install flows that download and execute remote code, and even notes that install.sh does not perform local SHA256 verification. This creates a real supply-chain risk: a compromised CDN, update endpoint, or script source could lead to arbitrary code execution on the host running the agent.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill explicitly permits self-update/install flows that download and execute remote code, and even notes that install.sh does not perform local SHA256 verification. This creates a real supply-chain risk: a compromised CDN, update endpoint, or script source could lead to arbitrary code execution on the host running the agent.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

The cleanup command interpolates a PID into an rm target, and if that value is ever malformed, attacker-influenced, or incorrectly parsed, it could delete unintended files under /tmp or beyond depending on shell handling. In agent skills, templated destructive shell commands are risky unless variables are strictly validated and safely quoted.

Content

Scanner excerpt · SKILL.md (reported line 130)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 469)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 632)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 336)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

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Including broad trigger words like “网盘/云盘” can cause the skill to activate for unrelated cloud-storage requests, increasing the chance of unintended command execution in the wrong context. In an agent setting, overly broad dispatch is a security issue because it can route user intent to tools with filesystem and shell access when a narrower skill should have been used.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The body trigger rule repeats the same ambiguity by accepting the generic term “网盘” as sufficient evidence of Baidu Drive intent. This weakens activation boundaries and can make the skill more dangerous because it is allowed to run Bash-backed workflows, including install/login routines, under misclassified requests.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

Using nohup to launch background downloads creates persistent processes outside the normal agent execution window. That persistence can outlive user oversight, continue consuming bandwidth/storage, and make it harder to guarantee cancellation, cleanup, and auditability if the task was triggered in error or on attacker-influenced paths.

Content

Scanner excerpt · SKILL.md (reported line 118)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
87% confidence
Finding

The explicit background-download pattern relies on a detached shell process and logfile polling, which introduces session persistence and reduces control over long-running operations. In the context of a shell-enabled agent, this raises operational and security risk because the process can continue after context changes or user revocation.

Content

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

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

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

该文件整体以中文编写,且未说明这是面向特定中文用户群或区域合规场景,也未提供其他语言选项。按规则,若技能在自然语言层面强制特定语言且没有用户选择或明确正当说明,应视为语言/locale 策略违规。

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 573)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 573)May include surrounding context.

}

text

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

```json
{

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The examples instruct the agent to upload files and immediately create public share links with extraction codes, but they omit any warning that this exposes the uploaded content to anyone with the link and code. In a file-management skill, this increases the risk of accidental data disclosure because users may treat 'upload and share' as routine without understanding the privacy consequence.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The backup script example archives local data, uploads it to cloud storage, and deletes the temporary archive, yet it gives no warning about handling potentially sensitive local content or the consequences of cleanup. This is riskier than the other examples because it normalizes automated exfiltration of a local directory to a remote service and subsequent deletion of the local temporary artifact.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

This markdown file contains user-facing safety instructions and operational notes entirely in Chinese, but it does not state that the skill is Chinese-only or offer any language/locale choice. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy violation.

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

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

该 markdown 文件包含面向用户/Agent 的自然语言指令,L517 明确要求向用户展示中文路径“我的应用数据/...”。这构成了特定语言/locale 的强制要求,但文档中没有提供语言切换、用户选择或明确说明该技能仅限中文场景。

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The download examples write files and directories to local paths but do not state that existing local content may be created or overwritten depending on tool behavior. While the examples are not overtly malicious, silent filesystem writes in an agent skill can surprise users and cause unintended local changes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The transfer examples import external shared content into the user's Baidu Drive without warning that this persists third-party material into the user's account storage. This can lead to accidental storage of untrusted, inappropriate, or policy-sensitive files, especially when users think they are only inspecting a link.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.