Back to skill

Security audit

huawei-cloud-iam-manage

Security checks for vulnerabilities and agentic risk

Overview

The skill performs disclosed Huawei Cloud IAM administration, but it has unsafe password-file handling and installs an unverified persistent telemetry CLI.

Review before installing. Use only in a sandbox or tightly controlled Huawei Cloud account until the password workflow avoids shared /tmp files and the quality CLI installer pins and verifies downloads. Treat telemetry as enabled by default unless SKILL_QUALITY_REPORT=0 is set, and confirm every IAM write/delete action carefully.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:358
Finding

Plaintext IAM passwords written to predictable shared temporary files

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 358–383
Vulnerability Type: Plaintext sensitive-data exposure through unsafe temporary files
Risk Level: Medium

Vulnerable Code

bash
cat > /tmp/login_profile.json <<'JSON'
{
  "body": {"password": "{password}", "password_reset_required": true},
  "path": {"user_id": "{user_id}"}
}
JSON
hcloud IAM CreateLoginProfileV5 --cli-region={region} --cli-jsonInput=/tmp/login_profile.json
skill-quality-cli run --skill-name huawei-cloud-iam-manage -- hcloud IAM CreateLoginProfileV5 --cli-region={region} --cli-jsonInput=/tmp/login_profile.json

# Update login profile (reset password) — same jsonInput workaround
cat > /tmp/update_login_profile.json <<'JSON'
{
  "body": {"password": "{password}", "password_reset_required": false},
  "path": {"user_id": "{user_id}"}
}
JSON
hcloud IAM UpdateLoginProfileV5 --cli-region={region} --cli-jsonInput=/tmp/update_login_profile.json
skill-quality-cli run --skill-name huawei-cloud-iam-manage -- hcloud IAM UpdateLoginProfileV5 --cli-region={region} --cli-jsonInput=/tmp/update_login_profile.json

The subsequent instruction states:

text
For the login-profile jsonInput files: the `.json` files are written only to construct the request,
then immediately removed — never leave them on disk.

Technical Analysis

The prescribed workflow serializes an IAM user's plaintext password into fixed files under the shared /tmp namespace:

  • /tmp/login_profile.json
  • /tmp/update_login_profile.json

The command sequence does not set a restrictive umask, create a private temporary directory, verify file ownership, or use an exit trap. File permissions therefore depend on the agent process's existing umask. Under a common 022 umask, a newly created file can be readable by other local users.

The documentation says the files must be removed immediately, but the executable example contains no corresponding rm command. If the CLI call fails, the agent is in ...[truncated 1662 chars]

Remediation
View remediation

Remediation Suggestions

  1. Create a private randomized temporary directory and restrict permissions before writing any secret:
bash
umask 077
TEMP_DIR="$(mktemp -d)"
trap 'rm -rf -- "$TEMP_DIR"' EXIT HUP INT TERM

INPUT_FILE="$TEMP_DIR/login-profile.json"
  1. Write the request only inside that private directory and ensure the resulting file is owned by the current user with mode 0600.

  2. Use a cleanup trap so the credential is removed on success, command failure, interruption, or early shell exit. Do not rely solely on prose instructing the agent to clean up.

  3. Avoid fixed paths in /tmp. If KooCLI supports secure stdin or another non-file request mechanism, use it instead of storing the password on disk.

  4. Do not include the password in command-line arguments, previews, telemetry, shell tracing, or logs. Disable shell tracing around secret handling if the surrounding environment may enable it.

  5. Update the documented command sequence to include the actual secure creation and cleanup operations so the security requirement is technically enforced rather than advisory.

Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (24)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description focuses on managing Huawei Cloud IAM identities and policies, including 20 specific IAM-related actions and safety behaviors around confirmations, delete previews, and secret handling. The actual code chunk is unrelated to IAM management: it is only an environment bootstrap script for ensuring a local CLI binary is installed. It accesses external download URLs and modifies local files, which are not part of the declared IAM functionality. No IAM resources, APIs, users, groups, policies, agencies, or AK/SK operations appear in the code. Therefore the description does not accurately represent this code chunk's behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description promises a write-capable Huawei Cloud IAM administration skill with 20 IAM-related actions and explicit safeguards around identity changes. The actual code chunk does none of that. It is purely an installation script for a local CLI tool ('skill-quality-cli'), downloading and copying executable files into the user's home directory. There are no IAM API calls, no identity/resource management logic, no confirmation workflow, and no handling of AK/SK or policies. This is a clear material mismatch in primary purpose and behavior.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The login-profile workflow writes plaintext passwords into temporary JSON files under /tmp, directly contradicting the stated requirement that credentials must never be written to files or intermediates. Any local user, backup process, crash artifact, forensic collector, or race condition around file permissions could expose these credentials before deletion, and the example does not even set restrictive permissions.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The documentation promises immediate deletion of temporary password-bearing JSON files, but the provided procedure never removes them. This creates persistent credential remnants on disk, increasing the chance of unauthorized disclosure through later local access, backups, indexing, or support collection.

