Back to skill

Security audit

Alibaba Cloud AI Content Aimiaobi

Security checks for vulnerabilities and agentic risk

Overview

The skill is a disclosed Alibaba Cloud Quan Miao helper, but users should treat its cloud credentials and local output helper with normal care.

Install only if you want an agent to work with Alibaba Cloud Quan Miao/AiMiaoBi using your Alibaba Cloud credentials. Use least-privilege AccessKeys, review create/update/modify/set actions before they run, and avoid passing untrusted product code, version, or output directory values to the helper script until its path validation is tightened.

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:31
Finding
Unsanitized CLI Arguments Permit Output Path Traversal## Vulnerability Details **File Location**: `scripts/list_openapi_meta_apis.py`, lines 31–58 **Vulnerability Type**: Path traversal / arbitrary file write outside the intended output directory **Risk Level**: Medium ```python parser.add_argument("--product-code", default=DEFAULT_PRODUCT_CODE) parser.add_argument("--version", default=DEFAULT_VERSION) parser.add_argument("--output-dir", default=str(OUTPUT_DIR)) args = parser.parse_args() timeout = int(os.getenv("OPENAPI_META_TIMEOUT", "20")) output_dir = pathlib.Path(args.output_dir) 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) raw_apis = payload.get("apis", {}) if isinstance(raw_apis, dict): api_names = sorted(raw_apis.keys()) elif isinstance(raw_apis, list): names = [] for item in raw_apis: if isinstance(item, dict): name = item.get("name") or item.get("apiName") if name: names.append(name) elif isinstance(item, str): names.append(item) api_names = sorted(set(names)) else: api_names = [] json_file = output_dir / f"{args.product_code}_{args.version}_api_docs.json" md_file = output_dir / f"{args.product_code}_{args.version}_api_list.md" ``` ### Technical Analysis The `--product-code` and `--version` arguments are accepted as unrestricted strings. Both values are subsequently interpolated into output filenames and joined to the configured output directory using `pathlib.Path`. `pathlib` does not automatically confine a joined path to its intended parent directory. Consequently, path separators and parent-directory components such as `../` in either argument can cause the resulting path to resolve outside `output_dir`. The script later writes remote ...[truncated 2523 chars]
Remediation
## Remediation Suggestions 1. Validate `--product-code` and `--version` before using them in URLs or filenames. Permit only the characters required by Alibaba Cloud identifiers, such as ASCII letters, digits, periods, underscores, and hyphens. 2. Explicitly reject absolute paths, path separators, empty values, and parent-directory components. 3. Separate URL identifiers from local filenames. Encode URL path segments with an appropriate URL-quoting function and independently convert identifiers into safe local filename components. 4. Resolve both the output directory and each destination path, then verify that every destination remains beneath the resolved output directory before writing. 5. Consider using fixed output filenames, such as `api_docs.json` and `api_list.md`, inside a validated product/version directory. 6. Avoid unintentionally replacing existing files by using exclusive creation where appropriate or requiring explicit confirmation before overwrite. 7. Add tests covering values such as parent-directory traversal sequences, absolute paths, embedded separators, URL metacharacters, and excessively long identifiers. 8. Retain the current fixed HTTPS destination and do not add credentials to the metadata request, because the documented metadata endpoint does not require authentication.
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 (8)

Tainted flow: 'timeout' from os.getenv (line 34, 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.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
The skill claims it manages AiMiaoBi resources and supports operational actions, but the described executable quickstart only performs metadata discovery and writes local artifacts. This mismatch is dangerous because operators may grant trust, credentials, or execution rights based on the declared purpose while the actual behavior expands into undocumented data collection and filesystem output, undermining least surprise and safe review.

Lp3

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding
The skill advertises executable workflows that rely on environment variables, file writes, and network/API access, but it does not declare any explicit tool scope or permission boundaries. This creates an authorization and review gap: an agent may invoke capabilities broader than a user expects, including using cloud credentials from the environment and writing local artifacts without transparent consent controls.

Vague Triggers

Medium
Confidence
92% confidence
Finding
The activation text is broad enough to trigger on many Alibaba Cloud content-operation requests, even when the user's intent may not specifically require this skill. Overbroad routing increases the chance that the agent will access cloud credentials, query external APIs, or prepare mutation-oriented workflows in contexts where a narrower or read-only skill would be safer.

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.