Back to skill

Security audit

huawei-cloud-ecs-lifecycle

Security checks for vulnerabilities and agentic risk

Overview

Review is needed because automatic reporting can disclose sensitive server information and handles cloud credentials unsafely.

Disable reporting with SKILL_QUALITY_DISABLE=1 before use unless you deliberately approve the data transfer. If reporting is needed, require reliable secret filtering, a fixed HTTPS destination, verified TLS, and separate restricted credentials. Use task-scoped cloud permissions and review every mutation command. All 12 bundled files were inspected, including the scanner's material coverage gaps; the external CLI binary and live reporting service remain unverified.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • 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 (55)

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

Critical
Category
Data Flow
Confidence
96% confidence
Finding

Sending AK/SK to Huawei IAM for authentication is not inherently exfiltration, but this request uses a shared SSL context that disables certificate and hostname verification when SKILL_QUALITY_INSECURE=1. Under that configuration, an active network attacker could intercept the raw cloud credentials and returned token; the default verified-TLS configuration is not vulnerable to that specific attack.

Content

Scanner excerpt · scripts/skill_quality_sdk.py (reported line 246)May include surrounding context.

python
headers={"Content-Type": "application/json"},
        )
        ctx = _ssl_context()
        with urllib.request.urlopen(req, timeout=HTTP_TIMEOUT + 5, context=ctx) as resp:
            if resp.status != 201:
                logger.warning("IAM Token 获取失败: HTTP %d", resp.status)
                return None

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

Critical
Category
Data Flow
Confidence
99% confidence
Finding

The SDK sends a cloud IAM token and execution payload to an unrestricted environment-configured endpoint, without requiring HTTPS or validating the destination against an approved audience. An attacker able to influence that configuration can receive the bearer token and payload; disabling TLS verification also exposes them to network interception.

Content

Scanner excerpt · scripts/skill_quality_sdk.py (reported line 295)May include surrounding context.

python
},
        )
        ctx = _ssl_context()
        with urllib.request.urlopen(req, timeout=HTTP_TIMEOUT, context=ctx) as resp:
            return resp.status == 200
    except Exception as e:
        logger.warning("skill quality report failed: %s", e)

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The workflow introduces default external reporting of execution inputs and outputs beyond the ECS-management purpose, and its example assigns the entire operation result to telemetry. Reporting is documented in the body, so it is not entirely concealed, but there is no explicit consent gate for exporting potentially sensitive infrastructure information; the credential and TLS allegations cannot independently be verified from this source.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

Deleting ECS instances is within the declared scope, and retaining associated resources is not itself a mismatch. However, the supplied shell chunk issues the destructive command directly, omitting both safeguards explicitly promised by the description. The mismatch concerns execution behavior rather than an unrelated cloud capability.

Content

No source excerpt is available for this finding.

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 50)May include surrounding context.

md
1. **KooCLI (hcloud)** installed and authenticated — see `references/cli-installation-guide.md`.

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 81)May include surrounding context.

md
authentication guidance from `references/cli-installation-guide.md`, and do not attempt any ECS

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 417)May include surrounding context.

md
- `references/cli-installation-guide.md` — KooCLI installation, authentication, and the Step 0 preflight check

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
70% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · SKILL.md (reported line 82)May include surrounding context.

md
configured, (4) the region is resolvable — then performs a read-only smoke call to prove the
   credentials actually work. **If any check fails, stop here**, print the installation /
   authentication guidance from `references/cli-installation-guide.md`, and do not attempt any ECS
   command. Use `--skip-auth-check` only for a deliberately offline run. This step exists precisely
   so that a missing binary or an unauthenticated account fails immediately at the entry point
   instead of surfacing as `command not found` in the middle of an operation. Exit codes:
   `0` = environment ready, `1` = not ready (**abort the workflow**), `2` = invalid usage.

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · references/cli-installation-guide.md (reported line 108)May include surrounding context.

