Back to skill

Security audit

Z.AI Web Search

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its web-search purpose, but its extraction script can fetch any URL from the user's agent environment without network or size safeguards.

Install only if you are comfortable with a skill that can send searches to Z.AI and, when invoked, fetch arbitrary URLs from your agent's network environment. Avoid using the extract command on untrusted, internal, localhost, metadata-service, or private-network URLs unless the skill is updated with URL validation, redirect checks, timeouts, and response-size limits.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/extract.mjs:39
Finding

Unrestricted URL Fetching Enables Server-Side Request Forgery

Content
View full analysis
/`, a private network service, or `http://169.254.169.254/`. 2. `extract.mjs` passes the URL directly to `fetch()`. 3. The request is sent from the Agent host and may reach services unavailable to the attacker. 4. If the endpoint responds successfully, the response is read, processed by `stripHtml()`, and printed. 5. The attacker can use returned content or HTTP status differences to inspect internal resources and probe reachable services. A public URL that redirects to an internal destination can provide an equivalent exploitation path because redirect targets are not revali ...[truncated 745 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/extract.mjs:39
Finding

Unbounded Remote Response Buffering Enables Resource Exhaustion

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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
Findings (10)

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The README expands the skill from search-only behavior to an additional extraction feature that fetches arbitrary webpages, which is not reflected in the stated skill purpose/metadata. This capability expansion matters because remote content retrieval can introduce SSRF-like network access, unexpected data handling, and a broader trust boundary than users or reviewers would expect from a search-only skill.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Documenting arbitrary URL fetching/extraction in a skill described as search-only indicates the skill may be used to contact attacker-controlled or sensitive endpoints outside the expected search API flow. Even though this is only documentation, it signals an implementation path that can be abused for SSRF-style access, local network probing, or retrieval of untrusted content for downstream LLM processing.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill declares executable capabilities that use both an environment secret (ZAI_API_KEY) and outbound network access, but it does not define any explicit tool scope such as permissions or allowed-tools. In an agent ecosystem, this weakens least-privilege controls and makes it easier for the skill to be invoked with broader-than-necessary access or combined with other tools in unsafe ways.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script accepts arbitrary user-supplied URLs and fetches them directly, enabling network access beyond the declared web-search API behavior. In an agent environment, this can be abused for unintended outbound requests, internal network probing/SSRF, and data retrieval from untrusted locations, especially because there is no allowlist, scheme validation, or host restriction.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The code adds a scraping/extraction capability that is broader than the skill's stated purpose of returning structured search results. This mismatch increases risk because operators may grant the skill search-only trust while it can actually retrieve arbitrary page contents, which can expose the agent to prompt injection content and unauthorized network interactions.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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/search.mjs (reported line 67)May include surrounding context.

js
body.search_domain_filter = domainFilter.startsWith("www.") ? domainFilter : `www.${domainFilter}`;
}

const resp = await fetch("https://api.z.ai/api/paas/v4/web_search", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% 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/search.mjs (reported line 67)May include surrounding context.

js
body.search_domain_filter = domainFilter.startsWith("www.") ? domainFilter : `www.${domainFilter}`;
}

const resp = await fetch("https://api.z.ai/api/paas/v4/web_search", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This code sends the user-provided search query, along with optional domain and recency filters, to the remote Z.AI web_search endpoint. The script has no confirmation prompt, no user-facing notice before transmission, and no inline warning that user input will be sent to a third-party service.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The README describes direct fetch-based extraction but does not warn that the script will make outbound requests to any user-provided URL. That omission increases the risk of unsafe use, because operators may not realize the tool can reach arbitrary destinations and ingest potentially malicious content, making the search-skill context more dangerous than advertised.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The request hard-codes the Accept-Language header to "en-US,en", which imposes a specific language/locale preference for all users. There is no visible opt-in, configuration option, or comment justifying this locale restriction.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.env_credential_access

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
scripts/search.mjs:50