Back to skill

Security audit

Alibabacloud Cadt Deploy On Aliyun

Security checks for vulnerabilities and agentic risk

Overview

This Alibaba Cloud ECS deployment skill is coherent, but it has broad cloud command authority and implementation weaknesses that should be reviewed before installation.

Install only if you trust this publisher with Alibaba Cloud deployment authority. Use a tightly scoped RAM role, review every target region and ECS instance before confirming, avoid untrusted filenames or file-transfer metadata, and be aware that the current bootstrap and credential handling have supply-chain and local-exposure risks.

Vulnerability Patterns
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/cli/hooks/pre/EcsSendFile.py:67
Finding

Shell Injection in Oversized ECS File Transfer

Content
View full analysis
&2; exit 1; fi' ) lines.append(f'curl -sSfL -o "{target_path}" "{url}"') if file_mode: lines.append(f'chmod "{file_mode}" "{target_path}"') ``` Additional vulnerable interpolation occurs at `scripts/cli/hooks/pre/EcsSendFile.py:85-88`: ```python if file_owner or file_group: owner = file_owner or "" group = file_group or "" lines.append(f'chown "{owner}:{group}" "{target_path}"') ``` ### Technical Analysis When file content exceeds 32,000 characters, the hook uploads the content to OSS and constructs a shell script that is subsequently submitted to `EcsRunCommandSync`. The user-controlled values `targetDir`, `name`, `fileMode`, `fileOwner`, and `fileGroup` are inserted directly into shell commands. Enclosing a value in double quotes does not neutralize shell command substitution, embedded quotes, backticks, newlines, or other shell syntax. For example, a value containing `$(command)` remains executable inside double quotes. No strict allowlist validation or shell-safe quoting is applied before constructing the script. The injected script is then executed on every ECS instance listed in `instanceIds`. ### Attack Path 1. An attacker or untrusted deployment input supplies file content exceeding the 32,000-character threshold. 2. The attacker places shell syntax in a file-transfer field, such as: ```text targetDir=/tmp/$(malicious-command) ``` 3. `EcsSendFile.py` interpolates the value into: ```bash mkdir -p "/tmp/$(malicious-com ...[truncated 1162 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/cli/lib/oss_upload.py:185
Finding

Temporary OSS Credentials Exposed in Process Arguments

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/cli/cadt-deploy-on-aliyun.sh:32
Finding

Non-Reproducible Bootstrap Downloads Unpinned Build Dependencies

Content
View full analysis
=61.0"] build-backend = "setuptools.build_meta" ``` The direct runtime dependency is version-pinned: ```toml dependencies = [ "jsonschema==4.26.0", ] ``` However, no hash lock or complete transitive dependency lock is present. ### Technical Analysis The bootstrap automatically upgrades `pip` to the latest version available from the configured package index and installs the project in editable mode. The build requirement permits any `setuptools` release at or above version 61.0. Transitive dependencies are also resolved without a hash-locked dependency set. Python package installation and build backends can execute code during installation. Consequently, the effective code executed by bootstrap can change without any modification to this Skill's reviewed source tree. The hash used by the bootstrap covers only `pyproject.toml`; it does not prove the identity or integrity of packages downloaded from the package index. ### Attack Path 1. A user invokes the bootstrap on a new system or after `pyproject.toml` changes. 2. The script removes and recreates the virtual environment. 3. It downloads the current package-index version of `pip`. 4. Project installation resolves a compatible `setuptools` version and transitive dependencies without expected hashes. 5 ...[truncated 975 chars]
Remediation
View remediation
"] ``` 3. Generate a complete lock file covering direct and transitive dependencies. 4. Require package hashes during installation, for example through a hash-locked requirements file and: ```bash pip install --require-hashes -r requirements.lock ``` 5. Use an explicitly configured trusted package index rather than inheriting an arbitrary user or environment index configuration. 6. Consider distributing a prebuilt, signed wheel or a verified self-contained package rather than performing editable installation at runtime. 7. Verify downloaded artifacts using approved hashes or signatures before installation. 8. Include dependency integrity information in the virtual-environment rebuild hash so the cache reflects the exact resolved dependency set, not only `pyproject.toml`. ]]>
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
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (58)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

If the associated implementation reads command/script payloads from local files and supports command injection into EcsRunCommand while presenting itself mainly as a deployment workflow, that broadens it into generic remote code execution. In the context of ECS management, this could allow arbitrary shell execution on cloud instances and abuse of local files as command sources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

If the associated implementation reads command/script payloads from local files and supports command injection into EcsRunCommand while presenting itself mainly as a deployment workflow, that broadens it into generic remote code execution. In the context of ECS management, this could allow arbitrary shell execution on cloud instances and abuse of local files as command sources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

