Back to skill

Security audit

Alibaba Cloud AI PAI Aiworkspace

Security checks for vulnerabilities and agentic risk

Overview

The skill appears purpose-built for Alibaba Cloud AIWorkspace administration, but it asks agents to use cloud credentials and mutating APIs without a clear confirmation or permission boundary.

Review before installing. Use only least-privilege Alibaba Cloud credentials, require the agent to show the exact region, resource IDs, and API action before any Create/Update/Modify/Set call, and avoid passing untrusted product-code, version, or output-dir values to the helper script until path validation is added.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/list_openapi_meta_apis.py:32
Finding

Path Traversal Through Unsanitized Output Filenames

Content
View full analysis
Remediation
View remediation
str: if not SAFE_IDENTIFIER.fullmatch(value): raise ValueError(f"Invalid {name}: only letters, digits, '.', '_', and '-' are allowed") return value ``` 2. Validate the arguments before using them in either URLs or filenames: ```python product_code = validate_identifier(args.product_code, "product code") version = validate_identifier(args.version, "version") ``` 3. Resolve each output destination and enforce containment beneath the resolved output directory: ```python output_root = pathlib.Path(args.output_dir).resolve() output_root.mkdir(parents=True, exist_ok=True) json_file = ( output_root / f"{product_code}_{version}_api_docs.json" ).resolve() md_file = ( output_root / f"{product_code}_{version}_api_list.md" ).resolve() for destination in (json_file, md_file): if output_root not in destination.parents: raise ValueError("Output path escapes the configured output directory") ``` 4. Consider rejecting path separators explicitly even when additional validation is present. 5. Add regression tests covering `../`, absolute paths, platform-specific separators, encoded separators, empty values, and unexpectedly long identifiers. 6. Run the Skill under an account with minimal filesystem permissions so that a validation failure cannot become a broader workspace overwrite. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (9)

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

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/list_openapi_meta_apis.py (reported line 23)May include surrounding context.

python
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"))

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill is presented as a manager for AIWorkspace resources, but the documented executable path centers on metadata discovery, artifact generation, and API inventory collection rather than the claimed operational workflows. This mismatch is dangerous because users and orchestrators may grant it trust or invoke it for cloud administration while it performs different network and filesystem actions than expected, weakening oversight and increasing the chance of unsafe execution.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
83% confidence
Finding

The skill advertises executable behavior that can access environment credentials, write files, and make network requests, but it does not declare any explicit tool scope or permission boundaries. In a cloud-management context this is risky because the skill handles sensitive Alibaba Cloud credentials and can perform externally visible actions without a clear least-privilege contract.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The invocation text is broad enough to match many generic AIWorkspace-related requests, including troubleshooting, lifecycle automation, and permission issues, without clear constraints on when it should or should not run. In a cloud skill, overly broad routing increases the chance of accidental activation in sensitive contexts, potentially exposing credentials, triggering network calls, or setting up follow-on mutations under vague user intent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The instructions include create, update, modify, and set-style API usage for cloud resources but do not require an explicit warning or confirmation before mutating operations. In the context of Alibaba Cloud administration, this makes accidental or misunderstood destructive changes materially more dangerous because users may not realize the skill can alter production workspace configuration or permissions.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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/sources.md (reported line 3)May include surrounding context.

md
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)

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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/sources.md (reported line 4)May include surrounding context.

md
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)

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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/sources.md (reported line 5)May include surrounding context.

md
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)

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · scripts/list_openapi_meta_apis.py (reported line 39)May include surrounding context.

python
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)

Static analysis

No suspicious patterns detected.