Back to skill

Security audit

DataWorks Open API

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly coherent for managing Alibaba Cloud DataWorks, but it asks agents to use broad cloud credentials with unpinned packages and unsafe documentation-fetching helpers that can weaken trust in API metadata.

Install only after reviewing the supply-chain and credential posture. Prefer short-lived or least-privilege RAM/STS credentials, avoid static keys in configs or shell history, pin SDK and MCP package versions, restrict MCP TOOL_NAMES or TOOL_CATEGORIES, avoid NODE_ENV=development unless you intend to use pre-release tool definitions, and do not rely on generated API metadata from the helper scripts unless TLS verification is fixed or the source is otherwise verified.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/fetch_api_overview.py:37
Finding

TLS Certificate Verification Can Be Disabled in API Overview Retrieval

Content
View full analysis
str: """Fetch page HTML. Tries urllib first, falls back to curl on SSL errors.""" import ssl import subprocess headers = { "User-Agent": ( "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) " "AppleWebKit/537.36 (KHTML, like Gecko) " "Chrome/131.0.0.0 Safari/537.36" ), } # Try with default SSL context first for ctx in [None, ssl.create_default_context(), ssl._create_unverified_context()]: try: req = urllib.request.Request(url, headers=headers) kwargs: dict = {"timeout": timeout} if ctx is not None: kwargs["context"] = ctx with urllib.request.urlopen(req, **kwargs) as resp: return resp.read().decode("utf-8") except (urllib.error.URLError, ssl.SSLError): continue ``` The script also accepts an unrestricted custom endpoint: ```python parser.add_argument("--url", default=DEFAULT_URL, help="Help doc URL") ``` ### Technical Analysis The request sequence eventually uses `ssl._create_unverified_context()`. This disables certificate-chain and server-identity verification after verified HTTPS attempts fail. Consequently, a TLS failure does not cause the operation to fail closed. The downloaded page is parsed into API names and descriptions and saved for subsequent Agent use. Although the script does not directly execute downloaded code or transmit credentials, forged documentation can influence later authenticated cloud operations. The unrestricted `--url` argument also permits retrieval from arbitrary schemes and hosts without an Alibaba Cloud hostname allowlist. ### Attack Path 1. An Agent or user runs `scripts/fetch_api_overview.py ...[truncated 908 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/list_openapi_meta_apis.py:22
Finding

TLS Certificate Verification Can Be Disabled in OpenAPI Metadata Retrieval

Content
View full analysis
dict: """Fetch JSON from URL. Tries urllib first, falls back to curl on SSL errors.""" import ssl import subprocess headers = {"User-Agent": "codex-skill"} # Try with default SSL context first for ctx in [None, ssl.create_default_context(), ssl._create_unverified_context()]: try: req = urllib.request.Request(url, headers=headers) kwargs: dict = {"timeout": timeout} if ctx is not None: kwargs["context"] = ctx with urllib.request.urlopen(req, **kwargs) as resp: return json.loads(resp.read().decode("utf-8")) except (urllib.error.URLError, ssl.SSLError): continue ``` ### Technical Analysis The final context in the retry loop disables TLS certificate verification. If the ordinary verified requests fail, the function can accept metadata from a server whose certificate is invalid, self-signed, expired, or issued for another hostname. The retrieved JSON contains API definitions used by the Skill’s dynamic discovery workflow. The metadata is persisted to disk and may guide construction of later authenticated API requests. This creates an integrity risk even though the discovery request itself contains no authorization header or secret. The command-line `product-code` and `version` values are inserted into the path of a fixed Alibaba Cloud host, so this script has less SSRF exposure than the custom URL accepted by `fetch_api_overview.py`. The confirmed issue remains the deliberate TLS downgrade. ### Attack Path 1. An Agent or user runs `scripts/list_openapi_meta_apis.py`. 2. A man-in-the-middle attacker or malicious proxy causes the verified requests to fail. 3. The code reach ...[truncated 654 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
references/mcp_server.md:18
Finding

Unpinned Third-Party Packages Are Installed and Executed with Cloud Credentials

