T09 · Insecure Skill Coding Practices
- Location
scripts/capabilities/configure/service.py:35- Finding
Configurable Gateway Endpoint Can Exfiltrate AK and Gateway Bearer Credentials
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill mostly matches a merchant reception assistant, but it handles credentials and business-changing automation with unsafe or under-scoped controls that need review before installation.
Install only after reviewing the credential and business-change controls. Treat the AK as a secret, avoid passing it on the command line, ensure local config files are protected, verify the gateway URL cannot be redirected, and confirm that cloud knowledge sync and answer persistence match your privacy expectations.
scripts/capabilities/configure/service.py:35Configurable Gateway Endpoint Can Exfiltrate AK and Gateway Bearer Credentials
scripts/capabilities/configure/cmd.py:61AK Is Exposed Through Process Arguments, Confirmation Output, and Insecure Plaintext Storage
scripts/_risk_guard.py:31Confirmation Payload Is Trusted Without Authenticity, Ownership, or Replay Validation
requirements.txt:1Dependency Is Not Pinned or Integrity-Verified
The code builds a configuration endpoint URL from the untrusted OPENCLAW_GATEWAY_URL environment variable and then sends the API key to that destination, optionally with a bearer token. If an attacker can influence the environment, they can redirect the request to an attacker-controlled host and exfiltrate credentials, making this an SSRF-style secret-leak issue rather than a harmless configurable endpoint.
headers = {}
if token:
headers["Authorization"] = "Bearer {}".format(token)
resp = requests.patch("{}/api/config".format(gateway_url),
headers=headers, json=payload, timeout=5)
return resp.ok
except Exception:
Direct reading and writing of local configuration plus checking environment-stored credentials is a powerful capability for a merchant-facing assistant. When not clearly scoped in the manifest, this creates a hidden privileged surface that could be abused to alter platform configuration or expose sensitive operational state if other safeguards fail.
Direct reading and writing of local configuration plus checking environment-stored credentials is a powerful capability for a merchant-facing assistant. When not clearly scoped in the manifest, this creates a hidden privileged surface that could be abused to alter platform configuration or expose sensitive operational state if other safeguards fail.
Direct reading and writing of local configuration plus checking environment-stored credentials is a powerful capability for a merchant-facing assistant. When not clearly scoped in the manifest, this creates a hidden privileged surface that could be abused to alter platform configuration or expose sensitive operational state if other safeguards fail.
Direct reading and writing of local configuration plus checking environment-stored credentials is a powerful capability for a merchant-facing assistant. When not clearly scoped in the manifest, this creates a hidden privileged surface that could be abused to alter platform configuration or expose sensitive operational state if other safeguards fail.
Direct reading and writing of local configuration plus checking environment-stored credentials is a powerful capability for a merchant-facing assistant. When not clearly scoped in the manifest, this creates a hidden privileged surface that could be abused to alter platform configuration or expose sensitive operational state if other safeguards fail.
Direct reading and writing of local configuration plus checking environment-stored credentials is a powerful capability for a merchant-facing assistant. When not clearly scoped in the manifest, this creates a hidden privileged surface that could be abused to alter platform configuration or expose sensitive operational state if other safeguards fail.
Direct reading and writing of local configuration plus checking environment-stored credentials is a powerful capability for a merchant-facing assistant. When not clearly scoped in the manifest, this creates a hidden privileged surface that could be abused to alter platform configuration or expose sensitive operational state if other safeguards fail.
Direct reading and writing of local configuration plus checking environment-stored credentials is a powerful capability for a merchant-facing assistant. When not clearly scoped in the manifest, this creates a hidden privileged surface that could be abused to alter platform configuration or expose sensitive operational state if other safeguards fail.
Direct reading and writing of local configuration plus checking environment-stored credentials is a powerful capability for a merchant-facing assistant. When not clearly scoped in the manifest, this creates a hidden privileged surface that could be abused to alter platform configuration or expose sensitive operational state if other safeguards fail.
Direct reading and writing of local configuration plus checking environment-stored credentials is a powerful capability for a merchant-facing assistant. When not clearly scoped in the manifest, this creates a hidden privileged surface that could be abused to alter platform configuration or expose sensitive operational state if other safeguards fail.
Direct reading and writing of local configuration plus checking environment-stored credentials is a powerful capability for a merchant-facing assistant. When not clearly scoped in the manifest, this creates a hidden privileged surface that could be abused to alter platform configuration or expose sensitive operational state if other safeguards fail.
This file explicitly states that local folder contents are automatically parsed and synchronized to a cloud knowledge base (OSS), but it does not present any privacy, sensitivity, or transmission warning at the point of description. In the context of local absolute paths and broad file-type support, users may unknowingly upload confidential business documents, creating a real risk of unintended data disclosure to remote storage.
The workflow says that after a folder path is added, cloud synchronization starts automatically, yet there is no explicit warning or consent checkpoint before ongoing upload begins. Because the content comes from a local folder and may continue syncing over time, this increases the chance of silently transmitting newly added sensitive files without the user fully understanding the privacy impact.
This file implements AK credential configuration logic, including validation, confirmation, and persistent write paths, which is unrelated to the stated customer-service assistant purpose. A skill that exposes credential-management behavior outside its declared scope increases the attack surface and can be abused through prompt injection or operator confusion to overwrite platform secrets, especially because the skill metadata gives no justification for handling authentication material.
The code can write a sensitive AK via gateway or file fallback, creating a secret-modification primitive inside a business assistant skill that should not manage credentials. Even though it includes a confirmation flow and masking, the dangerous part is the presence of credential write capability itself: if invoked in the wrong context, it could replace valid credentials with attacker-controlled ones, causing account compromise, service redirection, or denial of service.
The manifest does not declare an explicit tool/permission scope even though the skill clearly contemplates environment access, local file access, and networked CLI operations. Without least-privilege boundaries, an orchestrator may expose more capability than the merchant-facing workflow actually needs, increasing blast radius if the agent is prompt-injected or misrouted.
The trigger list includes very broad phrases such as '接待', '培训', and '知识库', which can cause accidental activation from ordinary conversation. Over-broad invocation increases the chance of the wrong skill taking control, exposing business data, launching workflows, or opening management pages when the user intended something else.
Defaulting vague requests like '知识库' or '学一下' into a specific knowledge-query branch is an ambiguous fallback that may expose operational data or steer the merchant into unintended management flows. Ambiguous routing is especially risky here because the skill can access reports, knowledge artifacts, and management UI entry points.
Comments and documentation claim the whitelist restricts exposure to only current public CLI abilities, but the actual list contains an extra undocumented command. This mismatch is security-relevant because operators and reviewers may trust the documentation while an additional callable path remains available.
The CLI whitelist includes cowboy_config, which is not documented in the declared public capabilities and contradicts the stated intent that only SKILL.md-asserted abilities are exposed. Undocumented entry points increase attack surface and can enable unauthorized or unreviewed behavior, especially because the module is dynamically discovered and imported at runtime.
The CLI performs silent usage tracking via _tracker.report_skill_usage() without any user notice, consent, or visible disclosure. In a business assistant context, telemetry may include sensitive operational usage patterns or metadata, creating privacy, compliance, and trust risks if collected unexpectedly.
The documentation instructs users to view or set an AK credential and explicitly allows fallback storage in a local config file, but it does not warn that the AK is a sensitive secret, should be protected with restrictive file permissions, and should not be shared, logged, or committed. In a skill that manages authentication for gateway access, this omission increases the chance of credential exposure through insecure storage practices, especially on shared workstations or in synced home directories.
The skill explicitly states that submitted answers are automatically written to a cloud knowledge base and then reused in future customer interactions, but it does not require a clear user-facing warning about persistence, scope, or downstream effects. In this business context, an operator may unknowingly store sensitive, inaccurate, or policy-violating content that will later be surfaced automatically to buyers, creating data governance and integrity risk.
The usage section lists activation cues such as “评分”, “掌握度”, and “完善度” without narrowing context or providing exclusion conditions. These terms are generic and could overlap with routine discussion, making it unclear when this skill should activate versus when the user is asking a broader question.