Back to skill

Security audit

云主机询价小能手

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent cloud price-comparison purpose, but it handles cloud credentials unsafely and disables TLS verification for authenticated Baidu API calls.

Review before installing. Use only least-privilege, read-only pricing credentials, avoid pasting long-lived secrets into chat or command lines, rotate any keys already used that way, and do not rely on Baidu results until TLS verification is fixed. Treat traffic-based bandwidth output and sold-out fallback behavior as potentially inconsistent with the documented prepaid-only promise.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/compare_price.py:399
Finding

Authenticated Baidu Cloud API Requests Disable TLS Certificate Verification

Content
View full analysis

Vulnerability Details

File Location: scripts/compare_price.py:399-414
Vulnerability Type: Improper TLS certificate validation
Risk Level: High

Vulnerable Code

python
def _bcc_http_post(host, path, payload, ak, sk):
    """向百度云发起签名 POST,返回解析后的 JSON"""
    timestamp = datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ")
    headers = {
        "Host": host,
        "Content-Type": "application/json;charset=utf-8",
        "Authorization": _bcc_sign("POST", path, timestamp, ak, sk, host),
    }
    req = urllib.request.Request(
        f"https://{host}{path}",
        data=json.dumps(payload).encode(),
        headers=headers,
        method="POST",
    )
    ctx = ssl._create_unverified_context()
    return json.loads(urllib.request.urlopen(req, timeout=15, context=ctx).read().decode())

Technical Analysis

The function explicitly creates an unverified TLS context with ssl._create_unverified_context(). This disables certificate-chain and hostname validation for all signed Baidu BCC, CDS, and EIP pricing requests made through this function.

Although HTTPS is used, the client cannot authenticate the remote server when verification is disabled. An attacker capable of controlling DNS resolution, a proxy, the local network, or another point along the network path can present an arbitrary certificate and establish a man-in-the-middle connection.

Requests include a BCE Authorization header generated from the access-key identifier, timestamp, host, method, and request path. The authorization value uses a one-hour validity period. The signing implementation does not bind the JSON request body into the canonical request:

python
canonical_request = f"{method}\n{canonical_uri}\n\n{canonical_headers}"

A network attacker could therefore capture the authorization material, inspect request parameters, manipulate returned pricing data, and potentially replay a captured ...[truncated 1558 chars]

Remediation
View remediation

Remediation Suggestions

Remove the unverified SSL context and rely on Python's verified default context:

python
return json.loads(
    urllib.request.urlopen(req, timeout=15).read().decode()
)

If an explicit context is required, use the platform trust store while retaining certificate and hostname validation:

python
ctx = ssl.create_default_context()
return json.loads(
    urllib.request.urlopen(req, timeout=15, context=ctx).read().decode()
)

Additional hardening should include:

  1. Never set check_hostname to False or verify_mode to CERT_NONE.
  2. Fail closed on certificate validation errors rather than retrying insecurely.
  3. Ensure the runtime trust store is current.
  4. If supported by the Baidu signing protocol, bind a digest of the request body into the signature.
  5. Reduce authorization validity from one hour where protocol configuration permits.
  6. Use cloud credentials restricted to the minimum read-only pricing permissions.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:47
Finding

Cloud Secret Keys Are Passed Through Command-Line Arguments

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:47-58
Vulnerability Type: Exposure of credentials through process arguments and shell history
Risk Level: Medium

Vulnerable Instructions

bash
{baseDir}/../alicloud_ecs_price-1.0.0/scripts/setup.sh --ak "<AK>" --sk "<SK>" --region "cn-beijing"
bash
{baseDir}/../baidu-bcc-price-1.0.1/scripts/setup.sh --ak "<AK>" --sk "<SK>" --region "bcc.bj.baidubce.com"

Technical Analysis

The Skill instructs users to place Alibaba Cloud and Baidu Cloud secret keys directly in command-line arguments. Command-line secrets can be exposed through:

  • Shell history files
  • Process listings and process inspection interfaces
  • Terminal session recording
  • Endpoint monitoring or audit agents
  • Debug logs and command telemetry
  • Copied terminal transcripts

