Back to skill

Security audit

Alibaba Cloud Observability PTS

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed Alibaba Cloud PTS management helper that needs cloud credentials and can start or stop tests, so users should use least-privilege credentials and review dependency installation.

Install only in a dedicated virtual environment, prefer pinned SDK versions, and provide least-privilege Alibaba Cloud credentials scoped to the intended PTS resources. Treat start/stop and any lifecycle APIs as production-impacting actions: confirm region, scene ID, owner, change window, and rollback before running them.

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:24
Finding
Unpinned Third-Party Alibaba Cloud SDK Dependencies## Vulnerability Details **File Location**: `SKILL.md:24-27` **Vulnerability Type**: Unpinned third-party dependencies **Risk Level**: Medium ### Vulnerable Code ```bash python3 -m venv .venv . .venv/bin/activate python -m pip install -U alibabacloud_pts20201020 alibabacloud_tea_openapi ``` A matching installation recommendation is also embedded in the runtime error at `scripts/_pts_client.py:28-30`: ```python raise RuntimeError( "Missing SDK dependencies. Install with: " "python -m pip install -U alibabacloud_pts20201020 alibabacloud_tea_openapi" ) from exc ``` ### Technical Analysis The installation command uses `-U` and does not pin reviewed package versions, constrain transitive dependencies, verify artifact hashes, or use a lock file. Consequently, the code installed by this instruction can change after the Skill has been audited. This does not establish that the named Alibaba Cloud packages are malicious. The vulnerability is the mutable and insufficiently verified supply-chain trust boundary. If one of the packages, its transitive dependencies, or the package distribution account were compromised, a user following the documented command could install attacker-controlled code. The imported SDK executes in the same Python process as the Skill scripts. It can therefore access the Alibaba Cloud access key, secret, and optional security token read from the environment by `scripts/_pts_client.py`. ### Attack Path 1. An attacker compromises an upstream package release, maintainer account, distribution pipeline, or transitive dependency. 2. A malicious release is published under a package name used by the documented installation command. 3. A user follows the command containing `pip install -U`, causing pip to select the latest compatible release. 4. Attacker-controlled code executes during package installation or when the SDK is imported. 5. The malicious code reads process environment variabl ...[truncated 791 chars]
Remediation
## Remediation Suggestions 1. Replace floating dependency installation with exact, reviewed versions. 2. Pin all transitive dependencies in a lock file or fully resolved requirements file. 3. Record and enforce package hashes, for example: ```bash python -m pip install --require-hashes -r requirements.txt ``` 4. Remove `-U` from routine setup instructions so an already reviewed environment is not silently upgraded. 5. Ensure the runtime error in `scripts/_pts_client.py:28-30` points to the same locked installation procedure rather than recommending unconstrained packages. 6. Obtain packages only from an approved index and document package provenance. 7. Review dependency updates before regenerating hashes and releasing a new Skill version. 8. Continue using a dedicated virtual environment and least-privilege, preferably short-lived Alibaba Cloud credentials.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (9)

Tainted flow: 'timeout' from os.getenv (line 47, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Content
def fetch_json(url: str, timeout: int) -> dict:
    req = urllib.request.Request(url, headers={"User-Agent": "codex-skill"})
    with urllib.request.urlopen(req, timeout=timeout) as resp:
        return json.loads(resp.read().decode("utf-8"))
Confidence
90% confidence
Finding
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Lp3

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding
The skill instructs use of environment variables, filesystem output, and external network access to Alibaba Cloud APIs, but it does not declare any explicit tool scope such as permissions or allowed-tools. This creates an authorization ambiguity where an agent may overreach its capabilities, making unintended credential access, file writes, or cloud mutations easier if the skill is invoked in a broader execution context.

External Transmission

Medium
Category
Data Exfiltration
Content
output_dir.mkdir(parents=True, exist_ok=True)

    url = (
        f"https://api.aliyun.com/meta/v1/products/{args.product_code}"
        f"/versions/{args.version}/api-docs.json"
    )
    payload = fetch_json(url, timeout)
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
output_dir.mkdir(parents=True, exist_ok=True)

    url = (
        f"https://api.aliyun.com/meta/v1/products/{args.product_code}"
        f"/versions/{args.version}/api-docs.json"
    )
    payload = fetch_json(url, timeout)
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
output_dir.mkdir(parents=True, exist_ok=True)

    url = (
        f"https://api.aliyun.com/meta/v1/products/{args.product_code}"
        f"/versions/{args.version}/api-docs.json"
    )
    payload = fetch_json(url, timeout)
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
output_dir.mkdir(parents=True, exist_ok=True)

    url = (
        f"https://api.aliyun.com/meta/v1/products/{args.product_code}"
        f"/versions/{args.version}/api-docs.json"
    )
    payload = fetch_json(url, timeout)
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
output_dir.mkdir(parents=True, exist_ok=True)

    url = (
        f"https://api.aliyun.com/meta/v1/products/{args.product_code}"
        f"/versions/{args.version}/api-docs.json"
    )
    payload = fetch_json(url, timeout)
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
output_dir.mkdir(parents=True, exist_ok=True)

    url = (
        f"https://api.aliyun.com/meta/v1/products/{args.product_code}"
        f"/versions/{args.version}/api-docs.json"
    )
    payload = fetch_json(url, timeout)
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
output_dir.mkdir(parents=True, exist_ok=True)

    url = (
        f"https://api.aliyun.com/meta/v1/products/{args.product_code}"
        f"/versions/{args.version}/api-docs.json"
    )
    payload = fetch_json(url, timeout)
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Static analysis

No suspicious patterns detected.