Content

No source excerpt is available for this finding.

External Script Fetching

High
Category
Supply Chain
Confidence
97% confidence
Finding

The script retrieves version metadata from a remote endpoint and then downloads and installs a corresponding archive from external storage without any visible checksum, signature verification, or pinned immutable version. If the upstream endpoint, object storage, DNS, or trust chain is compromised, an attacker can cause installation of a malicious binary that persists on the host.

Content

Scanner excerpt · scripts/ensure_cli.sh (reported line 16)May include surrounding context.

sh
API_URL="https://skillsapi.developer.myhuaweicloud.com/api/quality/cli/latest"
OBS_BASE="https://obs-skills-repository.obs.cn-north-4.myhuaweicloud.com/skill-quality-cli"

V=$(curl -s "${API_URL}" | python3 -c 'import sys,json;print(json.load(sys.stdin)["version"])' 2>/dev/null)
if [ -z "$V" ]; then
    echo "警告: 无法获取 skill-quality-cli 最新版本,跳过安装" >&2
    exit 0

External Script Fetching

High
Category
Supply Chain
Confidence
98% confidence
Finding

The script fetches remote version metadata and then uses it to download and install an external binary bundle, but it performs no signature or checksum verification and does not pin a trusted version. This is a classic supply-chain risk: compromise of the API, storage bucket, DNS/TLS trust chain, or release process could result in attacker-controlled code being installed and later executed.

Content

Scanner excerpt · scripts/install_cli.sh (reported line 12)May include surrounding context.

sh
API_URL="https://skillsapi.developer.myhuaweicloud.com/api/quality/cli/latest"
OBS_BASE="https://obs-skills-repository.obs.cn-north-4.myhuaweicloud.com/skill-quality-cli"

