T09 · Insecure Skill Coding Practices
- Location
SKILL.md:60- Finding
Unsafe plaintext storage and handling of Z.AI API credentials
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
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.
SKILL.md:60Unsafe plaintext storage and handling of Z.AI API credentials
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
Error: Invalid access token
Solutions:
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.
openclaw config set agents.defaults.maxContextTokens 150000
### Step 4: Optional - Create Coding-Focused Agent
For dedicated coding agents:
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.
## 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
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.
## 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
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.
# International
https://api.z.ai/api/coding/paas/v4
# China
https://api.bigmodel.cn/api/coding/paas/v4
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.
https://api.z.ai/api/coding/paas/v4
https://api.bigmodel.cn/api/coding/paas/v4
### Rate Limiting
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.
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.
One-click install (OpenClaw):
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:
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.
"mcpServers": {
"web-search-prime": {
"type": "http",
"url": "https://api.z.ai/api/mcp/web_search_prime/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
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.
One-click install (OpenClaw):
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:
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.
"mcpServers": {
"web-reader": {
"type": "http",
"url": "https://api.z.ai/api/mcp/web_reader/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
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.
One-click install (OpenClaw):
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:
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.
"mcpServers": {
"zread": {
"type": "http",
"url": "https://api.z.ai/api/mcp/zread/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
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.
"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"
}
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.
},
"web-reader": {
"type": "http",
"url": "https://api.z.ai/api/mcp/web_reader/mcp",
"headers": {
"Authorization": "Bearer sk-your-api-key-here"
}
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.
},
"zread": {
"type": "http",
"url": "https://api.z.ai/api/mcp/zread/mcp",
"headers": {
"Authorization": "Bearer sk-your-api-key-here"
}