Back to skill

Security audit

alibabacloud-agentloop-evaluation

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly transparent and aligned with AgentLoop evaluation, but it needs Review because it can run authenticated Alibaba Cloud mutations and includes overbroad endpoint and installation/update behavior.

Install only if you trust the Alibaba Cloud CLI/plugin update path and will use least-privilege Alibaba Cloud credentials. Review any workflow spec before execution, avoid custom endpoint overrides unless administratively approved, keep dry-run previews and explicit confirmation, and store output files containing evaluation content in a private directory.

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/agentloop_eval.py:227
Finding

Unrestricted Endpoint Override Can Redirect Authenticated Cloud Requests

Content
View full analysis
None: if region: command.extend(["--region", region]) if endpoint: command.extend(["--endpoint", endpoint]) ``` ```python def command_run(args: argparse.Namespace) -> int: spec = load_spec(args.spec) agent_space = str(spec.get("agent_space", "")) region = spec.get("region") endpoint = spec.get("endpoint") task = normalize_task(spec, args.allow_unbounded, args.allow_continuous) actions = evaluator_actions(spec) evaluator_commands = [ command for definition in actions if (command := build_evaluator_command(agent_space, definition, region, endpoint)) is not None ] task_command = build_task_command(agent_space, task, region, endpoint) ``` The specification documentation exposes the same field: ```markdown | `region` | no | Aliyun endpoint-selection region | | `endpoint` | no | Explicit AgentLoop service endpoint | ``` ### Technical Analysis The wrapper accepts `endpoint` directly from a workflow specification and passes it to every relevant Aliyun CLI command without validating: - The URI scheme. - Whether TLS is required. - The destination hostname. - Whether the hostname belongs to an approved Alibaba Cloud domain. - Whether the endpoint is an IP address, loopback address, link-local address, or private network address. These commands use the active Aliyun CLI credential profile and may carry signed authentication metadata. Mutation calls can also carry evaluator configurations, prompts, task filters, supplied evaluation records, tags, and other customer-controlled content. Using an endpoint override can be legitimate for official regional ...[truncated 1583 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
references/cli-installation-guide.md:10
Finding

Mutable Remote Installer and Broad Plugin Updates Lack Cryptographic Integrity Pinning

Content
View full analysis
[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. ``` ### Technical Analysis The installation guide does **not** pipe `curl` output directly into Bash. The static scanner’s literal `curl | bash` warning is therefore a false positive caused by explanatory text warning users not to use that pattern. However, the documented process still downloads a mutable remote shell script and executes it without cryptographic integrity verification. Manual inspection with `less` is not a reliable substitute for: - A pinned version. - A vendor-published SHA-256 digest. - A detached digital signature. - A verified package-manager signature. The instructions also enable automatic plugin installation and mandate updating all installed plugins. Updating unrelated plugins exceeds the minimum dependency changes required for this Skill, which only needs the AgentLoop plugin and, for result analysis, the SLS plugin. ### Attack Path 1. An attacker compromises the installer distribution origin, CDN, publishing credentials, DNS resolution, or upstream release process. 2. The mut ...[truncated 1193 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/agentloop_eval.py:1044
Finding

Sensitive Evaluation Results Are Written Without Restrictive File Permissions or Symlink Protection

