Back to skill

Security audit

alibabacloud-actiontrail-diagnosis

Security checks for vulnerabilities and agentic risk

Overview

This read-only audit tool needs review because its credential handling can expose cloud secrets.

Review credential handling and require strict region validation before use. Until fixed, use an explicit CLI profile with verified region IDs and avoid environment credentials with the CLI backend. Use short-lived credentials limited to the two documented read-only APIs, keep queries narrow, and treat audit results as sensitive.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
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
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (9)

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, file_read, network, shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

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 · SKILL.md (reported line 12)May include surrounding context.

md
## Absolute Rules — read before doing anything

1. **Strictly READ-ONLY. Never write.** Under NO circumstances execute any command or API call that mutates state (`Create*`, `Update*`, `Modify*`, `Delete*`, `Disable*`, `Set*`, `Start*`, `Stop*`, …). This skill only queries ActionTrail audit events and the caller identity; any write-API attempt is a hard failure.
2. **Never output credentials.** Never print, cat, or quote credential files (`~/.aliyun/config.json`), environment variable values, AccessKey pairs, or STS tokens. Reference credential fields by name only; do not echo secrets into the conversation or the report.
3. **Ask before running when information is insufficient.** If a required input (region, time range, target product/event) is missing and cannot be safely defaulted, ask the user first — do NOT guess and run wide, unfiltered queries. UID is the only input that may always be auto-derived (see Information Completeness).
4. **Output must be based on real API returns. Nev

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

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

md
## Debug URL

https://api.aliyun.com/api/Actiontrail/2020-07-06/LookupEvents

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

python
file=sys.stderr,
    )
    try:
        subprocess.run(
            [sys.executable, "-m", "pip", "install", "requests>=2.20.0"],
            check=True,
            timeout=120,

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
98% confidence
Finding

Although the subprocess argument list prevents shell injection, its construction places the AccessKey secret and optional STS token directly in command-line arguments. Local processes with sufficient visibility, process-monitoring agents, or execution telemetry can capture those credentials and use their granted cloud permissions; read-only credentials would still expose sensitive audit information.

Content

Scanner excerpt · scripts/_cli.py (reported line 507)May include surrounding context.

python
cmd += [f"--{key}", str(value)]

    try:
        result = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout)
    except subprocess.TimeoutExpired:
        # A CLI-side timeout is treated as a network-level transient failure
        # so call_with_retry can back off and retry it.

Tainted flow: 'cmd' from os.environ.get (line 473, credential/environment) → subprocess.run (code execution)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/_cli.py (reported line 507)May include surrounding context.

python
cmd += [f"--{key}", str(value)]

    try:
        result = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout)
    except subprocess.TimeoutExpired:
        # A CLI-side timeout is treated as a network-level transient failure
        # so call_with_retry can back off and retry it.

Scope Creep

Low
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.

Content

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

md
| Product / event target (`--lookup-attribute`) | YES in practice | Ask which cloud service, event name, resource, or user to focus on; avoid unfiltered account-wide scans. Keys and values are case-sensitive; at most 2 conditions, combined with AND. Rules in [lookup-attribute.md](references/lookup-attribute.md). |
| `--uid` | NO | Auto-derived via STS `GetCallerIdentity` when omitted (5-25 digits). If the provided `--uid` differs from the credential's UID, the script prints an ACCOUNT MISMATCH WARNING — surface it explicitly to the user. |

Missing a required item → restate what is known, ask the user, and wait. Never silently expand scope beyond the confirmed region/time/product.

## CLI Options

The Friendly Summary is explicitly constrained to English without user opt-in.

Low
Category
Output Handling
Confidence
98% confidence
Finding

The docstring specifies that the user-facing Friendly Summary must be English, and the implementation uses fixed English report text. No language choice or opt-in is provided, and querying Alibaba Cloud audit events does not justify restricting the report's natural language.

Content

No source excerpt is available for this finding.

Unverifiable Dependency: requests has 16 known advisory(ies) (CVE-2014-1830 (Exposure of Sensitive Information to an Unauthorized Actor in Requests); CVE-2024-47081 (Requests vulnerable to .netrc credentials leak via malicious URLs); CVE-2024-35195 (Requests `Session` object does not verify requests after making first request wi) +13 more), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
88% confidence
Finding

The declared range permits historical Requests releases with known security vulnerabilities, and an already-installed vulnerable release can satisfy this requirement without being upgraded. This is a dependency-policy weakness in a credential-bearing HTTPS client, although the advisory count alone does not prove that the installed version or these specific request paths are exploitable.

Content

No source excerpt is available for this finding.