Back to skill

Security audit

Alibabacloud Chatapp Message Send

Security checks for vulnerabilities and agentic risk

Overview

The skill largely matches its Alibaba Cloud messaging purpose, but it should be reviewed because it asks users to send real outbound messages while also using unsafe install/update guidance, broad cloud permissions, and risky credential-handling examples.

Install only if you intentionally need Alibaba Cloud CAMS message sending. Use a verified, pinned Aliyun CLI and CAMS plugin instead of curl|bash or automatic updates, remove bulk-message permission unless needed, avoid --yes for agent-run sends, and never place real access keys or STS tokens in chat, command arguments, logs, or committed files. Treat custom-message dry-run as potentially making a real Alibaba Cloud message-history query unless that behavior is fixed.

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

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:34
Finding

Unverified Remote Installation Script Is Executed Directly by Bash

Content
View full analysis
**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, > or see `references/cli-installation-guide.md` for installation instructions. ``` ### Technical Analysis The installation command sends content retrieved from an external URL directly to Bash. It provides no opportunity to inspect the script and performs no checksum, digital-signature, or pinned-version verification. Although the domain appears related to Alibaba Cloud, relying on HTTPS and a recognizable hostname does not establish the integrity of a mutable remote script. The effective code executed by the Skill can change after the reviewed package has been published. Compromise of the hosting infrastructure, account, release pipeline, DNS resolution, TLS trust path, or remote script can therefore convert this prerequisite into arbitrary code execution. The command executes with the privileges of the user running the Skill. If the Skill is run by a privileged account, the remote payload receives those elevated privileges. ### Attack Path 1. An attacker compromises the remote script, its publication pipeline, or another component in its delivery path. 2. A user loads the Skill on a host where Aliyun CLI is absent or outdated. 3. The Skill instructs the user or Agent to execute the `curl | bash` command. 4. `curl` retrieves the attacker-controlled content. 5. Bash executes the content immediately without integrity validation or review. 6. The payload can access the user's files, credentials, cloud configuration, and network privileges and may attempt further system compromise. ### Impact Assessment Successful exploitation permits arbitrary command executio ...[truncated 519 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Error
Location
SKILL.md:39
Finding

Mutable and Unverified CLI and Plugin Dependencies Are Installed or Updated

Content
View full analysis
**Pre-check: Aliyun CLI plugin update required** > [MUST] run `aliyun configure set --auto-plugin-install true` to enable automatic plugin installation. > [MUST] run `aliyun plugin update` to ensure that any existing plugins are always up-to-date. ``` ```markdown ### 2. Install cams Plugin ```bash aliyun plugin install --names aliyun-cli-cams ``` ``` From `references/cli-installation-guide.md`: ```bash # Download wget https://aliyuncli.alicdn.com/aliyun-cli-macosx-latest-amd64.tgz # Extract tar -xzf aliyun-cli-macosx-latest-amd64.tgz # Move to PATH sudo mv aliyun /usr/local/bin/ ``` The Linux instructions similarly download mutable `latest` archives and then place the extracted executable in `/usr/local/bin` using `sudo`. ### Technical Analysis The Skill mandates automatic plugin installation and unconditional plugin updating. Neither operation identifies an approved plugin version or verifies a cryptographic digest or publisher signature. The installation guide also downloads artifacts identified as `latest`, extracts them, and installs the resulting executable without integrity validation. This makes the execution environment dependent on mutable upstream content that can change independently of the reviewed Skill. Unconditional updates are not required for each message-send or template-query operation and expand the supply-chain attack surface. The use of `sudo mv` places an unverified executable into a system-wide command path. That substantially increases impact because all users and automation resolving `aliyun` through `/usr/local/bin` may subsequently execute the replaced binary. ### Attack Path 1. An attacker compromises the plugin repositor ...[truncated 1134 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
references/ram-policies.md:7
Finding

Recommended RAM Policy Grants Unused Bulk-Messaging Permission

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/send_chatapp_message.py:228
Finding