The referenced setup scripts are external to this audited project and were not available for inspection. Consequently, their storage permissions and subsequent secret handling could not be verified. The confirmed issue is that this Skill's documented invocation exposes credentials before those scripts process them.

Reading credentials from the two fixed configuration paths in scripts/compare_price.py is consistent with the declared pricing functionality and does not independently exceed the required privilege scope. The unsafe element is the documented method used to provision those files.

Attack Path

  1. A user follows the documented setup command and substitutes real access and secret keys.
  2. The shell records the complete command in its history, or local process-monitoring software captures the process arguments.
  3. A local user, support operator, monitoring service, malware process, or later recipient of a terminal transcript obtains the command.
  4. The attacker extracts the access key and secret key.
  5. The attacker authenticates to the corresponding cloud pr ...[truncated 664 chars]
Remediation
View remediation

Remediation Suggestions

Do not accept secret keys through command-line options. Modify the setup process to use one of the following approaches:

  1. Prompt for the secret interactively with terminal echo disabled.
  2. Read the secret from standard input.
  3. Integrate with the provider's supported credential manager or operating-system keychain.
  4. Accept a path to a permission-restricted credential file rather than the secret itself.
  5. Use short-lived credentials or role-based identity where available.

Credential files should be created atomically with owner-only permissions, such as mode 0600, and parent directories should not be accessible to unrelated users. Setup scripts must avoid logging, echoing, or including secrets in error messages.

Documentation should also require cloud identities restricted to the minimum read-only pricing permissions. Existing credentials provisioned through command-line arguments should be removed from shell history, rotated, and reviewed for unauthorized use.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (16)

Tainted flow: 'req' from os.environ.get (line 407, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/compare_price.py (reported line 414)May include surrounding context.

python
method="POST",
    )
    ctx = ssl._create_unverified_context()
    return json.loads(urllib.request.urlopen(req, timeout=15, context=ctx).read().decode())


def query_bcc_prices(ak, sk, bcc_host, bcc_spec, bcc_zone, bcc_disk_display, disk_size, bandwidth, bandwidth_type):

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The code substantially overlaps with the declared domain and primary purpose: it compares Alibaba ECS and Baidu BCC prices for regions, instance families/specs, disks, and bandwidth, and focuses mainly on prepaid 1-month pricing. However, several material parts of the description are not actually implemented. Most importantly, the declared smart matching from CPU core count, memory size, and inferred processor characteristics is absent; the script only supports either direct spec input or a simple family+vCPU mapping with fixed memory ratios. The description promises support for matching specs outside the documented catalog via inference from CPU frequency/turbo/CPU/memory, but no such logic exists. It also promises that if the Alibaba spec is sold out, the tool will automatically fall back to an older generation and explain it; the code merely flags sold-out errors and prints a notice, without retry/fallback logic. Additionally, the script accepts ByTraffic pricing and outputs per-GB values, which is not consistent with the strict claim to forbid outputting anything other than prepaid 1-month pricing. These are substantive behavior-description gaps, so this should be flagged as a mismatch.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill explicitly directs the agent to collect and handle raw cloud credentials for later command execution. In an agent context, this is especially dangerous because secrets may be retained in transcripts, tool logs, process listings, or shell history, and compromise would grant direct access to cloud resources and billing-sensitive APIs.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/compare_price.py (reported line 8)May include surrounding context.

python
凭证来源(优先级:环境变量 > 配置文件):
  阿里云: ALICLOUD_ACCESS_KEY_ID / ALICLOUD_ACCESS_KEY_SECRET
         或 ~/.config/openclaw/alicloud-ecs-price/credentials.json
  百度云: BCE_ACCESS_KEY_ID / BCE_SECRET_ACCESS_KEY / BCE_BCC_REGION
         或 ~/.config/openclaw/baidu-bcc-price/credentials.json

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/compare_price.py (reported line 10)May include surrounding context.

python
凭证来源(优先级:环境变量 > 配置文件):
  阿里云: ALICLOUD_ACCESS_KEY_ID / ALICLOUD_ACCESS_KEY_SECRET
         或 ~/.config/openclaw/alicloud-ecs-price/credentials.json
  百度云: BCE_ACCESS_KEY_ID / BCE_SECRET_ACCESS_KEY / BCE_BCC_REGION
         或 ~/.config/openclaw/baidu-bcc-price/credentials.json

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/compare_price.py (reported line 48)May include surrounding context.

