Back to skill

Security audit

huawei-cloud-terraform-installer

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a Terraform installer, but it ships a plaintext root SSH credential in its verification docs and performs broad system changes that deserve manual review before use.

Review this skill before installing. Rotate or invalidate the exposed SSH credential if it is real, run the installer only on a machine where Terraform/PATH/terraformrc changes are acceptable, avoid sudo/admin unless necessary, and back up existing Terraform configuration before using --uninstall.

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

Error
Location
references/verification-method.md:13
Finding

Privileged SSH Credentials Disclosed in Verification Documentation

Content
View full analysis

Vulnerability Details

File Location: references/verification-method.md, lines 13–15
Vulnerability Type: Hardcoded privileged credentials and infrastructure details
Risk Level: High

Vulnerable Snippet:

markdown
| Test Machine Public IP | 1.92.158.126 |
| Security Group | Allow SSH only from local IP (120.46.211.126) |
| Login Method | Password login (root/Test@123456) |

Technical Analysis

The verification document discloses a concrete public IP address together with an SSH username and plaintext password for the privileged root account. This transfers authentication material from the test environment into the distributed Skill package, where any project reader can obtain it.

The documented source-IP restriction is a mitigating control, but it does not make publishing the credential safe. Access may become possible if an attacker operates from the allowlisted address, compromises a system using that address, gains a route through an authorized network, or if the security-group policy is later broadened while the disclosed password remains valid.

The project contains no evidence that the value is explicitly synthetic or has been revoked. Accordingly, the credential must be treated as potentially valid. There is no evidence that the Skill itself uses or exfiltrates this credential, so this is an insecure coding and documentation practice rather than demonstrated credential theft or malicious behavior.

Attack Path

  1. An unauthorized party obtains the distributed project or repository contents.
  2. The party reads references/verification-method.md and extracts the public IP, root username, and plaintext password.
  3. The party obtains network reachability to TCP port 22 from an allowed source, such as through compromise of an allowlisted system or a subsequent security-group change.
  4. The party attempts SSH password authentication against the disclosed public IP as root.
  5. If the ...[truncated 681 chars]
Remediation
View remediation

Remediation Suggestions

  1. Immediately rotate the disclosed password and verify that it is no longer valid on any system.
  2. Remove the real IP addresses and credential from the current documentation and repository history.
  3. Replace sensitive values with unmistakable placeholders such as <TEST_HOST>, <ALLOWED_SOURCE_IP>, and <SSH_USERNAME>.
  4. Disable direct SSH login for root and require named, least-privileged user accounts with audited privilege escalation.
  5. Disable password-based SSH authentication and use individually managed SSH keys or short-lived certificates.
  6. Review authentication and network logs for attempts involving the disclosed account and host.
  7. Search the project and related repositories, logs, artifacts, and release packages for reused copies of the password.
  8. Add secret scanning and documentation review to the release process to prevent credentials and infrastructure access details from being committed again.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (23)

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The document exposes a public IP, allowed source IP, and plaintext root credentials for a live test machine, which creates an immediate unauthorized-access risk unrelated to verifying a Terraform installer. In the context of an installer skill, embedding remote administrative access details materially expands capability from local setup guidance to direct compromise of an external host.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

Publishing plaintext remote-access credentials and connection details is a direct sensitive-data disclosure that can enable unauthorized login, lateral movement, or infrastructure abuse. Because this is a public verification document for an installer skill, there is no legitimate need to include actionable secrets, making the exposure especially unsafe.

Content

No source excerpt is available for this finding.

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/verification-method.md (reported line 71)May include surrounding context.

text

**Expected Results**:
- Delete /usr/local/bin/terraform
- Delete ~/.terraformrc
- Clean up ~/.terraform.d/providers

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
99% confidence
Finding

Using shell=True for a command that can be executed directly is unnecessary and risky. In an installer that may run with elevated privileges, shell-based execution can amplify the impact of environment manipulation or command resolution abuse, making this more dangerous than in a non-privileged script.

Content

Scanner excerpt · scripts/install_terraform.py (reported line 284)May include surrounding context.