Dry-Run Mode Still Queries Recent Message History

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
references/cli-installation-guide.md:102
Finding

Credential Guide Encourages Secrets in Process Arguments and Automation Logs

Content
View full analysis
\ --access-key-secret \ --region cn-hangzhou ``` The guide then recommends this pattern for automated environments: ```markdown All `aliyun configure` commands support non-interactive flags, which is the recommended approach — it works in scripts, CI/CD pipelines, and agent-driven automation without hanging on stdin prompts. ``` Additional examples similarly pass access-key secrets, STS tokens, and private-key paths through command-line flags. ### Technical Analysis Passing credentials through command-line arguments can expose them through several channels: - Shell history. - CI/CD command logs. - Agent execution traces. - Process accounting and endpoint telemetry. - Debug output and error reports. - Process inspection on operating systems where arguments are visible to other users or monitoring tools. The guide explicitly recommends non-interactive flags for scripts, CI/CD, and agent-driven automation, where command capture and centralized logging are common. This conflicts with the stronger security requirements in `SKILL.md`, which prohibit asking users to enter access keys in the conversation or command line and prohibit using `aliyun configure set` with literal credential values. The example values appear to be placeholders rather than live credentials. The finding concerns the unsafe credential-handling pattern, not a hardcoded working secret. ### Attack Path 1. A user follows the installation guide and substitutes a real access key, secret, or STS token into the example command. 2. The command is entered in a shell, CI job, or Agent-driven ...[truncated 1098 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
Findings (28)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The code chunk’s actual behavior is limited to querying and displaying available ChatApp templates using aliyun cams list-chatapp-template. This aligns only with the narrow part of the description about viewing available message templates. However, the declared purpose primarily presents the skill as a WhatsApp message sending tool supporting template and custom message delivery, replies, broadcasts, campaigns, and verification codes. None of those sending or messaging actions are implemented in this code. Additionally, the code supports filtering for VIBER templates, which is broader than the WhatsApp-specific description. Therefore, the supplied code does not accurately represent the broader declared functionality and is a material mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The core declared purpose of sending WhatsApp template and custom messages is accurately represented by the code. However, there are material gaps and an extra capability. The code also supports Viber, which is not mentioned in the description. More importantly, the description claims the skill can be used to view available message templates and query template structure/variables, but the provided code contains no functionality for listing templates or inspecting template metadata. It only has two subcommands: send-template and send-message. Additionally, while the description references broadcasts, marketing campaigns, verification codes, and replies, those are only use-case examples of sending messages rather than distinct implemented features; the code does not provide campaign/broadcast management logic. Because of the missing template-query capabilities and the undeclared Viber support plus message-history query behavior, this is a description/behavior mismatch.

Content

No source excerpt is available for this finding.

External Script Fetching

High
Category
Supply Chain
Confidence
99% confidence
Finding

The skill instructs running curl -fsSL https://aliyuncli.alicdn.com/setup.sh | bash, which fetches and immediately executes remote code without integrity verification. In an agent or automated environment, this is especially dangerous because compromise of the source, network path, or mirror could lead to arbitrary code execution with the user's privileges.

Content

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

md
> **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,
> or see `references/cli-installation-guide.md` for installation instructions.
>
> **Pre-check: Aliyun CLI plugin update required**

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill documents shell-based execution (aliyun, python, curl | bash) but does not declare any tool scope such as allowed tools or permissions. This increases the chance that an agent platform will expose broader execution capability than intended, making high-risk actions like software installation, plugin updates, and message sending possible without explicit confinement.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The activation text is very broad for a high-impact skill that can send outbound messages and install/update CLI components. Overbroad triggering can cause the skill to be selected for generic messaging requests, increasing the chance of unintended external actions or misuse in contexts where a safer read-only skill should have been used.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
96% confidence
Finding

The documented --yes flag allows bypassing pre-send confirmation for an operation that sends external WhatsApp messages. In agent contexts, confirmation is a critical safeguard against accidental, unauthorized, or prompt-influenced outbound messaging, so providing a skip-confirm path materially increases abuse risk.

Content

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

--content '{"text":"Hello"}'

text

**Skip confirmation and send directly:**

```bash
python scripts/send_chatapp_message.py send-template ... --yes

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

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

