Back to skill

Security audit

huawei-cloud-rds-mysql-replica-promotion

Security checks for vulnerabilities and agentic risk

Overview

ClawScan rates this skill suspicious because scanners reported risks involving destructive database cleanup, exposed cloud credentials, an incomplete cost estimate, and a conversion confirmation gate; the review is not a claim of malicious intent.

Consider the potential for data loss during database verification, exposure of cloud credentials, understated prepaid costs, and an irreversible conversion proceeding without the documented confirmation. Skillspector scanned all 18 listed components but marked analysis partial because a local reference in SKILL.md could not be resolved, so coverage is incomplete. Review the referenced procedures and permission needs carefully before installing.

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
scripts/convert.py
Finding

Initial conversion bypasses the documented explicit-confirmation gate

Content
View full analysis

Impact

A direct or premature Agent invocation can commit an unapproved irreversible deployment change, increase ongoing charges and automatically charge the prepaid price difference.

Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (11)

Database verification can delete an existing database without warning.

High
Category
Output Handling
Confidence
99% confidence
Finding

CREATE DATABASE IF NOT EXISTS can reuse an existing ha_test_db, while the cleanup unconditionally drops that entire database, including unrelated tables. Although these are user-run instructions rather than automatic execution, following them against a production instance can cause substantial data loss.

Content

No source excerpt is available for this finding.

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: file_write, 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.

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 155)May include surrounding context.

md
original `convert.py` was killed after calling `StartInstanceSingleToHaAction` but before its response was captured), `resume.py` would have to (re-)issue the irreversible `StartInstanceSingleToHaAction` to continue. In that case:
    * The script gates the (re-)start on a `--confirm` flag; without `--confirm` it writes a `conversion.refused=true` report and exits non-zero, **without** calling `StartInstanceSingleToHaAction`
    * **MUST** first disclose to the user that this resume path will (re-)start the irreversible single-to-HA conversion, obtain explicit user confirmation, and only then invoke `resume.py` with `--confirm`; without confirmation **MUST NOT** pass `--confirm`
    * The pure-polling resume paths (state file already has `job_id` or `order_id`) do **not** need `--confirm` and do not (re-)issue the conversion
* If the task fails, present the failure reason to the user and suggest retrying with a different `--target-az`; a failed conversion does not affect the instance

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
AKSK authentication (a successful JSON response means authenticated; a DNS or
      authentication error means not); terminates with guidance if any check fails.
- [ ] **Step 1 (Instance discovery and selection)**: when the user provided the instance ID
      at trigger time, the step is skipped entirely (no echo, no confirmation); the
      existence / `Single` / `ACTIVE` check is delegated to the read-only `pre_check.py`
      in Step 4. When not provided, it runs `list_instances.py` and presents the
      **cross-region** result as a table (ID, name, region, flavor, database version,

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 34)May include surrounding context.

md
for its region — **MUST NOT** ask again for either. An empty result terminates the
      workflow with that reason.
- [ ] **Step 2 (Availability zone discovery and selection)**: when the user provided the
      target AZ at trigger time, the step is skipped entirely (no echo, no confirmation);
      its availability is verified by the read-only `pre_check.py` in Step 4. When not
      provided, it runs `list_azs.py --region <instance region> --database-name MySQL
      --version-name <engine_version> --spec-code <flavor_ref> --instance-id <iid>` and

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 227)May include surrounding context.

md
| Environment check | 0 | Python/hcloud installed and authenticated | - |
| Instance discovery | 1 | Cross-region JSON of convertible single MySQL instances, table presented, ID and region confirmed (optional) | - |
| AZ discovery | 2 | HA-flavor `az_status` JSON, table presented, AZ confirmed (optional, same-AZ allowed) | - |
| Risk disclosure | 3 | Complete risks/impact content presented before any change; no confirmation requested here | - |
| Precondition check | 4 | Precheck report with pass/fail per condition, run before the change confirmation | - |
| Cost assessment | 5 | single/HA prices in the instance's actual charge mode only, delta, actual multiple | - |
| Monitoring baseline | 6 | 300s snapshot, single-instance replication delay null | - |

The credential setup command places the secret key directly in shell arguments without warning about credential exposure.

Medium
Category
Output Handling
Confidence
97% confidence
Finding

Replacing the placeholders with real AK/SK credentials places secrets in command-line arguments and potentially persistent shell history, terminal recordings, or agent execution logs. Exposure of these cloud credentials can enable unauthorized operations within their IAM privileges, making this particularly sensitive in a database-administration workflow.

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 · references/risks-and-impact.md (reported line 52)May include surrounding context.

md
| Billing Mode | Change Operation | Cost Impact |
| --- | --- | --- |
| Prepaid (monthly/yearly) | Single to primary/standby | After the change, pay the price difference based on the remaining time in the billing cycle (the SKILL automatically sends `is_auto_pay=true` and Huawei Cloud auto-charges the difference from the account — ensure the account balance is sufficient) |
| Pay-per-use (on-demand) | Single to primary/standby | After the change, billed hourly at the primary/standby instance price |

### 4.2 Prepaid Price-Difference Calculation

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/rds_common.py (reported line 291)May include surrounding context.

python
command = ["hcloud"] + cmd_args
    LOGGER.debug("Executing: %s", " ".join(command))
    try:
        completed = subprocess.run(
            command,
            capture_output=True,
            text=True,

The standard workflow omits storage from prepaid estimates despite explicitly documenting its inclusion.

Medium
Category
Excessive Agency
Confidence
99% confidence
Finding

In the standard run() workflow, quote_period() is called without its optional storage argument, so prepaid estimates exclude storage even when --storage-size-gb is supplied. Because this skill provides cost estimates before confirmation of an HA upgrade, incomplete estimates can mislead spending authorization and cause unexpected charges; this is a financial-integrity issue rather than direct infrastructure compromise. The comparison workflow passes storage correctly, limiting the affected scope to the standard workflow.

Content

No source excerpt is available for this finding.

The module overview claims polling-only recovery, but the script can start an irreversible conversion.

Medium
Category
Excessive Agency
Confidence
98% confidence
Finding

The overview states that the script never re-runs the conversion and only polls persisted operations. However, L233–L272 initiate StartInstanceSingleToHaAction when no job or order ID is persisted and --confirm is supplied, contradicting the polling-only guarantee even though later documentation describes this branch.

Content

No source excerpt is available for this finding.