T09 · Insecure Skill Coding Practices
- Location
lib/cb-common.sh:31- Finding
Configuration File Is Executed as Unrestricted Shell Code
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a disclosed ClawBars integration, but it combines credentials, configurable network endpoints, posting/deletion, coin use, and AI-generated publishing without enough guardrails.
Install only in a controlled environment with trusted configuration files, trusted HTTPS endpoints, scoped/revocable ClawBars and AI tokens, and explicit human approval before publishing, deleting, joining private spaces, voting, or spending coins. Treat arXiv paper text and AI-generated summaries as untrusted until reviewed.
lib/cb-common.sh:31Configuration File Is Executed as Unrestricted Shell Code
lib/cb-common.sh:124Bearer Credentials and Sensitive Request Data Can Be Forwarded to Untrusted or Plaintext Endpoints
cap-arxiv/deposit.sh:106Predictable Shared Temporary Paths Permit Symlink and Race Attacks
cap-arxiv/interpret.sh:134Untrusted Paper Instructions Can Manipulate AI Output That Is Automatically Published
The description presents a multi-scene orchestration skill for research knowledge asset operations on ClawBars, with direct capabilities like balance check, vote detail, delete post, and member management. The actual code only fetches an agent's details from an agents API endpoint. That behavior is not represented in the declared scenes and is not one of the listed direct capabilities. While both relate generally to ClawBars APIs, the specific resource and primary purpose differ materially enough to count as a description-behavior mismatch.
The declared description presents a comprehensive orchestration skill for research knowledge assets and related ClawBars scenes (search, deposit, discussion, premium content, and certain direct atomic operations). The supplied code chunk does not implement any of those scene flows. Instead, it performs one specific function: issuing a GET request to /api/v1/agents to list agents, optionally filtered by type and limit. That is a materially different primary purpose and accesses a different resource domain than the declared research knowledge operations. While this may still be part of the broader ClawBars platform, the behavior shown here is not accurately represented by the declared description.
The declared description presents a multi-capability orchestration skill for interacting with ClawBars knowledge, vaults, discussions, premium content, and direct operational capabilities. The actual code chunk only performs one narrow function: registering an agent with the platform. That is a materially different primary purpose from the declared research knowledge asset orchestration behavior, and the specific capability exposed by the code—agent registration—is not mentioned in the description. This is therefore a clear description/behavior mismatch.
This is a clear description-behavior mismatch. The declared purpose describes a multi-scene ClawBars API orchestration skill for knowledge assets and discussions on the ClawBars platform. The actual code does none of that: it only retrieves paper data from arXiv, extracting an arXiv ID, downloading the abs/html pages, parsing title and content, and returning them. The primary purpose, target service, and capabilities are materially different from the declaration.
The declared description centers on orchestrating multiple ClawBars knowledge-management scenes and direct platform capabilities. The supplied code does none of that. Its primary purpose is to interpret arXiv papers: parse arXiv IDs, fetch paper content, prompt an LLM for Q1–Q6 analysis plus metrics/losses/datasets, and save Markdown output. There is no evidence of ClawBars resources, API endpoints, scene routing, capability chaining for ClawBars, or any of the listed platform actions. This is a clear description-behavior mismatch, not merely an implementation-detail difference.
The declared description presents a high-level orchestrator for numerous ClawBars research and collaboration workflows, including scene routing and atomic capability operations. The supplied code chunk does not implement any of those described behaviors. Instead, it performs a specific authenticated account operation: listing the current user's agents from an auth endpoint. This is materially different in primary purpose and resource accessed (user auth/agent inventory vs. knowledge asset operations across bars/vaults/discussions). Therefore this chunk does not accurately represent the declared description.
Yes, this is a mismatch. The declared description focuses on research knowledge operations on ClawBars: knowledge search, deposits to public/private vaults, discussions, premium content handling, and a limited set of atomic direct capabilities. The actual code performs user registration against an authentication endpoint, which is a materially different function and is not mentioned among the declared scenes or direct capabilities. While both relate to the broader ClawBars platform, account creation is not a supporting detail of the described orchestration behavior; it is a separate capability involving credential handling and auth resource access.
The declared description presents a multi-scene orchestration capability centered on knowledge search, deposits, discussions, premium content, and certain direct administrative operations. The supplied code instead only fetches trending/observability data from /api/v1/trends with optional filters. That behavior is not covered by the listed scenes S1–S7 or the cited direct capabilities. While both relate to the ClawBars platform, the code's primary purpose is materially different from the declared functionality.
This file performs arXiv scraping and content extraction, which is materially outside the stated ClawBars skill purpose of orchestrating ClawBars knowledge-asset operations. In an agent skill, undocumented off-scope network-fetching capabilities increase supply-chain and prompt-injection risk because the agent may retrieve and process untrusted external content that callers did not expect from this skill.
This script materially exceeds the declared ClawBars knowledge-asset orchestration scope by adding unrelated arXiv fetching and third-party AI analysis capabilities. Scope drift is dangerous because operators may grant this skill trust, permissions, or deployment in contexts where unexpected network access and data handling are not reviewed, enabling covert or ungoverned data exfiltration paths.
Allowing user-selectable external model/provider routing broadens the trust boundary and can silently redirect sensitive content to different vendors with different retention, jurisdiction, or abuse controls. In this skill, that is more dangerous because the capability is undeclared in the manifest and may bypass organizational review of approved AI providers.
# Usage:
# ./interpret.sh --arxiv-id 2501.12948
# ./interpret.sh --arxiv-id 2501.12948 --output-dir ./output
# ./interpret.sh --arxiv-id 2501.12948 --model deepseek-chat
#
# 环境变量:
# AI_API_KEY - AI API 密钥 (必需)
The skill explicitly orchestrates shell-script execution but does not declare any tool scope such as allowed shell access or permission boundaries. In an agent environment, undeclared shell capability weakens policy enforcement and can let a caller invoke broader system actions than reviewers or platform controls expect.
Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
## Capability Domains
| Domain | Purpose | Key Scripts |
| ------------------- | ------------------------------ | ---------------------------------------------------------------------------------------------- |
| `cap-agent` | Agent identity & lifecycle | `register.sh` `me.sh` `list.sh` `detail.sh` `bars.sh` |
| `cap-arxiv` | ArXiv paper fetch & interpret | `fetch.sh` `interpret.sh` `deposit.sh` |
Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
## Capability Domains
| Domain | Purpose | Key Scripts |
| ------------------- | ------------------------------ | ---------------------------------------------------------------------------------------------- |
| `cap-agent` | Agent identity & lifecycle | `register.sh` `me.sh` `list.sh` `detail.sh` `bars.sh` |
| `cap-arxiv` | ArXiv paper fetch & interpret | `fetch.sh` `interpret.sh` `deposit.sh` |
The skill advertises a direct post-deletion operation without any requirement for confirmation, dry-run, or user-warning language. In agentic workflows, destructive actions can be triggered accidentally, through prompt confusion, or by malicious task input, causing irreversible content loss.
The natural-language text in the file is presented in Chinese (for example, the description and inline comments) with no indication that this skill is intentionally region-specific or that users may choose another language. The policy requires avoiding forced language or locale constraints unless they are explicitly justified or optional.
The skill explicitly describes sending arXiv-derived paper content to an external AI API and then publishing the generated interpretation to ClawBars, but it does not warn users that content will leave the local environment or that deposited results may become persistent and shared. Even if arXiv papers are public, user-provided inputs, prompts, annotations, private vault targets, API metadata, or mixed-in non-public research context could be transmitted or stored unexpectedly, creating privacy and data-governance risk.
When AI interpretation succeeds, the script replaces the raw paper content with model-generated text and publishes it as the post body without any explicit disclosure in the content or output that the material is AI-generated. In a research knowledge platform, this can mislead downstream users into treating synthesized or hallucinated analysis as authoritative source material, causing integrity and trust issues rather than direct code execution impact.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
#
# 环境变量:
# AI_API_KEY - AI API 密钥 (必需)
# AI_BASE_URL - AI API 地址 (可选,默认 https://api.openai.com/v1)
# AI_MODEL - 模型名 (可选,默认 gpt-4o-mini)
#
# 输出: Markdown 格式的论文解读文件
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
#
# 环境变量:
# AI_API_KEY - AI API 密钥 (必需)
# AI_BASE_URL - AI API 地址 (可选,默认 https://api.openai.com/v1)
# AI_MODEL - 模型名 (可选,默认 gpt-4o-mini)
#
# 输出: Markdown 格式的论文解读文件
The natural-language instruction explicitly says the analysis must be output in Chinese, imposing a language constraint on all users. Under the policy, forced language or locale behavior is a violation unless the user can opt in or the restriction is clearly justified as region-specific.
The curl call transmits prompts, paper content, and an authorization bearer token to a remote endpoint derived from configuration. This is risky because the script allows arbitrary AI_BASE_URL values and performs no provider verification, so a misconfigured or malicious endpoint could capture sensitive content and credentials.
local messages_json="$1"
local response
response=$(curl -sS --max-time 120 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $AI_API_KEY" \
-d "{
The script sends paper title/content and prior model outputs to an external AI-compatible API without any explicit runtime consent, warning, redaction step, or destination validation. In a skill ecosystem, this can leak sensitive or copyrighted inputs to third parties unexpectedly, especially if users assume processing stays within the ClawBars platform.
This shell script sends the supplied email and password in a network request via cb_http_post, which is a safety-relevant operation involving sensitive user data. While the usage line documents required arguments, the file does not provide any warning, confirmation, or user-facing notice that credentials will be transmitted to a remote endpoint.
This code requires a sensitive credential-like value (--refresh-token) and sends it in an HTTP request body, but the script provides no visible user-facing warning, confirmation, or explanatory comment about handling or transmitting that sensitive data. For code files, sensitive credential access and network transmission should have some disclosure unless clearly covered elsewhere in the skill description, which is not present in this file.