Back to skill

Security audit

qwencloud-observe

Security checks for vulnerabilities and agentic risk

Overview

This observability skill mostly fits its purpose, but it asks for powerful cloud access that can run commands and install monitoring software on servers without enough scoping or consent.

Review this before installing if you expect a strictly read-only observer. Use a tightly scoped, temporary Alibaba Cloud RAM role if possible, remove or separate cms:InstallMonitoringAgent and broad ecs:RunCommand access, verify the Aliyun CLI from an official pinned source, and do not run it against projects whose .qwencloud-deploy file you do not trust.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (5)

T09 · Insecure Skill Coding Practices

Error
Location
references/observe_application.md:24
Finding
Remote Command Injection Through Unvalidated Deployment State Fields<![CDATA[ ## Vulnerability Details **File Location**: `references/observe_application.md:24-31` **Related Location**: `references/workflow.md:14-25` **Vulnerability Type**: Shell command injection into Alibaba Cloud ECS Cloud Assistant **Risk Level**: High ### Vulnerable Code ```bash aliyun ecs RunCommand --RegionId <region> --Type RunShellScript --InstanceId.1 <ecs-id> \ --ContentEncoding Base64 \ --CommandContent "$(printf '%s' 'systemctl is-active <service_name>; systemctl is-active nginx; ss -ltnp | grep -E ":80|:<app_port>" || true' | base64)" ``` The values used in this command are obtained from the project-controlled deployment state: ```text 2. Parse the JSON state file. Extract: - `region_id`, `stack_id`, `topology`, `app_type`, `nginx_mode`, `app_port` - `service_name` (service name, used for service/log checks; falls back to `qwencloud-app` when missing) - `outputs.public_ip`, `outputs.ecs_instance_ids[]`, `outputs.security_group_id`, `outputs.eip_allocation_id` ... 4. Validate region and resource IDs are non-empty. Missing critical IDs → mark the affected layer `unknown` with the reason. ``` The same untrusted service name is also inserted into log commands: ```bash journalctl -u <service_name> --since '1 hour ago' --no-pager | tail -n 200 tail -n 200 /var/log/nginx/error.log ``` ### Technical Analysis The instructions require values such as `service_name` and `app_port` to be read from `.qwencloud-deploy` and substituted directly into shell source code. The documented validation only checks whether region and resource identifiers are non-empty. It does not require `service_name` to follow systemd unit-name syntax or `app_port` to be a numeric TCP port. An attacker-controlled value containing shell metacharacters, command substitutions, quotes, semicolons, or newlines could terminate the intended argument and add arbitrary shell commands. Encoding the resulting script with Base64 only prepares it for transport throug ...[truncated 1509 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Parse `.qwencloud-deploy` against a strict schema before making any cloud call. 2. Require `app_port` to be an integer in the range `1`–`65535`; reject strings and malformed values. 3. Allow only valid systemd unit identifiers for `service_name`, using a conservative allowlist such as letters, digits, `_`, `-`, `.`, and `@`, with an explicit maximum length. 4. Validate region identifiers, ECS instance IDs, security-group IDs, EIP IDs, and RDS IDs against their documented formats. 5. Do not generate shell source by direct string substitution. 6. Use a fixed diagnostic script and transmit dynamic values as safely quoted positional arguments. 7. Apply a proven shell-escaping implementation to every argument if shell execution cannot be avoided. 8. Reject state files containing unexpected fields, control characters, newlines, or shell metacharacters in command-related values. 9. Restrict `ecs:RunCommand` to only the deployment's ECS resources and require an explicit confirmation before invoking remote commands. ]]>

T05 · Unauthorized Access and Privilege Escalation

Error
Location
references/ram_policies.md:31
Finding
Overprivileged RAM Policy Grants Account-Wide Remote Execution and Billing Access<![CDATA[ ## Vulnerability Details **File Location**: `references/ram_policies.md:31-61` **Related Location**: `references/observe_cost.md:14-21` **Vulnerability Type**: Excessive cloud permissions and failure to enforce least privilege **Risk Level**: High ### Vulnerable Code ```json { "Version": "1", "Statement": [ { "Effect": "Allow", "Action": [ "ecs:DescribeInstances", "ecs:RunCommand", "ecs:DescribeInvocations", "cms:DescribeMetricList", "cms:DescribeMonitoringAgentStatuses", "cms:InstallMonitoringAgent", "ecs:DescribeSecurityGroupAttribute", "ecs:DescribeInstanceHistoryEvents", "ecs:DescribeSnapshots", "vpc:DescribeEipAddresses", "bssopenapi:QueryInstanceBill", "bssopenapi:QueryBill", "rds:DescribeDBInstances", "rds:DescribeDBInstanceAttribute", "rds:DescribeDBInstancePerformance", "rds:DescribeSlowLogRecords", "rds:DescribeBackups" ], "Resource": "*" } ] } ``` The billing guide confirms that an account-wide result is retrieved: ```text `QueryInstanceBill` returns the whole account cycle. From `Data.Items.Item[]`, keep only rows whose `InstanceID` matches this app's ECS/RDS IDs. ``` ### Technical Analysis The recommended RAM policy applies all actions to `Resource: "*"`. This includes `ecs:RunCommand`, which is a remote code-execution capability, and `cms:InstallMonitoringAgent`, which modifies remote systems. It also includes billing APIs that retrieve records for the whole account rather than only the application being observed. Although many descriptive APIs may have limited resource-level authorization support, placing remote command execution and software installation in the same unrestricted role as routine metric collection breaks the principle of least privilege. Local filtering of billing records occurs only after unrelated account data has already been returned to ...[truncated 1218 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Split permissions into separate roles: - a default read-only metrics role; - an optional remote-diagnostics role; - an optional agent-installation role. 2. Scope `ecs:RunCommand` and `ecs:DescribeInvocations` to the exact deployment instances whenever Alibaba Cloud RAM supports resource-level authorization. 3. Apply region, resource-tag, principal, and request conditions where direct resource scoping is unavailable. 4. Require deployment resources to carry a dedicated application tag and deny access to resources without that tag. 5. Remove `cms:InstallMonitoringAgent` from the default observation role. 6. Remove `bssopenapi:QueryBill` unless the user explicitly requests functionality requiring it. 7. Keep account-wide billing responses outside model-visible context where possible. Filter them in deterministic local code and expose only matching application totals. 8. Add explicit deny rules for unrelated ECS instances and sensitive environments. 9. Document which APIs cannot be resource-scoped and the residual account-level exposure they create. 10. Use short-lived credentials dedicated to this Skill rather than general administrative credentials. ]]>

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
references/observe_ecs.md:29
Finding
CloudMonitor Agent Is Installed Without an Explicit State-Change Confirmation<![CDATA[ ## Vulnerability Details **File Location**: `references/observe_ecs.md:29-41` **Related Locations**: `SKILL.md:151-154`, `SKILL.md:205-209` **Vulnerability Type**: Unapproved remote system modification **Risk Level**: Medium ### Vulnerable Code ```text ## Memory — 3-tier strategy (state the data source in the result) The memory trend comes from the CloudMonitor agent (`memory_usedutilization`). The agent is ensured lazily by observe, not installed at deploy time. Follow the tiers in order: 1. **Agent metric (preferred)** — probe status first; if absent, install via the cloud API and poll until ready, then query the memory series: ``` ```bash aliyun cms DescribeMonitoringAgentStatuses --InstanceIds <ecs-id> # When not running, install via API (region = <region>), then poll DescribeMonitoringAgentStatuses until running: aliyun cms InstallMonitoringAgent --RegionId <region> --Force true --InstanceIds.1 <ecs-id> aliyun cms DescribeMetricList --Namespace acs_ecs_dashboard --MetricName memory_usedutilization \ --Dimensions '[{"instanceId":"<ecs-id>"}]' --StartTime <start> --EndTime <end> --Period 60 ``` The general interaction rule states: ```text - **State-changing actions** (entering operate, exporting a report): use AskUserQuestion whose prompt answers **what it does** · **impact** · **how to verify**; do nothing before the user confirms. ``` ### Technical Analysis The Skill describes itself as read-only, but its preferred memory-observation path installs monitoring software on the ECS instance with `--Force true`. Installation is a persistent state change and can modify packages, services, files, resource consumption, and outbound communication behavior on the remote system. The instructions require confirmation for some state-changing actions, but do not apply that confirmation requirement to CloudMonitor installation. Instead, installation occurs automatically whenever the agent is not running. This makes a routine observation requ ...[truncated 1164 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Make the read-only snapshot path the default when the CloudMonitor agent is absent. 2. Before installation, require explicit user confirmation that states: - what component will be installed; - which ECS instance will be modified; - whether a service will persist; - expected telemetry and network behavior; - how installation can be verified and reversed. 3. Remove `--Force true` unless replacement is specifically justified and separately confirmed. 4. Keep `cms:InstallMonitoringAgent` out of the default RAM policy and request a temporary elevated role only after approval. 5. Clearly disclose that trend metrics require an optional state-changing installation. 6. If automatic installation remains mandatory, stop describing the Skill as strictly read-only. 7. Record the installation event and result in an auditable log without secrets. ]]>

T08 · Insecure Dependencies

Warning
Location
references/cli_installation_guide.md:5
Finding
Aliyun CLI Is Installed from an Unpinned and Unverified Latest Archive<![CDATA[ ## Vulnerability Details **File Location**: `references/cli_installation_guide.md:5-14` **Vulnerability Type**: Unverified third-party binary installation **Risk Level**: Medium ### Vulnerable Code ```bash # macOS brew install aliyun-cli && brew upgrade aliyun-cli # Linux wget https://aliyuncli.alicdn.com/aliyun-cli-linux-latest-amd64.tgz tar -xzf aliyun-cli-linux-latest-amd64.tgz && sudo mv aliyun /usr/local/bin/ aliyun version # verify 3.x ``` ### Technical Analysis The Linux installation procedure downloads a mutable `latest` archive and moves its executable into `/usr/local/bin` with `sudo`. HTTPS protects the transfer channel, but the procedure does not pin an exact version or verify a vendor-published checksum or cryptographic signature. Checking that the binary reports version 3.x is not an integrity check because a substituted malicious executable can print an expected version. The archive is also extracted without validating its contents before a privileged installation. Because the CLI subsequently handles Alibaba Cloud credentials and makes privileged API calls, compromise of this binary would expose both local execution and cloud-account access. ### Attack Path 1. The mutable archive is replaced upstream, at the CDN, or in the local working directory. 2. The user follows the documented command and downloads or extracts the substituted archive. 3. No checksum or signature validation detects the replacement. 4. The executable is moved into `/usr/local/bin` with elevated privileges. 5. The malicious executable later runs when the Skill invokes `aliyun`, gaining access to the process environment, local files, and configured cloud credentials. ### Impact Assessment A compromised CLI can execute arbitrary local code, steal Alibaba Cloud credentials, alter API requests, falsify API responses, and perform unauthorized cloud operations using the configured identity. Installation into a system-wide executable path also affects other u ...[truncated 176 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin an exact Aliyun CLI release rather than using the mutable `latest` archive. 2. Obtain the archive from the vendor's documented official release channel. 3. Download and verify a vendor-published SHA-256 or stronger checksum before extraction. 4. Prefer cryptographic signature verification where the vendor provides signed releases. 5. Extract into a newly created directory with restrictive permissions. 6. Inspect the archive file list and reject absolute paths, traversal entries, symbolic-link abuse, or unexpected files before installation. 7. Install only after successful integrity and provenance verification. 8. Avoid `sudo` where possible; otherwise limit the privileged step to copying the already verified binary. 9. Document the expected version and checksum so installation is reproducible. ]]>

other

Note
Location
references/workflow.md:103
Finding
Observation Automatically Modifies the Project Timeline Despite Read-Only Claims<![CDATA[ ## Vulnerability Details **File Location**: `references/workflow.md:103-115` **Related Location**: `SKILL.md:151-154` **Vulnerability Type**: Undisclosed persistent workspace modification **Risk Level**: Low ### Vulnerable Code ```text ## Append application dossier After deriving the health score, append one JSON line (`event=observe`) to `app_timeline.jsonl` alongside the state file. Fields: `ts` (UTC), `skill: qwencloud-observe`, `event: observe`, `summary` (one-line verdict), merged with `score` / `grade`, plus `fault_layer` on a real fault: ```json {"ts":"2026-08-03T16:20:00Z","skill":"qwencloud-observe","event":"observe","summary":"Checkup 87/100 (B) — app healthy; watch the RDS connection trend","score":87,"grade":"B"} ``` Write redacted read-only conclusions only; never a password or connection string. ``` The interaction policy states: ```text - **State-changing actions** (entering operate, exporting a report): use AskUserQuestion whose prompt answers **what it does** · **impact** · **how to verify**; do nothing before the user confirms. ``` ### Technical Analysis Every observation is instructed to append a persistent entry to `app_timeline.jsonl`. This modifies the user's workspace even though the Skill is marketed as read-only and its interaction rules require confirmation before state-changing actions. The content is intended to be redacted, which reduces secret exposure, but operational summaries, health scores, fault layers, and timestamps can still be sensitive. The instructions do not specify user consent, file permissions, rotation, retention, maximum size, symbolic-link protection, or source-control exclusion. If `app_timeline.jsonl` is a symbolic link or resides in a shared repository, the automatic append may affect an unintended file or disclose operational metadata to other users. ### Attack Path 1. The user invokes an ordinary observation operation. 2. The Skill derives a health score. 3. Without a separate conf ...[truncated 704 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Make timeline history explicitly opt-in. 2. Ask for confirmation before the first write and explain what will be stored and where. 3. Provide a mode that performs observations without creating or modifying files. 4. Create the file with restrictive permissions and reject symbolic links. 5. Use safe append semantics and verify that the resolved path remains inside the selected project directory. 6. Add documented retention and maximum-size limits. 7. Provide ignore-file guidance so the timeline is not accidentally committed. 8. Continue enforcing redaction and exclude credentials, signed URLs, connection strings, raw SQL literals, cookies, and unfiltered logs. 9. Align the Skill description with its actual behavior if persistent writes remain enabled by default. ]]>
Vulnerability Patterns
  • 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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (24)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The manifest claims a read-only cloud observability skill, but the documented behavior is incomplete and internally inconsistent about what is actually implemented. This mismatch can mislead users and orchestration layers into granting trust or permissions to a skill that may not deliver the promised checks, causing false assurance during incident handling or cost review.

Ae1

High
Category
analysis-evasion
Content
- Python >= 3.8 (only if you render a report file with scripts/render_report.py)
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- Python >= 3.8 (only if you render a report file with scripts/render_report.py)
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- Python >= 3.8 (only if you render a report file with scripts/render_report.py)
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- Python >= 3.8 (only if you render a report file with scripts/render_report.py)
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- Python >= 3.8 (only if you render a report file with scripts/render_report.py)
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Intent-Code Divergence

High
Confidence
97% confidence
Finding
The skill repeatedly claims read-only behavior, but the required permissions include cms:InstallMonitoringAgent, which is a state-changing action. This widens the trust boundary and could lead to unauthorized software installation on cloud instances under the guise of observation.

Chaining Abuse

High
Category
Tool Misuse
Content
brew install aliyun-cli && brew upgrade aliyun-cli
# Linux
wget https://aliyuncli.alicdn.com/aliyun-cli-linux-latest-amd64.tgz
tar -xzf aliyun-cli-linux-latest-amd64.tgz && sudo mv aliyun /usr/local/bin/

aliyun version   # verify 3.x
```
Confidence
75% confidence
Finding
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Description-Behavior Mismatch

High
Confidence
98% confidence
Finding
The documentation explicitly instructs the skill to install a CloudMonitor agent when memory metrics are absent, which is a write/action operation rather than the claimed read-only observation behavior. This creates a dangerous mismatch between the skill's stated scope and its actual capability, allowing an observability request to trigger remote software changes on production infrastructure.

Context-Inappropriate Capability

High
Confidence
96% confidence
Finding
Including remote software installation capability in a reporting skill unnecessarily expands the attack surface and operational blast radius. Even if intended to improve observability, the ability to push an agent to cloud instances can alter system state, introduce compatibility or stability issues, and be abused under the guise of a harmless health check.

Lp3

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding
The skill describes reading and writing local files but does not declare tool scope or permissions boundaries. In an agent environment, missing explicit scoping increases the chance of unintended file access or file creation beyond what users expect, especially because the skill also writes handoff and report artifacts.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The skill says cost output must be actual billed cost only, yet also permits optional month-end projection. For financial reporting and operational decisions, mixing actuals with estimates can mislead users into treating speculative values as authoritative billing data.

Intent-Code Divergence

Medium
Confidence
97% confidence
Finding
The documentation contradicts itself on whether estimates are allowed, which creates ambiguous agent behavior and inconsistent outputs. In security-sensitive and billing-sensitive workflows, ambiguity increases the risk of incorrect downstream automation or user decisions based on mislabeled data.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
brew install aliyun-cli && brew upgrade aliyun-cli
# Linux
wget https://aliyuncli.alicdn.com/aliyun-cli-linux-latest-amd64.tgz
tar -xzf aliyun-cli-linux-latest-amd64.tgz && sudo mv aliyun /usr/local/bin/

aliyun version   # verify 3.x
```
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The skill instructs automatic monitoring-agent installation without warning or confirmation, so a user asking for status could unknowingly authorize a state-changing operation on live infrastructure. This violates user expectations for an observe-only workflow and removes an important consent checkpoint before modifying servers.

Description-Behavior Mismatch

Medium
Confidence
96% confidence
Finding
The skill is presented as an observational, mostly read-only capability, but it explicitly requests `cms:InstallMonitoringAgent`, which can modify the target ECS instance by installing software. That creates a privilege/behavior mismatch: a user or operator may grant the role assuming passive observation, while the skill can make system changes on production hosts.

Intent-Code Divergence

Medium
Confidence
94% confidence
Finding
The documentation downplays risk by stating permissions are read-only except one and implying Cloud Assistant usage is only for harmless checks, yet the included permission set still authorizes a non-read-only operation. This kind of misleading framing can cause reviewers to miss that the skill is capable of changing monitored systems, weakening informed consent and least-privilege review.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
Installing a CloudMonitor agent is not a purely observational act; it changes the host and may affect package state, processes, network behavior, or compliance posture. Because the documentation does not clearly warn users at the point of capability description, an operator could authorize or run the skill without realizing it may alter production infrastructure.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
Listing `cms:InstallMonitoringAgent` among required permissions without an adjacent warning normalizes a write-capable permission inside what users expect to be a read-only observer. In this skill context, that mismatch is more dangerous because the skill targets live cloud workloads where silent agent deployment may violate change-control expectations or operational policy.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The workflow directs the skill to append an `observe` event to `app_timeline.jsonl`, which is a local state mutation. That contradicts the stated read-only behavior in the skill metadata and expands the skill from observation into persistence, creating integrity and trust-boundary issues because a reporting skill can silently alter project records on disk.

Missing User Warnings

Low
Confidence
78% confidence
Finding
The skill description presents reporting as read-only observation, but later instructs the agent to write `observe_handoff.json` into the project directory when handing off to operate. Although entering operate is gated by user choice, the file-write side effect itself is not prominently disclosed in the top-level description or output summary, which could surprise users expecting no local changes from an observability skill.

Missing User Warnings

Low
Confidence
89% confidence
Finding
The markdown explains that the skill can export Markdown or HTML reports and render them to files such as `report.md`, but this filesystem write behavior is only described deep in the document. For a skill whose headline behavior is observational and read-only, local file creation should be explicitly disclosed as a user-impacting action.

Natural-Language Policy Violations

Low
Confidence
81% confidence
Finding
The document states that the skill uses Alibaba Cloud International and that prices are in USD, which imposes a specific regional/commercial context. It does not indicate that users may choose a different locale or regional cloud environment, so this can be read as a locale policy constraint without explicit opt-in.

Natural-Language Policy Violations

Low
Confidence
93% confidence
Finding
This code emits HTML with a fixed English language declaration regardless of the user's locale or the report content. The policy specifically calls out forced language or locale choices without opt-in as a natural-language policy violation.

Static analysis

No suspicious patterns detected.