Content
View full analysis
", "ALIBABA_CLOUD_ACCESS_KEY_SECRET": "" } } } } ``` ### Technic ...[truncated 2253 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (23)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The supplied code is a documentation scraper/indexer, not a DataWorks operator. It downloads an Alibaba Cloud help page, parses window.__ICE_PAGE_PROPS__, extracts API names/descriptions from HTML tables, and saves an overview as markdown and JSON. While this partially aligns with the description's mention of runtime API discovery from official docs, it does not implement the central claimed capability of operating DataWorks through official SDKs or executing APIs across the listed product areas. It also does not consume OpenAPI metadata, only a single help-doc page. Therefore the actual behavior is materially narrower and different from the declared purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The code is related to one narrow part of the description—runtime discovery of OpenAPI metadata—but it does not implement the declared primary purpose of operating DataWorks services across development, workflows, integration, quality, lineage, or workspace management. It merely downloads an API docs JSON document from Alibaba's metadata service, parses API names, and writes artifacts locally. There are no SDK calls, no DataWorks action execution, no authentication, and no workflow/data-management operations. This makes the actual behavior materially narrower and different from the declared skill purpose.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The README explicitly instructs users to export long-lived static Alibaba Cloud access key credentials, but it does not warn about secret handling, shell history leakage, least-privilege use, or preferring short-lived credentials. In an agent-oriented skill, this increases the chance operators will paste powerful credentials into insecure environments or logs, leading to credential compromise and unauthorized cloud access.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill documents capabilities that require network access, shell execution, environment-variable access, and likely file writes, but it does not declare any explicit tool scope or permission boundaries. In an agent environment, that omission weakens least-privilege controls and can allow broader-than-expected execution against cloud APIs using sensitive credentials.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

md
If execution fails at any step, escalate to the next level:

1. **Cookbook** — check `references/cookbook.md` first. It contains verified API patterns, pitfalls, error recovery, the full end-to-end lifecycle (Create → Submit → Deploy → Run → Monitor), and reusable code snippets. Most common issues are already documented there.
2. **Official help docs** — read the API overview and per-API doc pages.
   - If an API call fails or the request/error is not understood, fetch the API directory page to locate the relevant API documentation:
     `https://help.aliyun.com/zh/dataworks/developer-reference/api-dataworks-public-2024-05-18-dir`

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/cookbook.md (reported line 442)May include surrounding context.

python
req = models.ListResourceGroupsRequest(project_id=PROJECT_ID, page_number=1, page_size=10)
resp = client.list_resource_groups(req)
groups = resp.body.paging_info.to_map().get('ResourceGroupList', [])
RESOURCE_GROUP_ID = groups[0].get('Id')
# e.g. "Serverless_res_group_<account-id>_<group-id>"

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/cookbook.md (reported line 504)May include surrounding context.

python
req = models.ListResourceGroupsRequest(project_id=PROJECT_ID, page_number=1, page_size=10)
resp = client.list_resource_groups(req)
groups = resp.body.paging_info.to_map().get('ResourceGroupList', [])
RESOURCE_GROUP_ID = groups[0].get('Id')
# e.g. "Serverless_res_group_<account-id>_<group-id>"

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/cookbook.md (reported line 884)May include surrounding context.

python
req = models.ListResourceGroupsRequest(project_id=PROJECT_ID, page_number=1, page_size=10)
resp = client.list_resource_groups(req)
groups = resp.body.paging_info.to_map().get('ResourceGroupList', [])
RESOURCE_GROUP_ID = groups[0].get('Id')
# e.g. "Serverless_res_group_<account-id>_<group-id>"

Session Persistence

Medium
Category
Rogue Agent
Confidence
75% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/cookbook.md (reported line 1268)May include surrounding context.

python
req = models.ListResourceGroupsRequest(project_id=PROJECT_ID, page_number=1, page_size=10)
resp = client.list_resource_groups(req)
groups = resp.body.paging_info.to_map().get('ResourceGroupList', [])
RESOURCE_GROUP_ID = groups[0].get('Id')
# e.g. "Serverless_res_group_<account-id>_<group-id>"

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This cookbook repeatedly sets timezone: "Asia/Shanghai" in workflow trigger examples, which imposes a specific locale/timezone behavior in natural-language configuration. The file does not indicate that this is optional, region-specific, or something the user should choose based on their environment.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This cleanup recipe demonstrates DeleteDataQualityRule and DeleteDataQualityEvaluationTask, which remove configuration objects permanently. Although irreversibility is mentioned elsewhere in the document, this destructive recipe itself lacks an explicit warning at the point of action that running it will permanently delete data quality assets.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file instructs users to place ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET into the MCP server configuration, but it does not include any warning about the sensitivity of these credentials or the risks of exposing them to an AI-connected tool. For markdown files, SQP-2 applies when the description omits warnings about behaviors that could affect privacy or system integrity, and credential use is a clear sensitive operation.

Content

No source excerpt is available for this finding.

Unsafe Defaults

Medium
Category
Tool Misuse
Confidence
92% confidence
Finding

The server dynamically switches to a pre-release tool-definition endpoint when NODE_ENV=development, causing security-relevant behavior and available tool surface to depend on an environment flag rather than an explicit trusted configuration. If that pre-release source is less stable, less reviewed, or compromised, an agent could discover and invoke unintended APIs or schemas, expanding attack surface and enabling unsafe operations.