If the associated implementation reads command/script payloads from local files and supports command injection into EcsRunCommand while presenting itself mainly as a deployment workflow, that broadens it into generic remote code execution. In the context of ECS management, this could allow arbitrary shell execution on cloud instances and abuse of local files as command sources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

If the associated implementation reads command/script payloads from local files and supports command injection into EcsRunCommand while presenting itself mainly as a deployment workflow, that broadens it into generic remote code execution. In the context of ECS management, this could allow arbitrary shell execution on cloud instances and abuse of local files as command sources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

If the associated implementation reads command/script payloads from local files and supports command injection into EcsRunCommand while presenting itself mainly as a deployment workflow, that broadens it into generic remote code execution. In the context of ECS management, this could allow arbitrary shell execution on cloud instances and abuse of local files as command sources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

If the associated implementation reads command/script payloads from local files and supports command injection into EcsRunCommand while presenting itself mainly as a deployment workflow, that broadens it into generic remote code execution. In the context of ECS management, this could allow arbitrary shell execution on cloud instances and abuse of local files as command sources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

If the associated implementation reads command/script payloads from local files and supports command injection into EcsRunCommand while presenting itself mainly as a deployment workflow, that broadens it into generic remote code execution. In the context of ECS management, this could allow arbitrary shell execution on cloud instances and abuse of local files as command sources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

If the associated implementation reads command/script payloads from local files and supports command injection into EcsRunCommand while presenting itself mainly as a deployment workflow, that broadens it into generic remote code execution. In the context of ECS management, this could allow arbitrary shell execution on cloud instances and abuse of local files as command sources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

If the associated implementation reads command/script payloads from local files and supports command injection into EcsRunCommand while presenting itself mainly as a deployment workflow, that broadens it into generic remote code execution. In the context of ECS management, this could allow arbitrary shell execution on cloud instances and abuse of local files as command sources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

If the associated implementation reads command/script payloads from local files and supports command injection into EcsRunCommand while presenting itself mainly as a deployment workflow, that broadens it into generic remote code execution. In the context of ECS management, this could allow arbitrary shell execution on cloud instances and abuse of local files as command sources.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

If the associated implementation reads command/script payloads from local files and supports command injection into EcsRunCommand while presenting itself mainly as a deployment workflow, that broadens it into generic remote code execution. In the context of ECS management, this could allow arbitrary shell execution on cloud instances and abuse of local files as command sources.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The examples instruct the agent to ask the user for required deployment information in Chinese, but the file does not offer a language choice or explain a justified locale constraint. This creates a natural-language policy issue because it imposes a specific language on users without opt-in.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/deploy-modes.md (reported line 71)May include surrounding context.

md
├── scripts/  ────── copied to ──────>   ├── scripts/
│   ├── start.sh                         │   ├── start.sh
│   └── stop.sh                          │   └── stop.sh
├── app.jar                              ├── .env
└── ...                                  └── (runtime files)
       ^
       |

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/failure-codex.md (reported line 95)May include surrounding context.

md
├── scripts/  ────── copied to ──────>   ├── scripts/
│   ├── start.sh                         │   ├── start.sh
│   └── stop.sh                          │   └── stop.sh
├── app.jar                              ├── .env
└── ...                                  └── (runtime files)
       ^
       |

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · references/failure-codex.md (reported line 99)May include surrounding context.

md
├── scripts/  ────── copied to ──────>   ├── scripts/
│   ├── start.sh                         │   ├── start.sh
│   └── stop.sh                          │   └── stop.sh
├── app.jar                              ├── .env
└── ...                                  └── (runtime files)
       ^
       |

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% 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 · scripts/cli/lib/oss_upload.py (reported line 217)May include surrounding context.

python
raise HookReject(
            PRE_HOOK_REJECTED,
            f"Upload size mismatch: local={local_size} remote={remote_size} -> treated as upload failure",
            fix_hint=f"Suggest re-running; if multipart residual, manually run aliyun ossutil rm oss://{oss_bk}/{object_key}",
        )
    _info(f"Size verification passed ({local_size} bytes)")

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill declares no explicit tool scope or permission boundaries even though it is designed to use shell, file read/write, environment variables, and cloud CLIs. In a deployment skill, this lack of scoping increases the chance of overbroad execution, misuse of local secrets, and unintended command execution against cloud infrastructure.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger list is broad enough to activate on ordinary troubleshooting terms like 'diagnose', 'root cause', '502', or 'service not started', which may unintentionally invoke a high-privilege deployment skill. In this context, overbroad activation is dangerous because the skill can build artifacts, manipulate scripts, and interact with cloud infrastructure.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The phrase 'or similar troubleshooting keywords' makes intent routing ambiguous and allows discretionary escalation into a mutation-capable troubleshooting path. For a skill with remote deployment and command capabilities, fuzzy routing increases the risk that benign support requests trigger high-impact operational actions.

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

