T03 · Remote Payload Retrieval and Execution
- Location
scripts/alibabacloud_waf_cname_config_export.py:36- Finding
Mutable Remote Installation Script Is Piped Directly to Bash
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill performs a coherent WAF configuration export, but its install and credential guidance creates avoidable security risk around cloud credentials and system-wide CLI installation.
Install only if you are comfortable reviewing and hardening the setup steps yourself. Use an already trusted Aliyun CLI installation, avoid curl-to-bash and unverified latest binaries, do not paste real access keys into commands or the agent session, prefer short-lived or role-based read-only credentials, and store the generated Excel file as sensitive infrastructure data.
scripts/alibabacloud_waf_cname_config_export.py:36Mutable Remote Installation Script Is Piped Directly to Bash
references/cli-installation-guide.md:39Unverified Mutable CLI Binaries Are Installed into a System-Wide Executable Path
references/cli-installation-guide.md:103Documentation Encourages Passing Cloud Credentials Through Command-Line Arguments
The script prints a one-line command that pipes a remotely fetched script directly into bash to install the CLI. Although not executed automatically, recommending curl | bash encourages unsafe supply-chain behavior: a compromised host, CDN, DNS path, or installer endpoint could lead to arbitrary code execution on the operator's machine.
try:
result = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout)
except FileNotFoundError:
print(" [Error] `aliyun` CLI not found. Install via: curl -fsSL https://aliyuncli.alicdn.com/setup.sh | bash")
sys.exit(1)
except subprocess.TimeoutExpired:
print(f" [Error] CLI command timed out after {timeout}s: {' '.join(args[:3])}...")
The skill invokes shell/CLI commands extensively but does not declare any tool scope such as allowed-tools or permissions. That omission weakens execution boundaries and reviewability, making it easier for an agent runtime to grant broader shell access than the skill function actually requires. In a skill that reads cloud configuration and writes files, missing scope increases the blast radius of misuse or prompt-injection-induced command execution.
The skill exports WAF domain, backend, certificate, and routing details into an Excel file but does not warn that the artifact contains sensitive infrastructure configuration. This increases the risk of accidental disclosure through insecure storage, email sharing, synced folders, or retention on multi-user systems. In this context, the exported data can materially aid reconnaissance of protected applications and backend topology.
The skill hard-codes a two-locale operating model centered on Chinese mainland and non-Chinese mainland regions, and later mandates querying both regardless of user intent. This imposes a locale-specific workflow rather than offering an opt-in choice or clearly scoping the skill as a region-specific compliance tool.
The skill mandates enabling Alibaba Cloud CLI AI-mode and setting a custom user-agent even though the export workflow only needs standard read-only API calls and local file generation. Requiring an unnecessary privileged or agent-integrated mode expands the attack surface, may alter how commands are processed or logged, and can create unintended data exposure channels during a task involving sensitive WAF configuration.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
tar -xzf aliyun-cli-macosx-latest-amd64.tgz
# Move to PATH
sudo mv aliyun /usr/local/bin/
# Verify
aliyun version
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
tar -xzf aliyun-cli-macosx-latest-amd64.tgz
# Move to PATH
sudo mv aliyun /usr/local/bin/
# Verify
aliyun version
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
tar -xzf aliyun-cli-macosx-latest-amd64.tgz
# Move to PATH
sudo mv aliyun /usr/local/bin/
# Verify
aliyun version
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
tar -xzf aliyun-cli-linux-latest-arm64.tgz sudo mv aliyun /usr/local/bin/
### Windows
The guide recommends non-interactive use of aliyun configure set with --access-key-secret on the command line, which exposes secrets to shell history, process listings, terminal logging, and CI job logs. In an agent/automation skill, this is more dangerous because users may copy-paste the example directly into scripts or orchestrated runs where plaintext credentials are captured persistently.
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.
1. Log in to Aliyun Console: https://ram.console.aliyun.com/
2. Navigate to: AccessKey Management
3. Create a new AccessKey pair
4. Save the secret immediately — it's only shown once
### Configuration Modes
The document shows plaintext credentials in both config-file JSON and environment-variable examples without prominently warning that these values are sensitive and may leak through source control, support bundles, screenshots, crash dumps, or inherited process environments. Although the values are placeholders, the pattern normalizes insecure secret handling and can lead operators to store real keys in recoverable plaintext locations.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# Restrict permissions
chmod 600 ~/.aliyun/config.json
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
if cli_profile:
cmd.extend(["--profile", cli_profile])
try:
result = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout)
except FileNotFoundError:
print(" [Error] `aliyun` CLI not found. Install via: curl -fsSL https://aliyuncli.alicdn.com/setup.sh | bash")
sys.exit(1)
The script writes detailed WAF configuration data, including domains, backends, ports, certificate identifiers, and resource-group metadata, to a local Excel file without warning or protections. In a security-admin context this data is sensitive infrastructure inventory and can materially aid reconnaissance if the file is stored insecurely or shared inadvertently.
The skill's stated workflow includes generating an Excel export file, which is a filesystem side effect. Saying 'No resources created — no cleanup needed' contradicts that behavior because the run does create an output artifact that may need user awareness or optional cleanup.
The verification instructions prescribe sheet names as "Chinese Mainland" and "Non-Chinese Mainland," which imposes a specific geographic/locale categorization in the skill's natural-language interface. The file does not offer alternative locale wording or explain why this terminology is required for a region-specific compliance context.
When no domains exist, the script still performs an unnecessary describe-domain-detail API call solely as a probe. This exceeds the documented export-only behavior and creates unexpected API activity that can confuse audits, trigger alerts, or violate least-privilege expectations in tightly controlled environments.
The inline comment claims the extra probe is required by SKILL.md, but that behavior is not consistent with the script's stated purpose. Misleading justification around unnecessary API calls is risky because it can normalize hidden side effects and make reviewers less likely to question unexpected behavior.
No suspicious patterns detected.