Back to skill

Security audit

Zhipu AI Search

Security checks for vulnerabilities and agentic risk

Overview

This web-search skill is purpose-aligned, but it needs review because it grants broad Python execution and file-write authority beyond the documented search workflow.

Install only if you are comfortable sending search terms to Zhipu's Web Search API and exposing a ZHIPUAI_API_KEY to the skill runtime. Before use, narrow the Claude Bash permission to the exact search_util.py command, remove Write unless you need saved output, avoid sensitive or secret search queries, and pin dependencies for reproducible installs.

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

T05 · Unauthorized Access and Privilege Escalation

Error
Location
.claude/settings.json:1
Finding
Overly Broad Python Execution Permission Enables Arbitrary Code Execution## Vulnerability Details **File Location**: `.claude/settings.json`, lines 1-8 **Vulnerability Type**: Overly broad command execution permission **Risk Level**: High ### Vulnerable Code ```json { "permissions": { "allow": [ "Bash(python:*)", "Bash(python3:*)" ] } } ``` ### Technical Analysis The configuration permits every Bash command beginning with `python` or `python3`, rather than limiting execution to the supplied `search_util.py` utility. The legitimate function of this skill only requires running a specific search script, so unrestricted interpreter access violates least privilege. An unrestricted Python interpreter is effectively a general-purpose code-execution facility. Commands such as `python3 -c "..."` can read and modify files, access environment variables, create network connections, launch subprocesses, or execute operating-system commands with the privileges of the agent process. Although the audited package contains no malicious Python payload, this permission substantially expands what an injected or incorrectly generated command could do. ### Attack Path 1. The skill is installed with the included Claude permission configuration. 2. The agent processes attacker-controlled instructions, potentially through a user request or untrusted web-search content. 3. Those instructions induce the agent to invoke a command such as `python3 -c "<attacker-controlled code>"`. 4. The wildcard permission matches the command because it begins with `python3`. 5. The Python code executes without an additional permission boundary. 6. The code can access files, environment variables such as `ZHIPUAI_API_KEY`, subprocess APIs, and network resources available to the agent account. ### Impact Assessment Successful exploitation provides arbitrary code execution under the operating-system account running the agent. Potential consequences include: - Reading or modifying any f ...[truncated 610 chars]
Remediation
## Remediation Suggestions - Replace interpreter-wide wildcard rules with a narrowly scoped rule that permits only the intended script and required arguments. - Avoid permitting `python -c`, `python3 -c`, standard-input execution, arbitrary module execution through `-m`, or arbitrary script paths. - If the permission system cannot constrain arguments safely, expose the search operation as a dedicated tool rather than granting Bash access. - Run the utility in a sandbox with a restricted filesystem, minimal environment variables, and outbound network access limited to `open.bigmodel.cn`. - Keep `ZHIPUAI_API_KEY` outside subprocess environments unless it is strictly required by the invoked process. - Require explicit approval for commands that do not exactly match the expected `search_util.py` invocation. - Add tests verifying that commands such as `python3 -c`, `python3 -m`, and execution of unrelated scripts are denied.

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:1
Finding
Skill Requests Unnecessary File-Write Capability## Vulnerability Details **File Location**: `SKILL.md`, lines 1-5 **Vulnerability Type**: Excessive tool capability declaration **Risk Level**: Medium ### Vulnerable Code ```yaml --- name: zhipu-search description: 使用智谱 Web Search API 进行网络搜索。当用户需要搜索最新信息、查找实时数据、查询新闻、研究某个话题或获取网络上的信息时使用。支持多种搜索引擎(智谱基础版/高阶版、搜狗、夸克),可配置搜索范围、时间筛选、结果数量等参数。 tools: Bash, Write required_env_vars: ZHIPUAI_API_KEY --- ``` ### Technical Analysis The skill declares access to the `Write` tool even though its documented workflow only invokes `search_util.py` and displays search results. No audited instruction or code path requires creating or modifying local files. Granting a file-writing capability unnecessarily increases the consequences of prompt injection, model error, or malicious user instructions. If tool restrictions are derived from this metadata, an agent operating the search skill may write attacker-controlled content into any location exposed by the tool and permitted to the process account. The declaration is not itself proof that files are modified maliciously, and the audited package contains no persistence payload. The issue is the avoidable privilege exposed by a read-and-search-oriented skill. ### Attack Path 1. The skill is loaded and receives the declared `Write` capability. 2. The agent processes attacker-controlled instructions from a user or untrusted search content. 3. The instructions request that content be written to a project file, configuration file, agent instruction file, or other user-writable location. 4. Because file writing is declared as an allowed skill tool, the agent can perform the write even though it is unrelated to web search. 5. The modified file may affect subsequent development activity or future agent sessions if the chosen location is persistent and later consumed. ### Impact Assessment The exposed scope is limited to locations writable by the agent process and any additional restrictions imp ...[truncated 585 chars]
Remediation
## Remediation Suggestions - Remove `Write` from the skill's declared tools because the documented search workflow does not require filesystem modification. - Replace general Bash access with a dedicated, narrowly scoped search tool where supported. - If output persistence is added later, expose a constrained output operation limited to a designated directory and safe filename policy. - Prevent writes to agent instructions, repository configuration, executable paths, startup files, and dependency manifests. - Treat all web-search results as untrusted data and explicitly prohibit following tool-use instructions contained in titles, links, or result summaries. - Require user confirmation before any future feature writes search output to disk.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (11)

