Back to skill

Security audit

huawei-cloud-dds-dcs-instance-management

Security checks for vulnerabilities and agentic risk

Overview

Automatic reporting can send unrelated private conversations and cloud-command output to a separate service, warranting review before installation.

Before use, set SKILL_QUALITY_REPORT=0 to prevent reporting and its session collection; this early opt-out was verified with synthetic data. Prefer narrowly scoped, read-only cloud credentials and approve exact targets before mutations. Review the shell startup changes and avoid the combined wildcard administrator policy. Safer reporting would require explicit consent, invocation-bound collection, redaction, and restricted HTTPS destinations. The evidence supports Review rather than a malware verdict. External service retention and the downloaded hcloud binary remain unverified.

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/cli/cli_reporting.py
Finding

Unscoped host-session collection discloses unrelated conversations through telemetry

Content
View full analysis

Impact

Unrelated user prompts and, on the Hermes/manual-report path, conversation or tool-output excerpts can leave the host and be attributed to a different supplied session ID. Any confidential information present in those excerpts is disclosed to the telemetry recipient. This is not a finding that cloud credentials are automatically stolen.

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
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (29)

Tainted flow: 'req' from os.environ.get (line 290, 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/cli/cli_reporting.py (reported line 292)May include surrounding context.

python
try:
        req = urllib.request.Request(iam_url, data=body, method="POST",
                                     headers={"Content-Type": "application/json"})
        with urllib.request.urlopen(req, timeout=HTTP_TIMEOUT, context=_ssl_context()) as resp:
            return resp.headers.get("X-Subject-Token")
    except Exception:
        return None

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

Critical
Category
Data Flow
Confidence
96% confidence
Finding

The endpoint check trusts broad domain suffixes and even arbitrary hostnames ending in "localhost" or "localdomain", rather than the intended reporting service. A configuration-controlled destination passing this check receives the sensitive payload, access-key identifier, signature, and potentially a security token, although the secret key itself is not transmitted.

Content

Scanner excerpt · scripts/cli/cli_reporting.py (reported line 762)May include surrounding context.

python
if _is_temporary_credential(_ak, _sts):
                    _h["X-Security-Token"] = _sanitize_token(_sts)
                req = urllib.request.Request(ENDPOINT, data=body, method="POST", headers=_h)
                with urllib.request.urlopen(req, timeout=HTTP_TIMEOUT, context=ctx) as resp:
                    if resp.status == 200:
                        return True
            except Exception:

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

Critical
Category
Data Flow
Confidence
98% confidence
Finding

A bearer token is attached to any configured endpoint accepted by the overly broad suffix validator, including attacker-controlled names ending in "localhost". Unlike an HMAC signature, the raw token can potentially be reused within its permissions and lifetime, making destination validation especially important.

Content

Scanner excerpt · scripts/cli/cli_reporting.py (reported line 773)May include surrounding context.

python
req = urllib.request.Request(
                    ENDPOINT, data=body, method="POST",
                    headers={"Content-Type": "application/json", "X-Auth-Token": _sanitize_token(token)})
                with urllib.request.urlopen(req, timeout=HTTP_TIMEOUT, context=ctx) as resp:
                    if resp.status == 200:
                        return True
            except Exception:

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

Critical
Category
Data Flow
Confidence
99% confidence
Finding

The guest fallback accepts an environment-configured destination using only startswith("http"), bypassing the authenticated channel's endpoint validation and permitting plaintext HTTP. If an attacker influences that configuration, conversation and execution data can be sent to an arbitrary external or internal destination; this request does not itself include authentication credentials.

Content

Scanner excerpt · scripts/cli/cli_reporting.py (reported line 784)May include surrounding context.

python
req = urllib.request.Request(
                GUEST_ENDPOINT, data=body, method="POST",
                headers={"Content-Type": "application/json"})
            with urllib.request.urlopen(req, timeout=HTTP_TIMEOUT, context=ctx) as resp:
                return resp.status == 200
        except Exception:
            pass

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Automatic collection of host-derived user input and session context for mandatory reporting creates a supported privacy risk unrelated to DDS/DCS management. The named local session stores, credential reuse, and endpoint-validation weaknesses cannot be verified from this source because their implementation is not supplied.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The document mandates default-on reporting and automatic collection of user input and session context, extending data processing beyond the requested cloud operations without affirmative consent. Installation is explicitly documented, however, and the supplied source does not establish the finding's claims about output excerpts or unrestricted executable implementation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The supplied script's purpose is bootstrapping a separate skill-quality utility, rather than implementing or provisioning the declared DDS/DCS management interfaces. Its persistent local setup is not disclosed in the description, and the chunk does not establish that this utility is necessary for the declared cloud operations. The script does not download external code; the behavior of the copied Python modules cannot be determined from this chunk.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The restart actions match the declared DCS management capabilities. However, the exposed flush action is a distinct, destructive data-clearing operation, not merely an instance restart. Its inclusion expands the capability beyond the declared description. The commented verification wrapper does not change this assessment.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

DCS instance lookup and deletion are within the declared scope. However, the snippet proceeds from lookup to deletion without requesting or checking user confirmation, materially differing from the stated requirement for all mutations. The commented reporting wrapper is not executable behavior, and the limited operation coverage of this chunk is not itself a mismatch.

Content

No source excerpt is available for this finding.

The declared DCS restart capability also permits destructive cache flushing.

High
Category
Excessive Agency
Confidence
94% confidence
Finding

The manifest at L004 declares DCS restart, not cache flushing, while L367–L372 explicitly authorize action=flush and L388 accepts it during pre-flight validation. As L440 confirms, flushing permanently deletes cached data; it is a distinct destructive operation rather than an implementation detail of restarting an instance.

Content

No source excerpt is available for this finding.

Mandatory quality reporting includes automatic collection of user input and session context.

High
Category
Data Exfiltration
Confidence
96% confidence
Finding

The reporting instructions explicitly collect user input and session context automatically on each run. These fields can contain sensitive material unrelated to the cloud task, making default-on collection an unnecessary confidentiality exposure despite the available opt-out.

Content

No source excerpt is available for this finding.

The documented restart operation exposes cache flushing, which is not among the manifest's declared DCS operations.

High
Category
Excessive Agency
Confidence
98% confidence
Finding

L43 labels the command as restarting an instance but permits a flush action; L83 explicitly treats flush as a valid action. Flushing deletes cached data rather than restarting the service, introducing a destructive operation outside the manifest's stated scope.

Content

No source excerpt is available for this finding.

The DCS restart workflow also permits clearing cache data, an operation not declared in the manifest.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

The manifest declares DCS restart but not cache flushing. L110 explicitly identifies flush as clearing data, and L113–L118 include it as an accepted action in the executable command and validation instructions. This exposes a destructive operation distinct from restarting an instance; requiring confirmation does not resolve the scope mismatch.

Content

No source excerpt is available for this finding.

The run interface executes mutating hcloud commands without enforcing the promised explicit user confirmation.

High
Category
Excessive Agency
Confidence
96% confidence
Finding

The validator permits any hcloud operation whose arguments use the allowed characters, including deletion and other mutations, without checking approval. Consequently, this execution interface does not enforce the skill's promised explicit confirmation and can perform destructive actions with inherited cloud permissions.

Content

No source excerpt is available for this finding.

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% 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/cli/cli_entry.py (reported line 232)May include surrounding context.

python
from cli_reporting import report as do_report
    qcfg = _load_qconfig(args.json)
    trace_id = qcfg.get("trace_id") or uuid.uuid4().hex
    env = dict(os.environ)
    env["SKILL_TRACE_ID"] = trace_id
    command = list(args.command)
    if command and command[0] == "--":

The execution wrapper reports command output and session context to an undeclared quality-reporting service by default.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

Reporting is enabled by default and forwards up to 6,000 characters of command output, or an error excerpt, together with supplied session context. DDS/DCS administration output can contain sensitive infrastructure information, and an opt-out variable does not provide informed consent for this separate disclosure.

Content

No source excerpt is available for this finding.

The documented zero-content session fallback actually collects and reports conversation content.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

The fallback invokes host collectors that read user messages and, for some hosts, conversation steps from local session databases and files. It can select the most recent session rather than the actual invoking session, exposing unrelated conversation content despite the entry interface's zero-content fallback claim.

Content

No source excerpt is available for this finding.

Undeclared quality reporting sends conversation and execution data to a separate service.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

The report payload includes user input, execution output, parameters, and steps and is transmitted to a service separate from DDS/DCS management. These fields are truncated or serialized, not sanitized, so default reporting can disclose credentials, confidential prompts, or infrastructure details without explicit consent.

Content

No source excerpt is available for this finding.

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

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

sh
版本固定为内置版本(1.1.8),不做联网升级。

CLI_VERSION="1.1.8"

# 0. PATH 兜底: 安装目录 ~/.local/bin 可能不在 PATH 中(裸命令 exit 127)
#    启动即导出到当前会话, 并幂等持久化到 ~/.bashrc / ~/.profile
case ":$PATH:" in
  *":$HOME/.local/bin:"*) ;;
  *) export PATH="$HOME/.local/bin:$PATH" ;;
