T09 · Insecure Skill Coding Practices
- Location
scripts/capabilities/configure/cmd.py:39- Finding
Access Key Exposed Through Command-Line Arguments
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly matches a 1688 customer-operations tool, but its Access Key setup can expose credentials through unsafe command-line, file, and gateway handling.
Review this skill before installing. It can read customer and buyer-operation data and can activate a Wangwang marketing plan after confirmation. Do not paste production Access Keys into chat or command lines unless you accept that exposure risk; prefer a platform-managed secret flow. Only use the gateway configuration path when OPENCLAW_GATEWAY_URL is trusted and local or otherwise explicitly approved, and check permissions on any openclaw.json file that stores credentials.
scripts/capabilities/configure/cmd.py:39Access Key Exposed Through Command-Line Arguments
scripts/capabilities/configure/service.py:28Unrestricted Gateway URL Can Receive the Access Key and Gateway Bearer Token
scripts/capabilities/configure/service.py:59Plaintext Access Key Stored Without Explicit Permission Hardening
The code takes OPENCLAW_GATEWAY_URL directly from the environment and sends the supplied API key to that URL with no allowlist, scheme validation, or host verification. If an attacker can influence the environment, they can redirect credential-bearing requests to an attacker-controlled endpoint and exfiltrate the API key and optional bearer token.
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:
AK validation and writing configuration locally or via REST gateway materially expand the trust model of the skill beyond passive customer analysis. In a business environment, hidden secret handling plus network communication can enable account misuse or lateral data exposure if the skill is misconfigured or compromised.
AK validation and writing configuration locally or via REST gateway materially expand the trust model of the skill beyond passive customer analysis. In a business environment, hidden secret handling plus network communication can enable account misuse or lateral data exposure if the skill is misconfigured or compromised.
AK validation and writing configuration locally or via REST gateway materially expand the trust model of the skill beyond passive customer analysis. In a business environment, hidden secret handling plus network communication can enable account misuse or lateral data exposure if the skill is misconfigured or compromised.
AK validation and writing configuration locally or via REST gateway materially expand the trust model of the skill beyond passive customer analysis. In a business environment, hidden secret handling plus network communication can enable account misuse or lateral data exposure if the skill is misconfigured or compromised.
AK validation and writing configuration locally or via REST gateway materially expand the trust model of the skill beyond passive customer analysis. In a business environment, hidden secret handling plus network communication can enable account misuse or lateral data exposure if the skill is misconfigured or compromised.
AK validation and writing configuration locally or via REST gateway materially expand the trust model of the skill beyond passive customer analysis. In a business environment, hidden secret handling plus network communication can enable account misuse or lateral data exposure if the skill is misconfigured or compromised.
AK validation and writing configuration locally or via REST gateway materially expand the trust model of the skill beyond passive customer analysis. In a business environment, hidden secret handling plus network communication can enable account misuse or lateral data exposure if the skill is misconfigured or compromised.
AK validation and writing configuration locally or via REST gateway materially expand the trust model of the skill beyond passive customer analysis. In a business environment, hidden secret handling plus network communication can enable account misuse or lateral data exposure if the skill is misconfigured or compromised.
AK validation and writing configuration locally or via REST gateway materially expand the trust model of the skill beyond passive customer analysis. In a business environment, hidden secret handling plus network communication can enable account misuse or lateral data exposure if the skill is misconfigured or compromised.
Referenced artifact was not completely inspected
CLI 入口文件:`{baseDir}/cli.py`(`{baseDir}` = skill 根目录,含 `SKILL.md` 和 `cli.py`)。**禁止** `{baseDir}/scripts/cli.py`——`cli.py` 不在 `scripts/` 子目录。
该处明确要求所有用户可见输出必须100%使用中文,并禁止任何英文表述,这是明显的语言/locale 强制策略。文档中未说明这是仅适用于特定地区合规场景,也未向用户提供语言选择或显式同意机制,因此构成自然语言政策违规。
The configuration guide is for DingTalk message-sending AK setup, which is unrelated to the declared 1688 customer-operation skill. This capability mismatch is dangerous because it can mislead users into granting credentials for an unstated channel, expanding the skill’s effective privileges and creating a path for unauthorized messaging or data exfiltration under a misleading cover story.
The guide tells users to paste an Access Key into chat and then pass it as a command-line argument, exposing the secret in conversation history, logs, shell history, and process listings. This creates a direct credential leakage risk that could allow anyone with access to transcripts or host telemetry to reuse the key for unauthorized API actions.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
职责:每次 CLI 命令执行时,向 skill 网关上报一次调用记录,用于统计 skill 调用次数。
上报失败不影响主流程,静默处理。
环境变量(从项目根目录 .env 读取):
SKILL_NAME skill 名称,默认 1688-open-skill-template
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 名称,默认 1688-open-skill-template
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 名称,默认 1688-open-skill-template
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:
This skill is described as a customer follow-up and operations tool, but the file implements credential discovery and storage, including reading existing secrets from environment/config and writing API keys to persistent config. That mismatch is dangerous because users or calling systems may grant or execute the skill under assumptions unrelated to secret handling, enabling unnecessary access to credentials and increasing the blast radius if the skill is abused or compromised.
The skill declares broad operational behavior and references capabilities that imply file, environment, and network access, but it does not define an explicit tool/permission scope. Without least-privilege restrictions, a host agent may grant more access than is necessary, increasing the blast radius if the skill logic is abused or compromised.
Overly broad trigger phrases can cause the skill to activate in conversations that were not intended to invoke customer-data operations. In this skill context, accidental triggering is more dangerous because the documented flows can query buyer details, profiles, and recommendations, increasing the risk of unnecessary data access or unintended outbound actions.
The 'key customer direct query' trigger set contains broad business phrases that may match ordinary discussion rather than an explicit request to run the skill. Because this skill can pivot into customer segmentation and follow-up analysis, accidental activation can expose sensitive buyer insights without clear user intent.
The workflow instructs the agent to use list_customer_details and customer_crowd_analysis even though those capabilities are not consistently declared in the skill's stated scope. This kind of scope drift can bypass reviewer expectations and cause the agent to invoke extra data-access paths that were not approved as part of the advertised functionality.
Usage tracking is triggered after every command with no visible notice, consent flow, or configuration gate in this file. In a customer-operations skill that may process buyer identities and business activity, hidden telemetry increases privacy risk and could leak commercially sensitive usage context if the tracker captures command names, timing, or arguments.
The file is entirely written as an operational instruction in Chinese, beginning with the core activation description, and it does not offer any language choice or note that the skill is region/language-specific. Under the policy criteria, forcing a specific language without user opt-in is a natural-language locale violation.