Back to skill

Security audit

Z.AI Coding Plan Setup

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent Z.AI/OpenClaw setup guide, but it asks users to persist broad agent configuration, remote MCP tools, and API credentials without enough privacy and secret-handling guardrails.

Review this before installing in a work or private-code environment. Prefer the interactive onboarding flow or a protected secret mechanism if available, avoid putting live bearer tokens in shell history, protect ~/.openclaw/openclaw.json, and do not use the Z.AI MCP tools with confidential URLs, private repositories, secrets, or regulated data unless that external provider and region are approved.

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
SKILL.md:60
Finding

Unsafe plaintext storage and handling of Z.AI API credentials

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
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (16)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

Invalid API Key

text
Error: Invalid access token

Solutions:

  1. Verify API key is correctly copied (no extra spaces)

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 · SKILL.md (reported line 92)May include surrounding context.

openclaw config set agents.defaults.maxContextTokens 150000

text

### Step 4: Optional - Create Coding-Focused Agent

For dedicated coding agents:

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

This section documents use of an external API endpoint for model requests, which means user prompts and coding data are transmitted off-system to a third party. In a coding-assistant context, that can expose source code, credentials pasted into prompts, or other sensitive project data if users are not clearly warned and controls are not defined.

Content

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

md
## Region Configuration

- **International**: `zai-coding-global` endpoint → `https://api.z.ai/api/coding/paas/v4`
- **China**: `zai-coding-cn` endpoint → `https://api.bigmodel.cn/api/coding/paas/v4`

## Troubleshooting

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

This line routes traffic to a China-region external API, creating the same off-platform transmission risk with additional data residency and regulatory sensitivity. Users may unknowingly send internal code or business data to infrastructure in a different jurisdiction.

Content

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

md
## Region Configuration

- **International**: `zai-coding-global` endpoint → `https://api.z.ai/api/coding/paas/v4`
- **China**: `zai-coding-cn` endpoint → `https://api.bigmodel.cn/api/coding/paas/v4`

## Troubleshooting

External Transmission

Medium
Category
Data Exfiltration
Confidence
87% confidence
Finding

The troubleshooting section repeats the external international endpoint without any security caveat, reinforcing a workflow where sensitive prompts and code are sent to a third party. Repetition in operational steps increases the chance that users treat the transmission as routine and low risk.

Content

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

bash
# International
https://api.z.ai/api/coding/paas/v4

# China
https://api.bigmodel.cn/api/coding/paas/v4

External Transmission

Medium
Category
Data Exfiltration
Confidence
87% confidence
Finding

This line repeats the China external endpoint and normalizes external data transfer without warning about jurisdiction or confidentiality concerns. In enterprise settings, that can lead to inadvertent policy violations when debugging or coding against private repositories.

Content

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

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill instructs users to install MCP tools that send prompts, URLs, fetched page contents, and repository data to external Z.AI services, but it does not disclose the privacy implications or warn against using sensitive data. This omission can cause users to unknowingly transmit proprietary code, internal URLs, or confidential research material to third-party infrastructure.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
95% confidence
Finding

Installing the web-search MCP tool configures an HTTP service that will receive user queries and associated metadata via an Authorization bearer token. Because the tool is intended for live web searches, users may expose sensitive research topics, internal terms, or prompt contents to the external service without realizing it.

Content

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

One-click install (OpenClaw):

bash
openclaw mcp add web-search-prime --type http --url "https://api.z.ai/api/mcp/web_search_prime/mcp" --header "Authorization: Bearer YOUR_API_KEY"

Manual configuration - Add to ~/.openclaw/openclaw.json:

External Transmission

Medium
Category
Data Exfiltration
Confidence
95% confidence
Finding

The manual MCP configuration persists an external HTTP endpoint and bearer-token authentication in local config, enabling ongoing transmission of user queries to a third party. Without a privacy warning, users may assume this is a local capability and submit confidential prompts.

Content

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

