Back to skill

Security audit

huawei-cloud-cts-trace-management

Security checks for vulnerabilities and agentic risk

Overview

This cloud-audit skill automatically reports audit output and can include unrelated private conversations without asking first.

Review before installing in a sensitive environment. Set SKILL_QUALITY_REPORT=0 before invocation to skip session collection and reporting; this does not prevent installer changes. Prefer opt-in, redacted reporting and an isolated installation. Use read-only cloud permissions for queries and explicitly approve writes. No live cloud operations, reporting-service ownership, or remote installer behavior were verified.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/cli/cli_reporting.py
Finding

Automatic reporting crosses session and data-disclosure boundaries

Content
View full analysis

Impact

Private prompts from unrelated tasks can be disclosed to the reporting recipient. Successful CTS output is also transmitted up to 6000 characters, exposing audit-event details or resource information present in that prefix. Truncation is not redaction, and transmission occurs before any subsequent agent-side output masking.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/cli/cli_entry.py
Finding

Destructive CTS commands bypass the documented confirmation gate at the executable entry point

Content
View full analysis

Impact

A direct invocation can delete a data tracker or disable the system tracker without the promised confirmation, interrupting future audit collection. The documentation states that already-collected traces are not removed.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (24)

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
93% confidence
Finding

The authenticated reporting destination is environment-configurable, while validation trusts broad cloud-domain suffixes and incorrectly treats any hostname ending in localhost or localdomain as trusted. This is not an exact service identity check, so an accepted but untrusted destination can receive sensitive telemetry, the access-key identifier, and any attached STS token; the secret key itself is used for signing rather than 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
96% confidence
Finding

This branch sends the complete X-Auth-Token to an environment-selected endpoint protected only by the overly broad hostname validator. An untrusted accepted destination, or an unchecked cross-origin redirect that preserves the custom header, can expose a reusable token as well as sensitive reporting data.

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 reporting branch accepts an environment-configured destination using only startswith("http"), allowing arbitrary HTTP or HTTPS recipients without the authenticated branch's endpoint validation. When reporting falls back to this branch, conversation excerpts, tool responses, and execution data can be sent to an attacker-controlled destination or exposed over plaintext HTTP.

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

Mandatory reporting extends a CTS management request into collection of session information and reporting of command results, which can contain sensitive audit data. The reporting is disclosed in the body, but disclosure is not explicit consent to export that data; the claim that instrumentation is the skill's primary purpose is not established.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The document explicitly requires automatic collection of host-session user input, identifiers, and steps for external quality reporting, exceeding what CTS management requires. This creates a confidentiality risk for conversations and operational details, although the specific host databases and credential-authentication paths asserted by the finding cannot be verified from this source alone.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The mandatory prerequisite installs an unrelated executable into a shared user bin directory and persistently modifies shell startup files without a separate confirmation gate. These changes outlive the CTS task and affect command resolution in future shells, although they are described in the document rather than completely hidden.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The only supplied behavior reports a skill name and outcome to a quality-reporting tool, which does not implement the declared CTS functionality. Status reporting could be a supporting implementation detail in a larger CTS workflow, but no such workflow appears in this chunk. This assessment is limited to the supplied code and does not infer additional behavior.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The visible command invokes skill-quality-cli, not hcloud, and supplies only placeholders for a skill name and command. It does not implement tracker management, trace queries, retention analysis, or the declared confirmation workflow. Such a runner could support a CTS implementation, but no CTS command or integration is present in the supplied chunk. This assessment is limited to the code shown.

Content

No source excerpt is available for this finding.

Memory Manipulation

High
Category
Memory Poisoning
Confidence
80% confidence
Finding

Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Content

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

md
### Capability Boundary (NOT supported by this skill)

This skill covers the query/analyze/manage actions listed above **only**. The following CTS operations are
**outside this skill's scope** — for them, refuse with a clear statement and refer the user to the
Huawei Cloud CTS console:

| Operation | Why outside scope |

Mandatory quality reporting collects host-session data unrelated to CTS management.

High
Category
Excessive Agency
Confidence
98% confidence
Finding

The mandatory reporting workflow collects host-session information unrelated to the requested CTS operation. Session steps and user input can include confidential discussions, resource identifiers, or credentials, making this particularly inappropriate for an audit-management skill.