md
User: "i-bp1ai3ai0rpvx965zpw0"

# WRONG — agent auto-discovers region from CLI config (critical violation)
Agent runs: aliyun configure list → reads "cn-hangzhou" → proceeds without asking

# WRONG — agent auto-selects instance from API enumeration (critical violation)
Agent runs: aliyun ecs describe-instances → finds "order-api-ecs" → selects it without asking

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

md
User: "i-bp1ai3ai0rpvx965zpw0"

# WRONG — agent auto-discovers region from CLI config (critical violation)
Agent runs: aliyun configure list → reads "cn-hangzhou" → proceeds without asking

# WRONG — agent auto-selects instance from API enumeration (critical violation)
Agent runs: aliyun ecs describe-instances → finds "order-api-ecs" → selects it without asking

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill explicitly exposes generic remote command execution and file transfer primitives via ECS operations, which go beyond a narrowly scoped build/deploy workflow. In a cloud deployment context, those primitives can be repurposed to execute arbitrary shell commands on instances, move unauthorized payloads, and pivot from deployment automation into full remote administration.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
65% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/build-pipeline/README.md (reported line 49)May include surrounding context.

md
#### start.sh Background Execution Constraint (Redline 22)

The platform side calls `bash "scripts/start.sh"` in foreground, therefore **`start.sh` itself must start the application as a daemon (`nohup <cmd> &`, `setsid`, or framework-native `--daemon`), must not block in foreground**. Running in foreground directly (e.g., `python3 app.py`, `java -jar app.jar`) will cause the deploy script to hang, get killed by Cloud Assistant after 600s timeout, and the task is marked FAILURE (see R15 in [`failure-codex.md`](../failure-codex.md)).

P27 precheck scans `start.sh` content before script injection; if no `nohup` / `&` / `setsid` / `screen -dm` / `--daemon` / `--daemonize yes` background mode is detected, blocks (see [`quality-gates.md`](../quality-gates.md) P27). Full template in [`steps/step-2-build.md`](../../steps/step-2-build.md) §2.3.1.

Session Persistence

Medium
Category
Rogue Agent
Confidence
65% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/build-pipeline/README.md (reported line 60)May include surrounding context.

md
#### start.sh Background Execution Constraint (Redline 22)

The platform side calls `bash "scripts/start.sh"` in foreground, therefore **`start.sh` itself must start the application as a daemon (`nohup <cmd> &`, `setsid`, or framework-native `--daemon`), must not block in foreground**. Running in foreground directly (e.g., `python3 app.py`, `java -jar app.jar`) will cause the deploy script to hang, get killed by Cloud Assistant after 600s timeout, and the task is marked FAILURE (see R15 in [`failure-codex.md`](../failure-codex.md)).

P27 precheck scans `start.sh` content before script injection; if no `nohup` / `&` / `setsid` / `screen -dm` / `--daemon` / `--daemonize yes` background mode is detected, blocks (see [`quality-gates.md`](../quality-gates.md) P27). Full template in [`steps/step-2-build.md`](../../steps/step-2-build.md) §2.3.1.

Session Persistence

Medium
Category
Rogue Agent
Confidence
65% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/failure-codex.md (reported line 76)May include surrounding context.

md
#### start.sh Background Execution Constraint (Redline 22)

The platform side calls `bash "scripts/start.sh"` in foreground, therefore **`start.sh` itself must start the application as a daemon (`nohup <cmd> &`, `setsid`, or framework-native `--daemon`), must not block in foreground**. Running in foreground directly (e.g., `python3 app.py`, `java -jar app.jar`) will cause the deploy script to hang, get killed by Cloud Assistant after 600s timeout, and the task is marked FAILURE (see R15 in [`failure-codex.md`](../failure-codex.md)).

P27 precheck scans `start.sh` content before script injection; if no `nohup` / `&` / `setsid` / `screen -dm` / `--daemon` / `--daemonize yes` background mode is detected, blocks (see [`quality-gates.md`](../quality-gates.md) P27). Full template in [`steps/step-2-build.md`](../../steps/step-2-build.md) §2.3.1.

Static analysis

Detected: suspicious.dynamic_code_execution, suspicious.generated_source_template_injection

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
scripts/cli/lib/hooks.py:46

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
scripts/cli/tests/test_smoke.py:314

User-controlled placeholder is embedded directly into generated source code.

Critical
Code
suspicious.generated_source_template_injection
Location
references/build-pipeline/build-commands.md:29