Back to skill

Security audit

Baidu Netdisk AIVideoNotes

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its Baidu video-note purpose, but it can upload local videos and can route requests through an unvalidated environment-controlled proxy, which creates a review-worthy privacy and credential exposure risk.

Review this skill before installing. Use it only with videos you are allowed to send to Baidu, avoid sensitive local recordings unless you understand the upload behavior, and run it only in a trusted environment where DUMATE_SCHEDULER_URL and DUMATE_SESSION_ID cannot be attacker-controlled.

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 (1)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/ai_notes_task_create.py:36
Finding
Unvalidated Environment-Controlled Proxy Enables Sensitive Data Exfiltration## Vulnerability Details **File Location**: - `scripts/ai_notes_task_create.py:36-46, 63-96` - `scripts/ai_notes_task_query.py:14-41` - `scripts/ai_notes_poll.py:25-52` **Vulnerability Type**: Untrusted network destination and sensitive data disclosure **Risk Level**: High ### Vulnerable Code `scripts/ai_notes_task_create.py:36-46`: ```python url, headers = resolve_sandbox_url(api_key, "https://appbuilder.baidu.com/v2/tools/bos/upload") headers = { "Authorization": f"Bearer {api_key}", "X-Appbuilder-From": "openclaw", } with open(file_path, "rb") as f: files = {"file": (os.path.basename(file_path), f)} response = requests.post(url, headers=headers, files=files) response.raise_for_status() result = response.json() ``` `scripts/ai_notes_task_create.py:63-96`: ```python def resolve_sandbox_url(api_key: str, original_url: str) -> Tuple[str, Dict[str, str]]: """若当前在沙盒环境中,将目标 URL 替换为代理 URL,并返回需要附加的 headers。""" session_id = os.environ.get("DUMATE_SESSION_ID") scheduler_url = os.environ.get("DUMATE_SCHEDULER_URL") headers = { "Content-Type": "application/json", } if not session_id or not scheduler_url: if not api_key: raise ValueError("未设置 API Key,请通过环境变量 BAIDU_API_KEY 设置或使用") headers.update({ "Authorization": f"Bearer {api_key}", "X-Appbuilder-From": "openclaw", }) return original_url, headers parsed = urlparse(original_url) proxy_url = f"{scheduler_url}/api/qianfanproxy{parsed.path}" if parsed.query: proxy_url += f"?{parsed.query}" headers.update({ "Host": parsed.netloc, "X-Dumate-Session-Id": session_id, "X-Appbuilder-From": "desktop", }) return proxy_url, headers ``` `scripts/ai_notes_task_query.py:14-41`: ```python def resolve_sandbox_url(api_key: str, original_url: str) -> Tuple[str, Dict ...[truncated 4957 chars]
Remediation
## Remediation Suggestions 1. Enforce an exact allowlist of trusted scheduler hostnames rather than accepting an arbitrary URL: - Require the `https` scheme. - Reject embedded credentials, fragments, unexpected ports, IP literals, and noncanonical hostnames. - Compare the parsed hostname against explicitly configured platform domains. 2. Obtain the scheduler endpoint from a trusted runtime configuration channel where possible. Do not treat ordinary inheritable environment variables as sufficient proof that a destination is trusted. 3. Validate the final resolved URL immediately before every request, including after any redirect. Disable redirects or verify every redirect target for requests carrying files, API keys, session identifiers, or task data. 4. Avoid overwriting the validated headers returned by `resolve_sandbox_url()`. Build upload headers through one centralized function so direct and proxy modes have explicit, independently reviewed credential policies. 5. Never transmit `BAIDU_API_KEY` to a sandbox proxy unless that proxy is explicitly designed and authorized to receive it. Prefer proxy-scoped, short-lived credentials where proxy authentication is required. 6. Add an explicit timeout to the upload request: ```python response = requests.post( url, headers=headers, files=files, timeout=(10, 120), allow_redirects=False, ) ``` 7. Before uploading a local file, clearly disclose the validated destination to the user and obtain confirmation when the destination differs from the documented Baidu service. 8. Apply the same centralized destination validation to task creation, manual query, and automatic polling to prevent task IDs, video URLs, and session metadata from being redirected.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (6)

Lp3

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding
The skill declares capabilities that require environment access and outbound network use, but it does not define any explicit tool scope such as permissions or allowed-tools. This weakens least-privilege controls and makes it easier for an agent runtime to grant broader access than necessary when handling external URLs and API keys.

Vague Triggers

Medium
Confidence
89% confidence
Finding
The description is broad enough to match common requests such as summarizing a video or turning video into notes, which can cause over-triggering in contexts the user did not intend. In an agent ecosystem, ambiguous triggering can silently route user content or URLs to an external service, creating privacy and consent risks.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill instructs users to submit local or network video URLs to an external service but does not clearly warn that the video reference and potentially its contents will be processed by a third party. This is dangerous because users may unknowingly expose private meeting recordings, educational content, or internal media to an external provider.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
If the user supplies a local file path, the script silently uploads the video to Baidu BOS before task creation. Because video files may contain sensitive meeting, educational, or personal content, the lack of an explicit user-facing warning or confirmation creates a meaningful privacy and data-exposure risk, especially in an agent/automation context where users may assume processing is local.

External Transmission

Medium
Category
Data Exfiltration
Content
data = {"url": video_url}

    try:
        response = requests.post(url, headers=headers, json=data, timeout=30)
        response.raise_for_status()
        result = response.json()
Confidence
80% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Low
Confidence
79% confidence
Finding
This code consumes a sensitive credential from the environment to authenticate remote requests. While the variable name is visible in code, the script does not provide a user-facing notice or warning that it will access and use an API key from the environment.

Static analysis

No suspicious patterns detected.