T09 · Insecure Skill Coding Practices
- Location
scripts/capabilities/configure/service.py:36- Finding
Unrestricted Gateway URL Can Expose the AK and Gateway Bearer Token
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill performs the advertised bidding search, but its AK setup and automatic usage reporting create credential and privacy risks that should be reviewed before installation.
Install only if you trust the publisher and the OpenClaw/1688 gateway environment. Treat the AK as a secret: avoid pasting it into chat or shell history when possible, verify OPENCLAW_GATEWAY_URL points to a trusted local or approved HTTPS endpoint before configuring, and review permissions on the OpenClaw config file that stores the AK. Be aware that each completed CLI command may send signed usage metadata to the 1688 skills gateway.
scripts/capabilities/configure/service.py:36Unrestricted Gateway URL Can Expose the AK and Gateway Bearer Token
scripts/capabilities/configure/cmd.py:39Long-Lived AK Is Accepted Through Process Command-Line Arguments
scripts/capabilities/configure/service.py:63Plaintext AK Configuration File Is Written Without Enforced Restrictive Permissions
scripts/capabilities/bidding_search/cmd.py:18Untrusted API Fields Are Rendered as Agent-Directed Markdown Without Escaping
The code builds a destination URL for a credential-bearing PATCH request directly from the OPENCLAW_GATEWAY_URL environment variable and sends the API key in the JSON body, optionally with a bearer token header. If that environment variable is attacker-controlled or misconfigured, the skill can exfiltrate secrets to an arbitrary host, and the default also permits cleartext HTTP rather than enforcing TLS.
headers = {}
if token:
headers["Authorization"] = f"Bearer {token}"
resp = requests.patch(f"{gateway_url}/api/config",
headers=headers, json=payload, timeout=5)
return resp.ok
except Exception:
The documentation indicates additional behavior beyond search, including reading environment variables, writing local configuration, and sending authenticated requests to a gateway. In the context of an agent skill, this is particularly risky because the advertised read-only nature can cause underestimation of the attack surface and lead to unintended secret use, persistence, or external transmission.
The documentation indicates additional behavior beyond search, including reading environment variables, writing local configuration, and sending authenticated requests to a gateway. In the context of an agent skill, this is particularly risky because the advertised read-only nature can cause underestimation of the attack surface and lead to unintended secret use, persistence, or external transmission.
The documentation indicates additional behavior beyond search, including reading environment variables, writing local configuration, and sending authenticated requests to a gateway. In the context of an agent skill, this is particularly risky because the advertised read-only nature can cause underestimation of the attack surface and lead to unintended secret use, persistence, or external transmission.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
职责:每次 CLI 命令执行时,向 skill 网关上报一次调用记录,用于统计 skill 调用次数。
上报失败不影响主流程,静默处理。
环境变量(从项目根目录 .env 读取):
SKILL_NAME skill 名称,默认 cha88-bidding-search
SKILL_VERSION skill 版本,默认 1.0.0
SKILL_CHANNEL 发布渠道,默认 clawhub
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
职责:每次 CLI 命令执行时,向 skill 网关上报一次调用记录,用于统计 skill 调用次数。
上报失败不影响主流程,静默处理。
环境变量(从项目根目录 .env 读取):
SKILL_NAME skill 名称,默认 cha88-bidding-search
SKILL_VERSION skill 版本,默认 1.0.0
SKILL_CHANNEL 发布渠道,默认 clawhub
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
职责:每次 CLI 命令执行时,向 skill 网关上报一次调用记录,用于统计 skill 调用次数。
上报失败不影响主流程,静默处理。
环境变量(从项目根目录 .env 读取):
SKILL_NAME skill 名称,默认 cha88-bidding-search
SKILL_VERSION skill 版本,默认 1.0.0
SKILL_CHANNEL 发布渠道,默认 clawhub
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
def _load_env_file() -> None:
"""解析项目根目录的 .env 文件,将变量注入 os.environ(已有环境变量不覆盖)。"""
env_path = _ROOT_DIR / ".env"
if not env_path.exists():
return
with open(env_path, encoding="utf-8") as f:
The skill declares no explicit tool scope or permissions despite describing capabilities that involve environment access, local file interaction, and outbound network calls. Without clear scoping, an agent or reviewer may assume the skill is a simple read-only search tool when it can also access configuration and transmit data, increasing the risk of over-broad execution and misuse.
The skill states that every CLI invocation automatically reports usage to a remote endpoint, but this is not presented as a prominent user-facing warning or opt-in choice. Automatic transmission on each run can leak operational metadata such as skill identity, version, channel, and execution frequency, and in some environments even metadata-only egress is a policy violation.
The CLI invokes _tracker.report_skill_usage() after every command, introducing hidden telemetry behavior that is unrelated to the stated bidding-search functionality and not disclosed in this file's help or output contract. Even if the tracker only sends minimal analytics, this creates an undisclosed data-flow channel that could expose command usage, arguments, environment details, or user identifiers depending on _tracker implementation.
Post-execution telemetry is executed unconditionally after the main command completes, despite the skill being presented as a basic search tool. In this context, the hidden reporting capability increases risk because users would reasonably expect local command execution for search/configuration, not background reporting that may leak operational metadata.
The code reports usage after every command with no user-facing disclosure in this file, and exceptions are swallowed so the behavior remains silent. Silent telemetry is dangerous because it prevents informed consent and makes auditing difficult, while the hidden channel could be repurposed to exfiltrate sensitive command usage or environment information.
The skill explicitly instructs the agent to ask the user for an Access Key in chat and then pass it into a command, but it provides no warning about the sensitivity of the credential, no minimization guidance, and no safer collection channel. This creates a real secret-handling risk because credentials may be exposed in conversation history, logs, telemetry, screenshots, or downstream tool output.
The skill defines a natural-language credential collection flow: extract the user's AK from the message and use it directly in cli.py configure <AK>. That is dangerous because it normalizes submission of secrets through chat and direct command-line interpolation, increasing the chance of credential exposure through transcripts, process arguments, shell history, logging, or accidental re-disclosure.
The manifest describes this skill as "88查招投标基础搜索", which implies a bidding-information search function. This file documents an additional capability that reports invocation metadata to a remote gateway, including request construction, authentication reuse, retries, and failure handling. Remote telemetry is not part of the user-stated search purpose and is not justified by the manifest description alone.
The code reads a local .env file and injects values into process environment state solely to support telemetry configuration, which is unrelated to the declared search purpose. Reading local configuration files broadens access to sensitive deployment context and can unintentionally normalize handling of secrets-adjacent data without clear user awareness.
This file performs network telemetry reporting on every CLI invocation, which goes beyond the stated skill purpose of bidding/search functionality. Even though the payload appears limited to skill metadata, undisclosed outbound reporting expands the skill's behavior and creates privacy, transparency, and policy-compliance risk.
Telemetry is sent on every CLI execution and failures are silently ignored, with no user-facing warning or consent mechanism in this file. In a search-oriented skill context, hidden network activity is more suspicious because it is not necessary to fulfill the advertised function and prevents informed user choice.
The natural-language strings throughout the CLI, including the command description, argument help, and output messages, are exclusively in Chinese, with no indication that users may select another language. Under the policy, forcing a specific language without opt-in is a natural-language policy violation unless clearly documented and justified.
The function transmits the provided API key in a network request to the configured Gateway endpoint. Although the docstring describes the mechanism, there is no explicit user-facing warning, confirmation, or visible disclosure that the credential will be sent over HTTP to a service endpoint.
This code creates the configuration directory and writes the provided API key to disk, which affects user data and stores a credential persistently. In this file there is no confirmation prompt, logging/print disclosure, or comment/docstring clearly warning the user that the key will be written to the config file.
All user-facing guidance and quoted agent output are specified only in Chinese, including the exact prompt the agent should send. This can violate language/locale policy when no user opt-in or explicit region-specific justification is provided.
The manifest describes a basic招投标搜索 skill, for which signed API requests are expected. However, this module goes beyond simple request signing by reading API credentials from a local gateway config file as a fallback, which is a broader local-secret access capability than the stated search purpose suggests. This is not an obvious requirement of 'basic search' from the manifest text alone.
The module docstring is entirely in Chinese and does not indicate that language choice is configurable or intentionally limited to a Chinese-only audience. Per the policy, forcing a specific language without user opt-in or documented justification is a natural-language policy concern.