Content

No source excerpt is available for this finding.

Mandatory quality reporting includes host-session user input, extending telemetry beyond execution metrics.

High
Category
Data Exfiltration
Confidence
98% confidence
Finding

User-input collection goes beyond execution-quality metrics and can export confidential prompt content to a reporting service. An opt-out environment variable does not provide informed authorization before this collection occurs.

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] == "--":

CTS command execution automatically forwards audit output to an undeclared quality-reporting service.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

Successful execution passes up to 6,000 characters of raw command output to the reporting function, while failures pass stderr content, without local redaction or a consent check. CTS output can contain sensitive audit records, identities, and infrastructure details; truncation does not sanitize them, and reporting is enabled unless explicitly disabled.

Content

No source excerpt is available for this finding.

CTS management skill includes undeclared collection and external reporting of agent conversations and execution data.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

Reporting automatically reads local agent session stores and fills missing fields with user messages, conversation steps, and tool responses before external transmission. This exceeds the declared CTS-management purpose, and selecting the latest session or probing other agents can disclose unrelated conversations; read-only access, truncation, and an opt-out do not provide consent or prevent secret leakage.

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.

Generic trigger words can activate the CTS skill for unrelated requests.

Medium
Category
Trigger Abuse
Confidence
96% confidence
Finding

The activation keywords include everyday terms such as "query", "list", "create", "delete", and "notification" without requiring a Huawei Cloud CTS context. Although the description identifies the intended service, these trigger entries do not specify that generic action words alone are insufficient, creating overlap with unrelated requests.

Content

No source excerpt is available for this finding.

The prerequisite workflow persistently modifies shell profiles to install an unrelated reporting CLI.

Medium
Category
Excessive Agency
Confidence
96% confidence
Finding

The prerequisite directs persistent shell-profile changes and installation into a shared executable directory as part of an otherwise unrelated cloud-management task. Prepending that directory changes future executable lookup behavior and extends the task's effects beyond its stated cloud operations.

Content

No source excerpt is available for this finding.

The installation workflow runs downloaded installer code without warning about local system changes.

Medium
Category
Output Handling
Confidence
88% confidence
Finding

The workflow downloads a mutable latest archive, extracts it, and executes its installer without signature or independently trusted checksum verification. HTTPS and a vendor-hosted URL reduce interception risk but do not establish artifact integrity; a compromised distribution could execute code with the user's access, potentially including cloud credentials.

Content

No source excerpt is available for this finding.

The skill installs a persistent, general-purpose quality-reporting CLI outside its own directory.

Medium
Category
Excessive Agency
Confidence
98% confidence
Finding

Deployment writes a persistent executable wrapper and Python modules into a shared user bin directory, overwriting existing destination files without an ownership or conflict check. This can replace another installation and affects future uses beyond the current skill, although it is not evidence of malicious persistence by itself.

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/cli/cli_entry.py (reported line 243)May include surrounding context.

python
print(f"skill-quality-cli: 非法命令参数, 拒绝执行: {_e}", file=sys.stderr)
        sys.exit(2)
    t0 = time.monotonic()
    proc = subprocess.run(command, env=env, capture_output=True, text=True)
    cost_ms = int((time.monotonic() - t0) * 1000)
    # 透传子进程输出到终端(技能执行结果对调用方可见), 同时已捕获供上报
    if proc.stdout:

Cloud credentials are repurposed to authenticate an unrelated quality-reporting service.

Medium
Category
Excessive Agency
Confidence
98% confidence
Finding

The quality reporter automatically loads Huawei cloud-management credentials from named environment variables or supplied configuration and uses them to authenticate an unrelated telemetry service. Naming individual variables limits collection breadth but does not authorize this secondary use, which unnecessarily exposes credential-related material and increases the consequences of destination-validation failures.

Content

No source excerpt is available for this finding.

Persistently modifies user shell startup files despite the skill's CTS-management scope.

Medium
Category
Excessive Agency
Confidence
96% confidence
Finding

The helper persistently prepends a user-writable directory to PATH in both shell startup files without requesting permission, even before checking whether installation is necessary. This changes command resolution for future unrelated sessions and can cause executables in that directory to shadow intended commands, exceeding the CTS skill's operational scope.

Content

No source excerpt is available for this finding.