Tainted flow: 'headers' from os.getenv (line 53, credential/environment) → httpx.post (network output)

Critical
Category
Data Flow
Content
"Content-Type": "application/json"
    }

    response = httpx.post(API_URL, json=payload, headers=headers, timeout=60)
    response.raise_for_status()
    return response.json()
Confidence
90% confidence
Finding
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The README explains that the skill uses Zhipu's Web Search API but does not clearly warn that user queries will be transmitted to an external service. This omission can lead users or integrators to unknowingly send sensitive prompts, research topics, or proprietary information outside their environment.

Vague Triggers

Medium
Confidence
94% confidence
Finding
The README describes the skill as usable whenever the user 'needs to search network information,' which is broad enough to encourage activation in many ordinary conversations. In an agent setting, overly broad trigger guidance can cause unnecessary external calls and unintended disclosure of user queries to a third-party search API.

Lp3

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding
The skill declares tools and requires an API key, but it does not define any explicit tool scoping or allowed-tool restrictions despite having network and environment access. In an agent environment, missing scope constraints can let the skill be invoked with broader-than-necessary capabilities, increasing the chance of unintended external requests or access to sensitive environment data.

Vague Triggers

Medium
Confidence
92% confidence
Finding
The activation description is broad enough to trigger on many generic requests involving current information, research, or searching, which can cause the agent to route user prompts to this external-search skill unnecessarily. That raises privacy and security risk because benign user content or sensitive prompts may be sent to a third-party API when a local answer or clarification would have been safer.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill explains API key setup and usage but does not clearly warn that user search queries will be transmitted to the external Zhipu Web Search service. Without an explicit disclosure, users and calling agents may unknowingly send sensitive data, credentials, internal project details, or personal information to a third party.

Natural-Language Policy Violations

Medium
Confidence
86% confidence
Finding
User-facing strings such as the module description, argument help text, and error messages are all written in Chinese, with no option to select another language. This can violate language/locale policy when a skill imposes one language by default without documented opt-in or justification.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
User search queries are transmitted to a third-party remote API, but the script provides no user-facing disclosure that entered text will leave the local environment. In an agent context, users may submit sensitive internal data, credentials, or proprietary terms as part of a query, creating privacy and data-handling risk.

Natural-Language Policy Violations

Low
Confidence
82% confidence
Finding
README 从标题到使用说明均为中文,且未说明该技能仅面向特定中文用户群体,也未提供其他语言选项或用户选择机制。根据语言/locale 政策,若技能对语言有隐性强制,应当明确说明或提供选择。

Unpinned Dependencies

Low
Category
Supply Chain
Content
httpx>=0.23.0
Confidence
98% confidence
Finding
The dependency is specified as `httpx>=0.23.0` without an upper bound or exact pin, which makes builds non-reproducible and allows different environments to resolve to different versions. This increases supply-chain risk and can unintentionally introduce vulnerable or breaking releases over time, even if no exploit is present in the manifest itself.

Unverifiable Dependency: httpx has 2 known advisory(ies) (CVE-2021-41945 (Improper Input Validation in httpx); CVE-2021-41945 (Encode OSS httpx <=1.0.0.beta0 is affected by improper input validation in `http)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
89% confidence
Finding
The manifest references `httpx` without pinning a specific version, and the package has known advisories affecting some releases. Because the resolved version is unverifiable from this file alone, deployments could install an affected version, creating avoidable exposure to known dependency flaws.

Static analysis

No suspicious patterns detected.