md
"mcpServers": {
 "web-search-prime": {
 "type": "http",
 "url": "https://api.z.ai/api/mcp/web_search_prime/mcp",
 "headers": {
 "Authorization": "Bearer YOUR_API_KEY"
 }

External Transmission

Medium
Category
Data Exfiltration
Confidence
96% confidence
Finding

The web-reader tool fetches and processes webpage content through an external API, which can expose requested URLs, fetched contents, and user intent to the provider. This is especially risky if users point it at private docs, internal dashboards, or signed links.

Content

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

One-click install (OpenClaw):

bash
openclaw mcp add web-reader --type http --url "https://api.z.ai/api/mcp/web_reader/mcp" --header "Authorization: Bearer YOUR_API_KEY"

Manual configuration - Add to ~/.openclaw/openclaw.json:

External Transmission

Medium
Category
Data Exfiltration
Confidence
96% confidence
Finding

The manual configuration for web-reader establishes persistent remote content retrieval with bearer auth but omits any discussion of data sensitivity. Users could unintentionally send confidential document contents or internal links to the provider.

Content

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

md
"mcpServers": {
 "web-reader": {
 "type": "http",
 "url": "https://api.z.ai/api/mcp/web_reader/mcp",
 "headers": {
 "Authorization": "Bearer YOUR_API_KEY"
 }

External Transmission

Medium
Category
Data Exfiltration
Confidence
96% confidence
Finding

The Zread MCP tool sends repository-identifying information and file-read requests to an external service for code analysis. In practice, this can expose repository structure, filenames, and potentially proprietary code access patterns to a third party.

Content

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

One-click install (OpenClaw):

bash
openclaw mcp add zread --type http --url "https://api.z.ai/api/mcp/zread/mcp" --header "Authorization: Bearer YOUR_API_KEY"

Manual configuration - Add to ~/.openclaw/openclaw.json:

External Transmission

Medium
Category
Data Exfiltration
Confidence
96% confidence
Finding

The manual Zread configuration persists remote code-analysis capability authenticated by bearer token, but the skill does not explain that repository interactions occur off-platform. That omission can mislead users into exposing code-related data they would not otherwise share externally.

Content

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

md
"mcpServers": {
 "zread": {
 "type": "http",
 "url": "https://api.z.ai/api/mcp/zread/mcp",
 "headers": {
 "Authorization": "Bearer YOUR_API_KEY"
 }

External Transmission

Medium
Category
Data Exfiltration
Confidence
93% confidence
Finding

The complete configuration example normalizes remote web-search integration and includes an Authorization header, encouraging copy-paste setup without emphasizing external data flow. This increases the risk of users enabling third-party transmission broadly across their environment.

Content

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

md
"mcpServers": {
 "web-search-prime": {
 "type": "http",
 "url": "https://api.z.ai/api/mcp/web_search_prime/mcp",
 "headers": {
 "Authorization": "Bearer sk-your-api-key-here"
 }

External Transmission

Medium
Category
Data Exfiltration
Confidence
93% confidence
Finding

This full example includes the remote web-reader endpoint, which can cause external transmission of URLs and fetched document contents. In aggregate with the rest of the config, it encourages broad enablement of remote content-processing capabilities without guardrails.

Content

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

md
},
 "web-reader": {
 "type": "http",
 "url": "https://api.z.ai/api/mcp/web_reader/mcp",
 "headers": {
 "Authorization": "Bearer sk-your-api-key-here"
 }

External Transmission

Medium
Category
Data Exfiltration
Confidence
93% confidence
Finding

This full example enables the remote Zread endpoint, making external repository-analysis requests part of the standard setup. Given the skill's coding focus, the context makes this more dangerous because users are likely to use it on real codebases that may be proprietary.

Content

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

md
},
 "zread": {
 "type": "http",
 "url": "https://api.z.ai/api/mcp/zread/mcp",
 "headers": {
 "Authorization": "Bearer sk-your-api-key-here"
 }