Content

Scanner excerpt · references/mcp_server.md (reported line 82)May include surrounding context.

md
The MCP Server dynamically fetches tool definitions from:
- `https://dataworks.data.aliyun.com/pop-mcp-tools` (production)
- `https://pre-dataworks.data.aliyun.com/pop-mcp-tools` (pre-release, when `NODE_ENV=development`)

This means the tool list always reflects the latest available DataWorks APIs.

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

md
> Constants: **PRODUCT_CODE** = `dataworks-public`, **API_VERSION** = `2024-05-18` (defined in SKILL.md)

## API & metadata
- OpenAPI product page: `https://api.aliyun.com/product/{PRODUCT_CODE}`
- API overview (help docs): `https://help.aliyun.com/zh/dataworks/developer-reference/api-{PRODUCT_CODE}-{API_VERSION}-overview`
- API list (metadata JSON): `https://next.api.aliyun.com/meta/v1/products/{PRODUCT_CODE}/versions/{API_VERSION}/api-docs.json`
- Single API definition: `https://next.api.aliyun.com/meta/v1/products/{PRODUCT_CODE}/versions/{API_VERSION}/apis/{ApiName}/api.json`

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/sources.md (reported line 6)May include surrounding context.

md
> Constants: **PRODUCT_CODE** = `dataworks-public`, **API_VERSION** = `2024-05-18` (defined in SKILL.md)

## API & metadata
- OpenAPI product page: `https://api.aliyun.com/product/{PRODUCT_CODE}`
- API overview (help docs): `https://help.aliyun.com/zh/dataworks/developer-reference/api-{PRODUCT_CODE}-{API_VERSION}-overview`
- API list (metadata JSON): `https://next.api.aliyun.com/meta/v1/products/{PRODUCT_CODE}/versions/{API_VERSION}/api-docs.json`
- Single API definition: `https://next.api.aliyun.com/meta/v1/products/{PRODUCT_CODE}/versions/{API_VERSION}/apis/{ApiName}/api.json`

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script explicitly falls back to ssl._create_unverified_context(), which disables TLS certificate verification and allows man-in-the-middle interception or tampering of fetched documentation. Because the fetched content is then parsed and written into output artifacts that may drive later API usage or developer decisions, an attacker on the network path could silently poison the generated data.

Content

No source excerpt is available for this finding.

Tainted flow: 'timeout' from os.getenv (line 210, 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/fetch_api_overview.py (reported line 63)May include surrounding context.

python
# Fallback: use curl
    print("urllib SSL failed, falling back to curl...")
    result = subprocess.run(
        ["curl", "-fsSL", "-H", f"User-Agent: {headers['User-Agent']}", url],
        capture_output=True, text=True, timeout=timeout,
    )

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

The code explicitly falls back to ssl._create_unverified_context(), which disables certificate verification for HTTPS requests. That permits man-in-the-middle interception or response spoofing, allowing an attacker on the network path to feed malicious or falsified API metadata that this script then saves as trusted output.

Content

No source excerpt is available for this finding.

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

python
# Fallback: use curl
    print("urllib SSL failed, falling back to curl...")
    result = subprocess.run(
        ["curl", "-fsSL", "-H", f"User-Agent: {headers['User-Agent']}", url],
        capture_output=True, text=True, timeout=timeout,
    )

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

python
# Fallback: use curl
    print("urllib SSL failed, falling back to curl...")
    result = subprocess.run(
        ["curl", "-fsSL", "-H", f"User-Agent: {headers['User-Agent']}", url],
        capture_output=True, text=True, timeout=timeout,
    )

Tainted flow: 'timeout' from os.getenv (line 58, 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/list_openapi_meta_apis.py (reported line 42)May include surrounding context.

python
# Fallback: use curl
    print("urllib SSL failed, falling back to curl...")
    result = subprocess.run(
        ["curl", "-fsSL", "-H", f"User-Agent: {headers['User-Agent']}", url],
        capture_output=True, text=True, timeout=timeout,
    )

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The troubleshooting instructions direct the user to help.aliyun.com/zh/... pages and frame them as the required official help path. This imposes a specific locale in the skill's natural-language guidance without stating that Chinese is optional or offering an alternative language choice.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest describes a DataWorks API discovery skill using official docs and SDK metadata, and this helper script is documented as fetching and parsing help pages. However, on SSL failures it spawns an external subprocess to run curl, which is a broader execution capability than simple in-process HTTP retrieval and is not justified by the script's stated parsing purpose.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.