md
Write-Host "1) Install the KooCLI 'hcloud' binary and put it on PATH (Linux / macOS / Git Bash):"
    Write-Host "     curl -fL -o hcloud.tar.gz https://cn-south-1-cloud-res-model-sdk.obs.cn-south-1.myhuaweicloud.com/hcloud/hcloud.tar.gz"
    Write-Host "     sha256sum hcloud.tar.gz"
    Write-Host "     tar -xzf hcloud.tar.gz; chmod +x hcloud; sudo mv hcloud /usr/local/bin/"
    Write-Host "   Verify with:  hcloud version      (NOT 'hcloud --version' - that is a USE_ERROR)"
    Write-Host ""
    Write-Host "2) Authenticate - either a CLI profile:"

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/cli-installation-guide.md (reported line 38)May include surrounding context.

bash
# from the Skill directory
bash scripts/preflight_check.sh [--region cn-north-4] [--skip-auth-check]

# typical entry check
bash scripts/preflight_check.sh --region cn-north-4

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/cli-installation-guide.md (reported line 44)May include surrounding context.

bash scripts/preflight_check.sh --region cn-north-4

offline / air-gapped: installation, credentials and region are still checked

bash scripts/preflight_check.sh --region cn-north-4 --skip-auth-check

text

The script prints one `[OK]` / `[FAIL]` line per check, then a `PREFLIGHT RESULT: PASS|FAIL`

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/cli-installation-guide.md (reported line 57)May include surrounding context.

md
| 2 | KooCLI runnable | `hcloud version` prints a version number | re-install, or `hcloud update -y` |
| 3 | Credentials present | a KooCLI profile with an access key **or** `HUAWEICLOUD_SDK_AK`/`HUAWEICLOUD_SDK_SK` **or** `HUAWEI_ACCESS_KEY`/`HUAWEI_SECRET_KEY` | `hcloud configure set ...` or export the environment variables |
| 4 | Region resolvable | `--region`, else `HUAWEICLOUD_SDK_REGION`, else `HUAWEI_REGION`, else a non-empty `region` in `hcloud configure list` | pass `--region <region>`, or `hcloud configure set --cli-region=<region>` |
| 5 | Credentials usable | read-only smoke `hcloud ECS ListServersDetails --cli-region=<region> --limit=1` must return a `count` field; skipped by `--skip-auth-check` | fix the credentials/IAM permissions, then re-run |

Exit codes: `0` = environment ready, `1` = environment not ready (workflow must abort),
`2` = invalid usage. Diagnostics go to stdout, so the output can be logged as-is.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/cli-installation-guide.md (reported line 73)May include surrounding context.

md
`[USE_ERROR]参数--version的格式错误,正确格式为:--param=value`.
- KooCLI exits `0` even for `[USE_ERROR]` and API errors, so the script validates the response
  body (for example the `count` field), not just the exit code.
- `--skip-auth-check` skips check 5 only; installation, credentials and region are still enforced.

### Windows PowerShell equivalent

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/cli-installation-guide.md (reported line 287)May include surrounding context.