md
### aliyun cams send-chatapp-message Parameters

| Parameter         | Required              | Description                                                                                                  |
| ----------------- | --------------------- | ------------------------------------------------------------------------------------------------------------ |
| --channel-type    | Yes                   | Channel type:`whatsapp` / `viber`                                                                        |
| --type            | Yes                   | Message type:`template` (template message) / `message` (custom message)                                  |

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest description repeatedly scopes the skill to WhatsApp messaging and related template operations, but the parameter reference explicitly documents --channel-type as supporting whatsapp / viber. That expands the operational behavior beyond the stated platform-specific purpose rather than serving as an implementation detail of WhatsApp sending.

Content

No source excerpt is available for this finding.

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

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

md
| --type            | Yes                   | Message type:`template` (template message) / `message` (custom message)                                  |
| --from            | Yes                   | Sender phone number, numeric digits only, must be registered and approved in console (e.g.`8613867404376`) |
| --to              | Yes                   | Recipient phone number, numeric digits with country code**without `+`** (e.g. `8619521605234`)     |
| --template-code   | Required for template | Template code                                                                                                |
| --biz-language    | Required for template | Template language, e.g.`en`, `zh_CN`                                                                     |
| --template-params | No                    | Template variables in format `key=value`, multiple separated by spaces                                     |
| --message-type    | Required for custom   | Content type:`text`/`image`/`video`/`audio`/`document`/`interactive`/`location` etc.           |

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

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

md
| --template-params | No                    | Template variables in format `key=value`, multiple separated by spaces                                     |
| --message-type    | Required for custom   | Content type:`text`/`image`/`video`/`audio`/`document`/`interactive`/`location` etc.           |
| --content         | Required for custom   | Message content as a JSON string                                                                             |
| --cust-space-id   | No                    | ISV account space ID                                                                                         |
| --user-agent      | Yes                   | Fixed value `AlibabaCloud-Agent-Skills/alibabacloud-chatapp-message-send`                                  |

### Custom Message Content JSON Formats

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

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

md
### Common Error Codes

| Error Code                       | Description                 | Resolution                                                                                 |
| -------------------------------- | --------------------------- | ------------------------------------------------------------------------------------------ |
| InvalidParameter.FromOnlyNumeric | Phone number contains `+` | API requires pure numeric format, remove `+`, e.g. `8613867404376`                     |
| TemplateNotFound                 | Template does not exist     | Confirm template code and language are correct                                             |

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/cli-installation-guide.md (reported line 30)May include surrounding context.

md
tar -xzf aliyun-cli-macosx-latest-amd64.tgz

# Move to PATH
sudo mv aliyun /usr/local/bin/

# Verify
aliyun version

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/cli-installation-guide.md (reported line 45)May include surrounding context.

md
tar -xzf aliyun-cli-macosx-latest-amd64.tgz

# Move to PATH
sudo mv aliyun /usr/local/bin/

# Verify
aliyun version

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/cli-installation-guide.md (reported line 58)May include surrounding context.

md
tar -xzf aliyun-cli-macosx-latest-amd64.tgz

# Move to PATH
sudo mv aliyun /usr/local/bin/

# Verify
aliyun version

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/cli-installation-guide.md (reported line 71)May include surrounding context.

Extract and install

tar -xzf aliyun-cli-linux-latest-arm64.tgz sudo mv aliyun /usr/local/bin/

text

### Windows

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% 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/cli-installation-guide.md (reported line 118)May include surrounding context.