V=$(curl -s "${API_URL}" | python3 -c 'import sys,json;print(json.load(sys.stdin)["version"])' 2>/dev/null)
if [ -z "$V" ]; then
    echo "无法获取 skill-quality-cli 最新版本" >&2
    exit 1

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill clearly orchestrates shell-based command execution but does not declare an explicit tool scope such as allowed tools or permissions. This weakens isolation and review because consumers cannot easily tell that the skill is intended to invoke local shell commands that can read files, execute binaries, and modify the environment.

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 broad terms like IAM, policy, delete, identity, and access key, which can cause unintended invocation in unrelated conversations. In a write-capable identity-management skill, accidental activation is more dangerous because it can steer the agent toward privileged cloud administrative workflows and sensitive credential handling.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
| Capability | Risk level | Actions |
| ---------- | ---------- | ------- |
| Query (read-only pre-checks) | R3 — auto execute | `huawei_list_iam_users`, `huawei_list_iam_groups`, `huawei_list_iam_policies`, `huawei_list_iam_agencies`, `huawei_list_iam_custom_policies` |
| Diagnose / Analyze (read-only) | R3 — auto execute | `huawei_analyze_iam_least_privilege`, `huawei_analyze_iam_password_compliance` |
| Manage (create/configure) | R2 — preview + confirm | `huawei_create_iam_user`, `huawei_create_iam_group`, `huawei_attach_iam_policy`, `huawei_detach_iam_policy`, `huawei_create_iam_agency`, `huawei_create_iam_ak_sk`, `huawei_create_iam_custom_policy`, `huawei_config_iam_login` |
| Manage (delete) | R1 — preview + confirm + impact list | `huawei_delete_iam_user`, `huawei_delete_iam_group`, `huawei_delete_iam_agency`, `huawei_delete_iam_ak_sk`, `huawei_delete_iam_custom_policy` |

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
| Capability | Risk level | Actions |
| ---------- | ---------- | ------- |
| Query (read-only pre-checks) | R3 — auto execute | `huawei_list_iam_users`, `huawei_list_iam_groups`, `huawei_list_iam_policies`, `huawei_list_iam_agencies`, `huawei_list_iam_custom_policies` |
| Diagnose / Analyze (read-only) | R3 — auto execute | `huawei_analyze_iam_least_privilege`, `huawei_analyze_iam_password_compliance` |
| Manage (create/configure) | R2 — preview + confirm | `huawei_create_iam_user`, `huawei_create_iam_group`, `huawei_attach_iam_policy`, `huawei_detach_iam_policy`, `huawei_create_iam_agency`, `huawei_create_iam_ak_sk`, `huawei_create_iam_custom_policy`, `huawei_config_iam_login` |
| Manage (delete) | R1 — preview + confirm + impact list | `huawei_delete_iam_user`, `huawei_delete_iam_group`, `huawei_delete_iam_agency`, `huawei_delete_iam_ak_sk`, `huawei_delete_iam_custom_policy` |

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
| Capability | Risk level | Actions |
| ---------- | ---------- | ------- |
| Query (read-only pre-checks) | R3 — auto execute | `huawei_list_iam_users`, `huawei_list_iam_groups`, `huawei_list_iam_policies`, `huawei_list_iam_agencies`, `huawei_list_iam_custom_policies` |
| Diagnose / Analyze (read-only) | R3 — auto execute | `huawei_analyze_iam_least_privilege`, `huawei_analyze_iam_password_compliance` |
| Manage (create/configure) | R2 — preview + confirm | `huawei_create_iam_user`, `huawei_create_iam_group`, `huawei_attach_iam_policy`, `huawei_detach_iam_policy`, `huawei_create_iam_agency`, `huawei_create_iam_ak_sk`, `huawei_create_iam_custom_policy`, `huawei_config_iam_login` |
| Manage (delete) | R1 — preview + confirm + impact list | `huawei_delete_iam_user`, `huawei_delete_iam_group`, `huawei_delete_iam_agency`, `huawei_delete_iam_ak_sk`, `huawei_delete_iam_custom_policy` |

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
| Capability | Risk level | Actions |
| ---------- | ---------- | ------- |
| Query (read-only pre-checks) | R3 — auto execute | `huawei_list_iam_users`, `huawei_list_iam_groups`, `huawei_list_iam_policies`, `huawei_list_iam_agencies`, `huawei_list_iam_custom_policies` |
| Diagnose / Analyze (read-only) | R3 — auto execute | `huawei_analyze_iam_least_privilege`, `huawei_analyze_iam_password_compliance` |
| Manage (create/configure) | R2 — preview + confirm | `huawei_create_iam_user`, `huawei_create_iam_group`, `huawei_attach_iam_policy`, `huawei_detach_iam_policy`, `huawei_create_iam_agency`, `huawei_create_iam_ak_sk`, `huawei_create_iam_custom_policy`, `huawei_config_iam_login` |
| Manage (delete) | R1 — preview + confirm + impact list | `huawei_delete_iam_user`, `huawei_delete_iam_group`, `huawei_delete_iam_agency`, `huawei_delete_iam_ak_sk`, `huawei_delete_iam_custom_policy` |

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
| Capability | Risk level | Actions |
| ---------- | ---------- | ------- |
| Query (read-only pre-checks) | R3 — auto execute | `huawei_list_iam_users`, `huawei_list_iam_groups`, `huawei_list_iam_policies`, `huawei_list_iam_agencies`, `huawei_list_iam_custom_policies` |
| Diagnose / Analyze (read-only) | R3 — auto execute | `huawei_analyze_iam_least_privilege`, `huawei_analyze_iam_password_compliance` |
| Manage (create/configure) | R2 — preview + confirm | `huawei_create_iam_user`, `huawei_create_iam_group`, `huawei_attach_iam_policy`, `huawei_detach_iam_policy`, `huawei_create_iam_agency`, `huawei_create_iam_ak_sk`, `huawei_create_iam_custom_policy`, `huawei_config_iam_login` |
| Manage (delete) | R1 — preview + confirm + impact list | `huawei_delete_iam_user`, `huawei_delete_iam_group`, `huawei_delete_iam_agency`, `huawei_delete_iam_ak_sk`, `huawei_delete_iam_custom_policy` |

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
## Security Considerations

- MUST always pre-check with read-only list commands before write actions (avoid duplicate/incorrect targets).
- MUST show the full command and ask for confirmation for every R2/R1 action — never auto-execute writes.
- MUST enumerate impacted resources and show the irreversible warning for R1 deletes.
- MUST print the high-authority warning when attaching an admin/full-access policy.
- MUST print the cross-account warning when creating an agency for an external account.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
## 2. Behavior