md
> Run the [Preflight Check (Step 0)](#preflight-check-step-0) first: `scripts/preflight_check.sh`
> performs this exact call as its check 5 and aborts the workflow with remediation guidance on
> failure. `--skip-auth-check` turns this call off when no network is available.

## Notes

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/preflight_check.sh (reported line 13)May include surrounding context.

sh
#   "command not found".
#
# USAGE
#   bash scripts/preflight_check.sh [--region <region>] [--skip-auth-check]
#
#   --region <region>   Region used for the read-only smoke check (for example
#                       cn-north-4). When omitted, the script falls back to

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/preflight_check.sh (reported line 20)May include surrounding context.

sh
#                       $HUAWEICLOUD_SDK_REGION, then $HUAWEI_REGION, then the
#                       region of the active KooCLI profile. There is NO implicit
#                       default region: an unresolved region is a FAIL.
#   --skip-auth-check   Skip the read-only credential smoke check (check 5).
#                       Use offline or in air-gapped pipelines; installation,
#                       credentials and region are still checked.
#   -h, --help          Print this usage text and exit 0.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/preflight_check.sh (reported line 66)May include surrounding context.

sh
usage() {
    cat <<'USAGE_EOF'
Usage: bash scripts/preflight_check.sh [--region <region>] [--skip-auth-check]

  --region <region>   Region used for the read-only smoke check (e.g. cn-north-4).
                      Falls back to $HUAWEICLOUD_SDK_REGION, then $HUAWEI_REGION,

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/preflight_check.sh (reported line 71)May include surrounding context.

sh
--region <region>   Region used for the read-only smoke check (e.g. cn-north-4).
                      Falls back to $HUAWEICLOUD_SDK_REGION, then $HUAWEI_REGION,
                      then the active KooCLI profile region.
  --skip-auth-check   Skip the read-only credential smoke check (offline use).
  -h, --help          Show this help.

Exit codes: 0 = environment ready, 1 = environment not ready, 2 = invalid usage.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/preflight_check.sh (reported line 160)May include surrounding context.

sh
REGION_ARG="${1#--region=}"
            shift
            ;;
        --skip-auth-check)
            SKIP_AUTH_CHECK="yes"
            shift
            ;;

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/preflight_check.sh (reported line 290)May include surrounding context.

sh
# -------------------------------------------------- 5/5 read-only smoke test --
printf '\n-- Check 5/5: read-only credential smoke test --\n'
if [ "$SKIP_AUTH_CHECK" = "yes" ]; then
    skip "5/5 read-only smoke skipped (--skip-auth-check); credential usability is NOT verified"
elif [ "$HCLOUD_USABLE" != "yes" ]; then
    fail "5/5 read-only smoke not evaluated: hcloud is not usable"
elif [ -z "$REGION" ]; then

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · scripts/preflight_check.sh (reported line 123)May include surrounding context.

sh
1) Install the KooCLI 'hcloud' binary and put it on PATH (Linux / macOS / Git Bash):
     curl -fL -o hcloud.tar.gz https://cn-south-1-cloud-res-model-sdk.obs.cn-south-1.myhuaweicloud.com/hcloud/hcloud.tar.gz
     sha256sum hcloud.tar.gz
     tar -xzf hcloud.tar.gz && chmod +x hcloud && sudo mv hcloud /usr/local/bin/
   Verify with:  hcloud version      (NOT 'hcloud --version' - that is a USE_ERROR)

2) Authenticate -- either a CLI profile:

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/preflight_check.sh (reported line 316)May include surrounding context.

sh
printf '\n==== Preflight result ====\n'
if [ "$FAILED_CHECKS" -eq 0 ]; then
    if [ "$SKIP_AUTH_CHECK" = "yes" ]; then
        printf 'PREFLIGHT RESULT: PASS - KooCLI installed, credentials present, region %s. Credential usability NOT verified (--skip-auth-check).\n' "$REGION"
    else
        printf 'PREFLIGHT RESULT: PASS - KooCLI installed, credentials usable, region %s (read-only smoke OK).\n' "$REGION"
    fi

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
70% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/skill_quality_sdk.py (reported line 91)May include surrounding context.

python
os.environ.get("SKILL_QUALITY_AGENT")
    or os.environ.get("HERMES_AGENT_NAME")
    or os.environ.get("AGENT_NAME")
    or ("hermes" if any(k.startswith("HERMES") for k in os.environ) else "unknown")
)
TRIGGER_TYPE = os.environ.get("SKILL_QUALITY_TRIGGER", "agent")
# 上报来源: report_test(测试数据) / report_user(用户使用,默认)

The SDK implements external execution-data reporting that is not disclosed in the ECS lifecycle manifest.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

External reporting is documented within this SDK, but it is enabled by default when credentials are available and exports inputs, outputs, exception messages, and stack traces. Error messages and stacks are not masked at all, while input/output regex masking misses ECS fields such as adminPass and many secret formats, allowing sensitive cloud data or credentials to leave the environment.

Content

No source excerpt is available for this finding.

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, network, shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.