md
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

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The guide later states 'Never Commit Credentials' and recommends protecting ~/.aliyun/config.json, yet earlier sections include concrete-looking access key IDs and secrets in command examples and a sample config file. Even if intended as placeholders, this documentation contradicts its own stated safety guidance by modeling secret material inline in content that would itself be committed to the repository.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/cli-installation-guide.md (reported line 404)May include surrounding context.

bash
# Restrict permissions
chmod 600 ~/.aliyun/config.json

Troubleshooting

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/get_template_detail.py (reported line 26)May include surrounding context.

python
cmd.extend(args)

    try:
        result = subprocess.run(cmd, capture_output=True, text=True, timeout=60)
    except subprocess.TimeoutExpired:
        print("Error: CLI command timed out after 60 seconds. Please check your network or try again later.", file=sys.stderr)
        sys.exit(1)

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/list_templates.py (reported line 25)May include surrounding context.

python
cmd.extend(args)

    try:
        result = subprocess.run(cmd, capture_output=True, text=True, timeout=60)
    except subprocess.TimeoutExpired:
        print("Error: CLI command timed out after 60 seconds. Please check your network or try again later.", file=sys.stderr)
        sys.exit(1)

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/send_chatapp_message.py (reported line 45)May include surrounding context.

python
cmd.extend(args)

    try:
        result = subprocess.run(cmd, capture_output=True, text=True, timeout=60)
    except subprocess.TimeoutExpired:
        print("Error: CLI command timed out after 60 seconds. Please check your network or try again later.", file=sys.stderr)
        sys.exit(1)

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/send_chatapp_message.py (reported line 112)May include surrounding context.

python
cmd.extend(args)

    try:
        result = subprocess.run(cmd, capture_output=True, text=True, timeout=60)
    except subprocess.TimeoutExpired:
        print("Error: CLI command timed out after 60 seconds. Please check your network or try again later.", file=sys.stderr)
        sys.exit(1)

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest says the skill can 'view available message templates' and 'query template structure and variables', but this script implements only send-template and send-message flows plus a recent-message lookup for deduplication. There is no code here to list templates or inspect template schemas, so the claimed functionality does not match this file's actual behavior.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

The --yes flag removes the interactive confirmation barrier before sending outbound WhatsApp or Viber messages. In an agent skill context, this increases the risk of unintended, unauthorized, or mass messaging if upstream orchestration passes recipient/content values incorrectly or is prompt-manipulated into sending without meaningful user confirmation.

Content

Scanner excerpt · scripts/send_chatapp_message.py (reported line 291)May include surrounding context.

python
tmpl_parser.add_argument("--region", help="Region, e.g. cn-hangzhou, ap-southeast-1")
    tmpl_parser.add_argument("--task-id", help="Custom task ID passed to API as-is (no auto-generation)")
    tmpl_parser.add_argument("--dry-run", action="store_true", help="Preview command only, do not actually send")
    tmpl_parser.add_argument("--yes", action="store_true", help="Skip confirmation and send directly")
    tmpl_parser.set_defaults(func=cmd_send_template)

    # Custom message subcommand

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skipping confirmation for custom message sends is riskier than template sends because arbitrary JSON content can be transmitted directly to end users. In an autonomous agent setting, that enables accidental spam, social engineering content, or disclosure of sensitive text if the agent is induced to send messages without a final human approval step.

Content

Scanner excerpt · scripts/send_chatapp_message.py (reported line 308)May include surrounding context.

python
msg_parser.add_argument("--region", help="Region, e.g. cn-hangzhou, ap-southeast-1")
    msg_parser.add_argument("--task-id", help="Custom task ID passed to API as-is (no auto-generation)")
    msg_parser.add_argument("--dry-run", action="store_true", help="Preview command only, do not actually send")
    msg_parser.add_argument("--yes", action="store_true", help="Skip confirmation and send directly")
    msg_parser.set_defaults(func=cmd_send_message)

    args = parser.parse_args()

Static analysis

No suspicious patterns detected.