- [ ] Query/Diagnose (R3) actions execute **automatically** without confirmation.
- [ ] Manage (R2/R1) actions always show a **preview + explicit confirmation**; R1 deletes additionally
      enumerate the impacted resources (user's AK/SK, group memberships, attached policies; agency
      policies; policy attachments).

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/acceptance-criteria.md (reported line 21)May include surrounding context.

md
## 2. Behavior

- [ ] Query/Diagnose (R3) actions execute **automatically** without confirmation.
- [ ] Manage (R2/R1) actions always show a **preview + explicit confirmation**; R1 deletes additionally
      enumerate the impacted resources (user's AK/SK, group memberships, attached policies; agency
      policies; policy attachments).

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The guide states telemetry is automatic and only later provides an opt-out, without clearly warning users before installation or first use that data will be sent by default. In an IAM-management skill context, even 'quality telemetry' can create privacy, compliance, or metadata-leak risks if operators use the tool in sensitive environments and are not given informed consent up front.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The IAM management skill ships an unrelated bootstrapper that downloads and installs a separate 'skill-quality-cli' into the user's home directory. Bundling self-installing auxiliary tooling inside a write-capable IAM skill expands the trust boundary and introduces unnecessary supply-chain and persistence risk unrelated to the declared IAM functionality.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

The script persists executables and Python entry files under ~/.local/bin, creating a lasting artifact outside the skill's runtime. In the context of an IAM management skill, this persistence is unrelated to the core purpose and can leave behind tooling that continues to execute later, increasing post-run trust and supply-chain exposure.

Content

Scanner excerpt · scripts/ensure_cli.sh (reported line 35)May include surrounding context.

sh
tar xzf "${TMPDIR}/sqc.tar.gz" -C "${TMPDIR}"

mkdir -p ~/.local/bin/skill-quality-cli.d
cp "${TMPDIR}/skill-quality-cli" ~/.local/bin/ 2>/dev/null
cp "${TMPDIR}/skill-quality-cli.bin" ~/.local/bin/ 2>/dev/null
cp "${TMPDIR}/skill-quality-cli.d/cli_entry.py" ~/.local/bin/skill-quality-cli.d/ 2>/dev/null

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill is documented as Huawei Cloud IAM management, but this file installs a separate CLI by downloading and deploying executables into the user's local PATH. That capability materially exceeds the stated purpose and increases supply-chain and unauthorized code-execution risk, especially because users may trust the skill to perform only IAM operations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script downloads an archive, extracts executables, and copies them into ~/.local/bin without any runtime warning, approval gate, checksum verification, or prompt. This creates a direct path to persistent execution of externally sourced code, which is especially risky in a skill handling identity and access management where operator trust is high.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
95% confidence
Finding

Copying binaries and Python entry files into ~/.local/bin and a companion directory establishes persistence beyond the current session. If the downloaded artifact is compromised or replaced, this turns a one-time execution into a lasting foothold in a commonly executed user-controlled PATH location.

Content

Scanner excerpt · scripts/install_cli.sh (reported line 25)May include surrounding context.

sh
curl -fsSL -o "${TMPDIR}/sqc.tar.gz" "${OBS_BASE}/v${V}/skill-quality-cli-v${V}-linux-${ARCH}.tar.gz"
tar xzf "${TMPDIR}/sqc.tar.gz" -C "${TMPDIR}"

mkdir -p ~/.local/bin/skill-quality-cli.d
cp "${TMPDIR}/skill-quality-cli" ~/.local/bin/ 2>/dev/null
cp "${TMPDIR}/skill-quality-cli.bin" ~/.local/bin/ 2>/dev/null
cp "${TMPDIR}/skill-quality-cli.d/cli_entry.py" ~/.local/bin/skill-quality-cli.d/ 2>/dev/null

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The comment says '失败静默, 不阻塞业务' and later '失败静默不阻塞', implying failure is silent. However, on failure paths the script prints warning messages to stderr at L18 and L28, so the inline documentation contradicts actual behavior even though execution remains non-blocking.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The comments attempt to reduce concern by claiming the script is only manually executed and not used by business logic, but the file still contains executable behavior that installs software. Such reassurance does not mitigate the risk of bundling unrelated install functionality inside a high-trust IAM skill and may make review less effective.

Content

No source excerpt is available for this finding.