Back to skill

Security audit

Alibabacloud Agentbay Aio Skills

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent remote code-execution helper, but users should understand it needs an AgentBay SDK/API key and may create local chart files.

Install only in an isolated Python environment, review or pin the AgentBay SDK version before use, provide only the AgentBay API key required for the service, and expect generated plot images to be saved in the current working directory when using non-JSON chart output.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (1)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:23
Finding

Unpinned Third-Party SDK Creates a Supply-Chain Risk

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 23–35
Vulnerability Type: Unpinned third-party dependency installation
Risk Level: Medium

Vulnerable Code

markdown
## Prerequisites

| Dependency | Version | Purpose |
|---|---|---|
| Python | >= 3.8 | Runtime |
| wuying-agentbay-sdk | >= 1.0.0 | AgentBay SDK for sandbox code execution |

## Setup

The script requires `wuying-agentbay-sdk` installed locally. Install it before first use:

```bash
pip install wuying-agentbay-sdk
text

### Technical Analysis

The Skill directs users or agents to install `wuying-agentbay-sdk` without pinning it to a reviewed version or verifying package integrity with cryptographic hashes. The declared constraint of `>=1.0.0` permits pip to select any compatible present or future release.

The SDK is legitimately required for the Skill's declared remote sandbox functionality, and no evidence indicates that the current package name is a typosquat. Nevertheless, Python package installation can execute package build and installation logic on the local system. Trusting all future compatible releases therefore extends the Skill's local execution trust boundary beyond the reviewed project.

The documentation also does not specify a locked dependency set, a trusted package index, hashes, or a reproducible installation procedure. A compromise of the package publisher, package repository, release process, or an unreviewed future dependency release could consequently introduce code not present during this audit.

### Attack Path

1. An attacker compromises the SDK publisher account, distribution channel, build process, or a transitive dependency.
2. The attacker publishes a malicious release that satisfies the permissive `>=1.0.0` version constraint.
3. A user or agent follows the documented `pip install wuying-agentbay-sdk` instruction.
4. Pip resolves and downloads the malicious compatible release.
5. Malicious installation or runtime code execute
...[truncated 1235 chars]
Remediation
View remediation

Remediation Suggestions

  1. Pin the SDK to an exact reviewed version, for example:

    bash
    python -m pip install "wuying-agentbay-sdk==REVIEWED_VERSION"
    
  2. Generate and publish a lockfile containing all transitive dependencies and exact versions.

  3. Record cryptographic hashes and require hash verification during installation:

    bash
    python -m pip install --require-hashes -r requirements.txt
    
  4. Explicitly identify the trusted package index and prevent fallback to unintended indexes where operationally possible.

  5. Review new SDK versions and their transitive dependencies before updating the pin.

  6. Run dependency vulnerability and provenance checks in CI.

  7. Prefer installation in an isolated, least-privileged environment rather than a shared system Python environment.

  8. Avoid installing dependencies with administrator or root privileges.

  9. Document a controlled upgrade process so users do not replace the reviewed version with the latest release automatically.

Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (10)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
## Information Security

Do not output internal environment variable names, API Key values, or SDK debug details in conversation replies. When executing scripts, use `--json` mode and display only the `result` and `error_message` fields to users. The raw SDK output may contain internal fields (session identifiers, request IDs, access credentials) that should not be exposed to users or written to output files.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill performs sensitive actions including shell execution, file reads/writes, and likely access to local environment/config files, but it declares no explicit tool scope or permission boundaries. In an agent setting, this increases the chance the skill is invoked with broader-than-necessary authority, enabling unintended local actions or exposure of host-side data while handling untrusted user code requests.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger text is extremely broad ('run', 'execute', 'evaluate code', plotting, analysis) and can match many ordinary requests without clear guardrails. That raises the risk of over-invocation of a high-capability skill, causing unnecessary code execution flows, package installation attempts, file handling, or transmission of user-supplied code to a remote sandbox when a safer/non-executing response would suffice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The wrapper forcibly rewrites Python/matplotlib behavior, including backend selection, font cache manipulation, direct font loading, and conditional package installation based on detected characters. In a code-execution skill, silently modifying submitted code is risky because it breaks user expectations, broadens side effects, and can trigger unrequested system operations.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The runner injects package-management commands into submitted Python code and invokes apt-get automatically based on code content. This changes the execution semantics of user code and grants the wrapper authority to perform additional privileged actions inside the sandbox, increasing attack surface, network use, and unpredictability beyond simple code execution.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Automatically running apt-get update/install without warning or confirmation introduces hidden package-management activity into an execution request. Even in a sandbox, this expands networked operations, can consume resources, and violates least surprise by performing actions the user did not ask for.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The runner writes execution-derived artifacts from the remote sandbox to the local host filesystem automatically, creating persistent side effects outside the advertised sandbox boundary. If sandbox output is attacker-controlled, this can fill disk, overwrite expected artifacts in the working directory, or create misleading local files without explicit user consent.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
72% confidence
Finding

The surrounding comments frame this section as avoiding conflicts and auto-saving plots, but the implementation actively strips user matplotlib.use(...) and rcParams settings and replaces them with runner-controlled settings. This is not just an implementation detail; it contradicts the apparent intent that the runner simply executes supplied code, because it changes user program semantics.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The runner decodes a chart marker from execution output and writes a PNG to the local filesystem automatically. This is a boundary-crossing side effect from remote execution to local persistence and may create files the user did not request or expect.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The runner automatically saves rich output images returned by the sandbox to local files without confirmation. Because the image payload originates from executed code, this creates unprompted local artifacts and opens the door to disk consumption or clutter from attacker-controlled output.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.