Back to skill

Security audit

zhipu web search

Security checks for vulnerabilities and agentic risk

Overview

This is a straightforward Zhipu web-search helper that sends user searches to Zhipu's API, with some documentation and input-validation gaps but no evidence of hidden, persistent, destructive, or deceptive behavior.

Install only if you are comfortable sending search queries and request parameters to Zhipu AI using your ZHIPU_API_KEY. Avoid secrets, personal data, regulated data, or sensitive internal project names in queries. The wrapper should ideally validate engine, count, and recency values and either implement or remove the advertised domain-filter feature.

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

Warning
Location
scripts/zhipu_search.sh:10
Finding

JSON Injection Through Unvalidated Command-Line Parameters

Content
View full analysis
[--engine ] [--count ] [--intent] [--recency ]" exit 0 ;; *) echo "Unknown parameter: $1"; exit 1 ;; esac shift done # Escape quotes and backslashes in the query for safe JSON encoding SAFE_QUERY="${QUERY//\\/\\\\}" SAFE_QUERY="${SAFE_QUERY//\"/\\\"}" # Build JSON payload manually PAYLOAD="{\"search_query\": \"$SAFE_QUERY\", \"search_engine\": \"$ENGINE\", \"search_intent\": $INTENT, \"count\": $COUNT, \"search_recency_filter\": \"$RECENCY\"}" ``` ### Technical Analysis The script constructs an API request by directly concatenating command-line parameters into a JSON string. Although backslashes and double quotes are escaped in `QUERY`, the following parameters receive no equivalent JSON encoding or semantic validation: - `ENGINE`, inserted inside a JSON string - `RECENCY`, inserted inside a JSON string - `COUNT`, inserted directly as a raw JSON value The script does not enforce the documented allowlists for the engine and recency options, nor does it verify that `COUNT` is an integer between 1 and 50. An attacker who can influence the script arguments can therefore insert JSON syntax into these fields. Depending on the supplied value, this can add arbitrary properties, create duplicate properties, alter request semantics, or make the payload invalid. The query-specific escaping is also incomplete as a general JSON encoder because it does not enco ...[truncated 2159 chars]
Remediation
View remediation
&2 exit 1 ;; esac ``` 3. Enforce an explicit allowlist for `RECENCY`: ```bash case "$RECENCY" in oneDay|oneWeek|oneMonth|oneYear|noLimit) ;; *) echo "Error: invalid recency filter" >&2 exit 1 ;; esac ``` 4. Require `COUNT` to contain only digits and enforce the documented range: ```bash if ! [[ "$COUNT" =~ ^[0-9]+$ ]] || (( COUNT < 1 || COUNT > 50 )); then echo "Error: count must be an integer from 1 to 50" >&2 exit 1 fi ``` 5. Check that every option requiring a value has a following argument before reading `$2`. 6. Build the payload using a serializer, for example: ```bash PAYLOAD="$(jq -n \ --arg query "$QUERY" \ --arg engine "$ENGINE" \ --argjson intent "$INTENT" \ --argjson count "$COUNT" \ --arg recency "$RECENCY" \ '{ search_query: $query, search_engine: $engine, search_intent: $intent, count: $count, search_recency_filter: $recency }')" ``` A serializer ensures that quotes, backslashes, control characters, and Unicode content are represented safely and prevents user input from changing the JSON structure. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (6)

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The skill description promises certain behavior and constraints, but the documented implementation omits important operational details: third-party network access, API credential use, and an advertised domain filter that is not actually shown as implemented. This mismatch can mislead users and security controls about what data leaves the environment and what restrictions are actually enforced.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill clearly relies on shell execution via curl, but the manifest does not declare an explicit tool scope such as allowed-tools or permissions. This weakens policy enforcement and reviewability, making it easier for a host agent to invoke shell/network behavior without transparent capability declaration.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill instructs users to submit arbitrary search queries to Zhipu AI's external API but does not prominently disclose that prompts, filters, and related request metadata will be transmitted to a third party. In agent environments, users may unknowingly send sensitive internal terms, research topics, or personal data off-platform.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

The documented curl command performs direct external transmission of user-supplied search content and includes authentication to a remote API. While this is core to the skill's purpose, it is still security-relevant because it can exfiltrate sensitive queries or context if invoked with confidential data.

Content

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

Quick Start

Basic cURL Usage

bash
curl --request POST \

External Transmission

Medium
Category
Data Exfiltration
Confidence
70% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/zhipu_search.sh (reported line 45)May include surrounding context.

sh
# Build JSON payload manually
PAYLOAD="{\"search_query\": \"$SAFE_QUERY\", \"search_engine\": \"$ENGINE\", \"search_intent\": $INTENT, \"count\": $COUNT, \"search_recency_filter\": \"$RECENCY\"}"

# Execute cURL request
curl -s --request POST \
  --url https://open.bigmodel.cn/api/paas/v4/web_search \
  --header "Authorization: Bearer $ZHIPU_API_KEY" \

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This code performs a network POST to an external API and transmits user-provided search text along with authentication data, but the file contains no confirmation prompt, logging, or comment/docstring warning the user that data will be sent off-system. Under the code-file criteria, outbound transmission of user or system data should have some visible disclosure unless clearly documented elsewhere in the skill description.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.