Content
View full analysis
None: if path is None: return path.parent.mkdir(parents=True, exist_ok=True) path.write_text(json.dumps(value, ensure_ascii=False, indent=2) + "\n", encoding="utf-8") print(f"Wrote result: {path.resolve()}") ``` The analyzer can include raw customer content in that output: ```python if include_content: result.update( { "evaluationProcess": row.get("evaluation_process"), "input": eval_info.get("input"), "output": eval_info.get("output"), "expectedOutput": eval_info.get("expected_output") or eval_info.get("ground_truth"), "evalInfo": eval_info, "customOutputs": custom_outputs, } ) ``` The corresponding command-line option is: ```python parser.add_argument( "--include-content", action="store_true", help="include raw eval_info, evaluation process, and custom outputs after authorization", ) parser.add_argument("--preview", action="store_true", help="render queries without SLS calls") parser.add_argument("--output", type=Path, help="write preview or analysis JSON") ``` ### Technical Analysis `Path.write_text()` creates files according to the process umask and does not guarantee owner-only permissions. In environments with a permissive umask, result files may be readable by other local users. The function also does not reject symbolic links or verify that an existing destination is a regular file. If an attacker can prepare the output path, the write can follow a symlink and overwrite another file writable by the victim. This is security-sensitive because output may contain: - Full task creation and po ...[truncated 1704 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • Rogue AgentSelf-Modification, Session Persistence
Findings (27)

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

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

md
**Pre-check: Aliyun CLI >= 3.3.3 required**
> [MUST] Verify: `aliyun version` — must be >= 3.3.3.
> - **First install or major upgrade:** Download, review, then execute the [setup script](references/cli-installation-guide.md#first-time-install-or-major-upgrade). Avoid `curl | bash` piping.
> - **Routine update (CLI >= 3.3.5):** `aliyun upgrade` — prefer this built-in self-update over re-running the install script.
> - See [references/cli-installation-guide.md](references/cli-installation-guide.md) for full installation instructions.

Self-Modification

High
Category
Rogue Agent
Confidence
91% confidence
Finding

The skill instructs the operator to run self-update mechanisms such as aliyun upgrade and aliyun plugin update. Allowing an agent-driven workflow to alter its own CLI/plugin execution substrate expands trust to newly downloaded code and can introduce supply-chain risk, version drift, or malicious plugin behavior before subsequent cloud commands run.

Content

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

md
**Pre-check: Aliyun CLI >= 3.3.3 required**
> [MUST] Verify: `aliyun version` — must be >= 3.3.3.
> - **First install or major upgrade:** Download, review, then execute the [setup script](references/cli-installation-guide.md#first-time-install-or-major-upgrade). Avoid `curl | bash` piping.
> - **Routine update (CLI >= 3.3.5):** `aliyun upgrade` — prefer this built-in self-update over re-running the install script.
> - See [references/cli-installation-guide.md](references/cli-installation-guide.md) for full installation instructions.

**Pre-check: Aliyun CLI plugin update required**

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| `SKILL_DIR` | yes | Absolute path to this skill directory (containing `SKILL.md`) |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| `SKILL_DIR` | yes | Absolute path to this skill directory (containing `SKILL.md`) |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
This skill requires AgentLoop and SLS permissions. See [references/ram-policies.md](references/ram-policies.md) for the full permission list.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
This skill requires AgentLoop and SLS permissions. See [references/ram-policies.md](references/ram-policies.md) for the full permission list.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
This skill requires AgentLoop and SLS permissions. See [references/ram-policies.md](references/ram-policies.md) for the full permission list.

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

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

bash
# Step 1: Download the setup script
curl -fsSL --connect-timeout 10 --max-time 120 -o /tmp/aliyun-cli-setup.sh https://aliyuncli.alicdn.com/setup.sh

# Step 2: Review the script contents before running it
less /tmp/aliyun-cli-setup.sh

Self-Modification

High
Category
Rogue Agent
Confidence
90% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

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

Routine update (CLI >= 3.3.5)

Prefer the built-in self-update subcommand:

bash
aliyun upgrade

Self-Modification

High
Category
Rogue Agent
Confidence
90% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · references/related-commands.md (reported line 39)May include surrounding context.

md
| Product | CLI Command | Description |
|---------|-------------|-------------|
| CLI | `aliyun version` | Check CLI version (>= 3.3.3 required) |
| CLI | `aliyun upgrade` | Self-update CLI (>= 3.3.5) |
| CLI | `aliyun plugin show --name aliyun-cli-agentloop` | Verify AgentLoop plugin installed |
| CLI | `aliyun plugin show --name aliyun-cli-sls` | Verify SLS plugin installed |
| CLI | `aliyun plugin update` | Update all installed plugins |

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
97% confidence
Finding

The skill invokes shell commands, reads environment variables, and writes files, but it does not declare any tool scope or permission boundary. In an agent environment, that omission weakens enforcement and review, making it easier for the skill to access capabilities broader than intended, including cloud-mutating commands.

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

--spec /path/to/evaluation.json --execute

text

### Read-only operations (no confirmation needed)

`doctor`, `discover`, `status`, and `analyze` (result analysis) are read-only
and do not require the confirmation protocol.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

At L297 the document states 'This skill does not automate delete, cancel, or terminate operations,' but the immediately following cleanup instructions provide concrete command sequences to terminate tasks and delete tasks/evaluators. That is an active contradiction in the skill's own documentation about whether such destructive operations are part of its supported behavior.

Content

No source excerpt is available for this finding.

Context Window Stuffing

Medium
Category
Memory Poisoning
Confidence
85% confidence
Finding

Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.

Content

Scanner excerpt · references/api-map.md (reported line 53)May include surrounding context.

md
### Batch evaluation

Use `taskMode=batch`, a bounded `dataFilter.maxRecords`, and a backfill window in epoch milliseconds. For trace data, the service fills the SLS project and `storeName=logstore-tracing`; set `config.dataScope=trace` for trace-level evaluation.

For dataset data, set `dataType=dataset` and identify the existing dataset with `config.datasetName` or `config.storeName`. The service normalizes `datasetName` to `storeName`; `config.project` is not required. Treat `dataFilter.query` as an SQL condition without `WHERE`, and map evaluator variables directly to dataset columns.

Context Window Stuffing

Medium
Category
Memory Poisoning
Confidence
85% confidence
Finding

Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.

Content

Scanner excerpt · scripts/agentloop_eval.py (reported line 387)May include surrounding context.

python
### Batch evaluation

Use `taskMode=batch`, a bounded `dataFilter.maxRecords`, and a backfill window in epoch milliseconds. For trace data, the service fills the SLS project and `storeName=logstore-tracing`; set `config.dataScope=trace` for trace-level evaluation.

For dataset data, set `dataType=dataset` and identify the existing dataset with `config.datasetName` or `config.storeName`. The service normalizes `datasetName` to `storeName`; `config.project` is not required. Treat `dataFilter.query` as an SQL condition without `WHERE`, and map evaluator variables directly to dataset columns.

Unrestricted Tool Access

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill grants unrestricted tool access without appropriate constraints. An agent with unfettered tool access can perform arbitrary actions including file modification, network requests, and code execution.

Content

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

/bin/bash /tmp/aliyun-cli-setup.sh

text

> **Security note:** Avoid piping `curl` output directly into `bash` (`curl ... | bash`), as a compromised server or intercepted connection could execute arbitrary code on your machine. Always download, review, then execute.

## Routine update (CLI >= 3.3.5)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest fixes the region to "cn-hangzhou", which is a locale-specific setting and may force a particular deployment region without any opt-in or explanation. Under policy checks, locale or region restrictions should be user-selectable or clearly justified when the file is not explicitly documented as region-specific.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

This markdown file documents a delete operation for evaluators but provides no warning about data loss, irreversibility, or the need to confirm scope before running it. Under the markdown-specific warning criteria, destructive behaviors that could affect user data or system integrity should be accompanied by a warning.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The file lists a command that deletes an evaluator skill but does not disclose the impact on stored skill data or configuration. Because this markdown serves as user-facing command guidance, destructive actions should include an explicit warning.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

Deleting an evaluation task can affect persisted task state and operational history, yet the markdown provides no cautionary note. This omission leaves users uninformed about a potentially irreversible action affecting their data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The command list includes deletion of evaluation runs without any disclosure that results or run records may be permanently removed. Markdown documentation for such data-affecting behavior should warn users about the consequences.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The verification instructions include an execution path that creates remote evaluation tasks and writes full results to a local file, but they do not prominently warn the operator about side effects, possible API charges, or that evaluation inputs/outputs may contain sensitive data. In a verification document, this omission can lead users to run live operations unintentionally against real environments or persist sensitive results in insecure locations.

Content

No source excerpt is available for this finding.

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

python
_validate_command(command)
    print(f"+ {display_command(command)}", flush=True)
    try:
        proc = subprocess.run(
            command,
            text=True,
            capture_output=True,

Vague Triggers

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This JSON manifest describes a task and its purpose but provides no explicit trigger phrases, invocation constraints, or negative examples clarifying when this configuration should be used versus not used. For manifest files, the absence of trigger scope can make activation or selection criteria overly broad or ambiguous.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The example input, output, and expected_output are all fixed in Chinese, which can indicate a language-specific constraint in the skill artifact. Because the file does not offer any language/locale opt-in or explain that this is a China-specific example, it may conflict with policies requiring user choice or documented locale justification.

Content

No source excerpt is available for this finding.