Back to skill

Security audit

1688 Cowboy

Security checks for vulnerabilities and agentic risk

Overview

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.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (4)

T09 · Insecure Skill Coding Practices

Error
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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/capabilities/configure/cmd.py:61
Finding

AK Is Exposed Through Process Arguments, Confirmation Output, and Insecure Plaintext Storage

Content
View full analysis
{}\n".format( json.dumps(confirm_obj, ensure_ascii=False) )) sys.stdout.flush() ``` The fallback stores the AK as plaintext without explicitly applying restrictive permissions: ```python skill_entry["apiKey"] = api_key CONFIG_PATH.parent.mkdir(parents=True, exist_ok=True) with open(CONFIG_PATH, "w", encoding="utf-8") as f: json.dump(config, f, ensure_ascii=False, indent=2) ``` ### Technical Analysis The AK is exposed across three separate channels: 1. **Process argument exposure**: Supplying the AK as `cli.py configure YOUR_AK` places it in the operating-system process argument list. Depending on platform configuration, local users, monitoring agents, shell history, audit systems, and process supervisors may capture it. 2. **Standard-output exposure**: Although the human-readable preview masks the AK, the internal `` marker contains `payload={"ak": ak}` and is printed as plaintext. Framework logs or command-output capture can therefore retain the complete credential. 3. **Filesystem exposure**: The fallback writes the AK into `openclaw.json` as plaintext. The code neither sets a restrictive creation mode nor checks or repairs permissions on an existing file. Effective ...[truncated 1534 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/_risk_guard.py:31
Finding

Confirmation Payload Is Trusted Without Authenticity, Ownership, or Replay Validation

Content
View full analysis
Optional[Dict[str, Any]]: payload_file = os.environ.get(_CONFIRM_ENV, "").strip() if not payload_file: return None try: with open(payload_file, "r", encoding="utf-8") as f: data = json.load(f) if isinstance(data, dict): return data except Exception: return None return None ``` The configuration command subsequently treats values from this payload as authoritative: ```python payload = get_confirmed_payload() if payload is None: ... return ak = (payload.get("ak") or "").strip() ... _do_write(ak) ``` ### Technical Analysis The confirmation mechanism assumes that the presence of `NEWTON_CONFIRM_PAYLOAD` proves that a user approved the operation. However, the referenced file is accepted without checking: - A cryptographic signature or message authentication code. - A one-time nonce. - Expiration time. - Binding to the command, user, session, or original parameters. - File ownership or restrictive permissions. - Whether the file has already been consumed. - Whether the path points to a regular, non-symlink file. Any caller able to set the environment variable and create a JSON file can fabricate a Phase 2 payload. The Skill code therefore does not independently enforce the stated guarantee that the user must explicitly approve credential or state-changing operations. ### Attack Path 1. An attacker or compromised automation creates a JSON file containing an attacker-selected AK: ```json {"ak": "ATTACKER_CONTROLLED_VALID_AK_VALUE"} ``` 2. The attacker sets `NEWTON_CONFIRM_PAYLOAD` to that file's path. 3. The configuration command is invoked with any nonempty positional argument so that it reaches the write bran ...[truncated 1052 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Dependency Is Not Pinned or Integrity-Verified

Content
View full analysis
=2.28.0 ``` ### Technical Analysis The dependency declaration permits installation of any current or future `requests` version at or above 2.28.0. No lock file, exact version, package hash, or trusted-index constraint is present. This does not prove that the current `requests` package is malicious. However, it makes installations non-reproducible and allows the effective dependency code to change after the Skill package has been reviewed. A compromised future release, compromised package-index account, malicious mirror, or incompatible major release could be installed automatically. Because `requests` processes AK-authenticated gateway traffic and configuration credentials, compromise of this dependency would affect a security-sensitive execution path. ### Attack Path 1. The Skill is installed or rebuilt at a later date. 2. The package installer resolves the newest version satisfying `requests>=2.28.0`. 3. A compromised release, untrusted mirror response, or unexpectedly incompatible version is selected. 4. The installed package executes inside the Skill process. 5. Malicious dependency code can inspect request bodies, authentication headers, environment variables, and local configuration files. ### Impact Assessment A compromised dependency executes with the same operating-system privileges as the Skill. It could access the AK, gateway bearer token, merchant data returned by APIs, and files available to the process. The risk is currently prospective rather than evidence of an active malicious package, so the severity is Low. ]]>
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (65)

Tainted flow: 'gateway_url' from os.environ.get (line 35, credential/environment) → requests.patch (network output)

Critical
Category
Data Flow
Confidence
95% confidence
Finding

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.

Content

Scanner excerpt · scripts/capabilities/configure/service.py (reported line 52)May include surrounding context.

python
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:

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

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.

Content

No source excerpt is available for this finding.