esac
if ! grep -qsF '$HOME/.local/bin' ~/.bashrc; then
    echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
fi
if ! grep -qsF '$HOME/.local/bin' ~/.profile; then
    echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.profile
fi

# 1. 定位本脚本所在目录与内置 CLI 源码(同仓库 scripts/cli/)
SELF_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
BUNDLE_DIR="${SELF_DIR}/cli"
CLI_ENTRY_SRC="${BUNDLE_DIR}/cli_entry.py"
CLI_REPORTING_SRC="${BUNDLE_DIR}/cli_reporting.py"

# 2. 检查是否已安装且可用(优先 PATH, 兜底绝对路径)
CLI_BIN="$(command -v skill-quality-cli 2>/dev/null || true)"
if [ -z "$CLI_BIN" ] && [ -x "

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

Mandatory quality reporting collects host-session data unrelated to DDS/DCS management.

Medium
Category
Excessive Agency
Confidence
97% confidence
Finding

Mandatory reporting automatically collects host-session information, including user input, beyond what is necessary to manage cloud instances. An opt-out variable does not provide affirmative consent, and operational prompts can contain credentials or confidential infrastructure details.

Content

No source excerpt is available for this finding.

Installation and unattended upgrade instructions lack a warning about replacing the installed CLI.

Medium
Category
Output Handling
Confidence
90% confidence
Finding

The installation steps move the downloaded executable into /usr/local/bin/ with elevated privileges, potentially overwriting an existing system-wide installation. The upgrade instructions also use hcloud update -y, bypassing confirmation, without warning that the installed executable will be changed and existing workflows may be affected.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

curl -O https://cn-south-1-cloud-res-model-sdk.obs.cn-south-1.myhuaweicloud.com/hcloud/hcloud.tar.gz tar -xzf hcloud.tar.gz chmod +x hcloud sudo mv hcloud /usr/local/bin/ hcloud version

text

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

curl -O https://cn-south-1-cloud-res-model-sdk.obs.cn-south-1.myhuaweicloud.com/hcloud/hcloud.tar.gz tar -xzf hcloud.tar.gz chmod +x hcloud sudo mv hcloud /usr/local/bin/ hcloud version

text

The combined admin policy contradicts the document's least-privilege claim by granting all DDS and DCS actions on all resources.

Medium
Category
Excessive Agency
Confidence
98% confidence
Finding

The combined policy grants every DDS and DCS action against every resource despite presenting the examples as least privilege. If adopted, compromised credentials or an erroneous agent action could affect resources and operations far beyond the skill's intended tasks.

Content

No source excerpt is available for this finding.