python
# 也检查系统 PATH
    try:
        if system_info["is_windows"]:
            result = subprocess.run(
                ["where", "terraform"],
                capture_output=True,
                text=True,

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill advertises or implies capabilities involving environment access, file read/write, network, and shell execution, but it does not declare an explicit tool/permission scope. That creates a trust and review gap: downstream systems or users cannot easily verify what the skill is expected to do, increasing the chance of unintended privileged execution or abuse if the skill is invoked automatically.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger conditions are broad enough to invoke this skill for generic Terraform-related conversations, not just explicit installation requests. Over-broad auto-activation can cause unnecessary execution of a networked installer workflow in contexts where the user only wanted advice, which raises the risk of surprise file modifications, downloads, or command execution.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
78% confidence
Finding

The documentation instructs users to rerun the installer with sudo, which can lead to the entire installation script executing with elevated privileges. If the script or any downloaded content is compromised, or if the script writes to sensitive locations unexpectedly, this magnifies the blast radius to full system-level changes.

Content

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

md
**Solution:**

- Windows: Right-click → Run as administrator
- Linux: `sudo python3 install_terraform.py`

### Issue 3: Network Timeout

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The test scenarios document installation, PATH modification, terraform init, and uninstall flows as expected behavior without requiring any explicit warning, confirmation, or safety messaging about system-wide changes and potentially destructive effects. In an agent skill context, this can normalize privileged or state-changing operations and make it more likely that downstream automation executes them without sufficient user awareness or consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The installation and verification steps describe downloading, installing, configuring, and initializing Terraform without clearly warning that they perform privileged system changes and network-dependent actions. Given the skill’s purpose, these actions are expected, but the lack of explicit warnings and environment-safety guidance increases the chance of unintended modification on production or shared systems.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The uninstall test directs deletion of Terraform binaries and user configuration/provider data but does not warn that it will modify or remove existing local Terraform setup. In an installation skill, this omission is dangerous because users may run the procedure on a workstation with important existing state or custom configuration and unintentionally disrupt their environment.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The remote testing section instructs operators to copy and execute the installer over SSH as root on a target machine, encouraging privileged remote execution beyond the stated purpose of documenting local Terraform installation verification. This increases blast radius because any unsafe behavior in the installer or operator mistake would run with full system privileges on another host.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file shows that the skill supports an uninstall operation that deletes /usr/local/bin/terraform, /root/.terraformrc, and provider files, but it does not include any cautionary warning about data loss, system modification, or the need to verify before running it. For markdown files, destructive behavior affecting user or system state should be accompanied by clear warnings.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/install_terraform.py (reported line 54)May include surrounding context.

python
TERRAFORM_BINARY_NAME = "terraform.exe" if sys.platform == "win32" else "terraform"

# Terraform 下载源
GITHUB_API_URL = "https://api.github.com/repos/hashicorp/terraform/releases/latest"
TERRAFORM_DOWNLOAD_URL = "https://releases.hashicorp.com/terraform/{version}/terraform_{version}_{os}_{arch}.zip"
HASHICORP_APT_URL = "https://apt.releases.hashicorp.com"

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
98% confidence
Finding

On Windows, the script uses subprocess.run with shell=True to execute a PATH lookup for 'where terraform'. Even though the argument is not directly user-supplied, shell=True introduces command resolution through the shell and increases exposure to environment/PATH hijacking or unexpected shell behavior on a host running this installer.

Content

Scanner excerpt · scripts/install_terraform.py (reported line 284)May include surrounding context.

python
# 也检查系统 PATH
    try:
        if system_info["is_windows"]:
            result = subprocess.run(
                ["where", "terraform"],
                capture_output=True,
                text=True,

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/install_terraform.py (reported line 292)May include surrounding context.

python
shell=True
            )
        else:
            result = subprocess.run(
                ["which", "terraform"],
                capture_output=True,
                text=True,

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/install_terraform.py (reported line 305)May include surrounding context.

python
if terraform_path.exists():
        try:
            result = subprocess.run(
                [str(terraform_path), "version", "-json"],
                capture_output=True,
                text=True,

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/install_terraform.py (reported line 318)May include surrounding context.

python
print(f"   安装路径: {terraform_path}")
                return True, version
            else:
                result = subprocess.run(
                    [str(terraform_path), "version"],
                    capture_output=True,
                    text=True,

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Beyond installing the Terraform CLI, the script downloads a Huawei provider, writes provider mirror configuration, and changes Terraform's future provider installation behavior. This expands the trust boundary and creates supply-chain and configuration-risk beyond the manifest's stated purpose, especially in an automated agent setting where users may not expect persistent CLI reconfiguration.

Content

No source excerpt is available for this finding.

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/install_terraform.py (reported line 643)May include surrounding context.

python
try:
        # 运行 terraform init
        result = subprocess.run(
            ["terraform", "init"],
            cwd=test_dir,
            capture_output=True,

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill is described as an installer, but it also performs uninstallation and recursive deletion of configuration and provider directories. In agent or automated contexts, this broader destructive capability is risky because it can remove existing Terraform state-related setup and user configuration without interactive confirmation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The uninstall path irreversibly deletes the Terraform binary, configuration file, and provider directories without any confirmation prompt or dry-run mode. In an agent-executed skill, this is dangerous because a mistaken invocation can cause immediate destructive changes and loss of configuration with no recovery checkpoint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

User-facing documentation, CLI descriptions, and runtime messages are predominantly in Chinese, which imposes a specific language on users without any opt-in or alternative locale. This is a natural-language policy concern because the skill does not offer language selection or document that it is intentionally region- or audience-specific.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

Persistently editing the Windows registry to change PATH is a stronger system-configuration capability than simply downloading and placing a CLI binary. While related to installation, the manifest does not explicitly disclose registry/environment mutation, making this capability only partially justified by the stated purpose.

Content

No source excerpt is available for this finding.