python
凭证来源(优先级:环境变量 > 配置文件):
  阿里云: ALICLOUD_ACCESS_KEY_ID / ALICLOUD_ACCESS_KEY_SECRET
         或 ~/.config/openclaw/alicloud-ecs-price/credentials.json
  百度云: BCE_ACCESS_KEY_ID / BCE_SECRET_ACCESS_KEY / BCE_BCC_REGION
         或 ~/.config/openclaw/baidu-bcc-price/credentials.json

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/compare_price.py (reported line 49)May include surrounding context.

python
凭证来源(优先级:环境变量 > 配置文件):
  阿里云: ALICLOUD_ACCESS_KEY_ID / ALICLOUD_ACCESS_KEY_SECRET
         或 ~/.config/openclaw/alicloud-ecs-price/credentials.json
  百度云: BCE_ACCESS_KEY_ID / BCE_SECRET_ACCESS_KEY / BCE_BCC_REGION
         或 ~/.config/openclaw/baidu-bcc-price/credentials.json

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill description explicitly forbids outputting anything other than prepaid 1-month pricing, but this branch returns Alibaba traffic-based bandwidth pricing per GB. That creates a trust/integrity flaw: users may act on pricing the tool claims it must never provide, leading to incorrect procurement decisions or cost misrepresentation.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The code uses ssl._create_unverified_context(), which disables HTTPS certificate validation for signed Baidu API requests. In a credentialed cloud-pricing tool, this materially increases the risk of man-in-the-middle interception or response tampering, potentially exposing access keys in authenticated traffic and allowing falsified pricing responses.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

This code queries and returns Baidu postpaid traffic pricing even though the skill contract says non-prepaid-1-month prices must never be output. That mismatch is dangerous because it undermines output integrity and can mislead users into relying on pricing outside the permitted scope.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill instructs the agent to execute shell and Python commands, read adjacent files, and call cloud pricing APIs, yet it does not declare any explicit tool scope or allowed-tools restrictions. This creates an overbroad execution surface where an agent may use environment, file, and network capabilities without clear policy boundaries, increasing the chance of unintended data access or network use.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill asks users to paste raw Alibaba and Baidu cloud access keys directly into the conversation and then into shell commands, but gives no warning about secret sensitivity or safe handling. This encourages exposure of long-lived credentials in chat logs, agent memory, shell history, or telemetry, which could enable unauthorized access to the user's cloud account.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest says that if the Alibaba corresponding instance is sold out, the skill should downgrade to an older generation and explain it. Here the code merely sets a sold_out flag when certain errors appear and later prints a sold-out notice, with no automatic fallback spec selection or replacement query.

Content

No source excerpt is available for this finding.

Dynamic Request Target

Medium
Category
Server-Side Request Forgery
Confidence
60% confidence
Finding

Request target host is built from a dynamic or untrusted value. If the host is attacker-influenced, this enables SSRF to arbitrary internal or metadata endpoints.

Content

Scanner excerpt · scripts/compare_price.py (reported line 407)May include surrounding context.

python
"Content-Type": "application/json;charset=utf-8",
        "Authorization": _bcc_sign("POST", path, timestamp, ak, sk, host),
    }
    req = urllib.request.Request(
        f"https://{host}{path}",
        data=json.dumps(payload).encode(),
        headers=headers,

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The manifest claims users can input CPU core count, memory size, disk specs, bandwidth, region, and get intelligent matching including undocumented specs inferred from CPU frequency/turbo/CPU/memory. The code only supports either predefined family+vcpu mapping or direct explicit specs, and accepts no memory or processor-frequency inference inputs, so the described intelligent matching behavior is not actually implemented.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The natural-language docstring, CLI help text, and user-facing output are written exclusively in Chinese, which imposes a specific language choice on users. The file does not offer an alternative language option or document a justified region-specific constraint.

Content

No source excerpt is available for this finding.