Back to skill

Security audit

Alibabacloud Dms Data Agent Platform Setup

Security checks for vulnerabilities and agentic risk

Overview

The skill appears intended to provision Alibaba Cloud Dify infrastructure, but it handles sensitive service passwords and cloud permissions in ways users should review carefully before installing.

Install only if you are comfortable letting the skill provision Alibaba Cloud resources. Use a dedicated least-privilege RAM role, start with DryRun=true, avoid placing real passwords in shell commands or logs, and rotate any credentials previously used with the documented command-line flow.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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

Error
Location
scripts/openAPI_call.py:8
Finding

Database Credentials Exposed Through Command-Line Arguments

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:164-184; scripts/openAPI_call.py:8-13
Vulnerability Type: Plaintext secrets in process arguments
Risk Level: High

Vulnerable Code

SKILL.md:164-184:

bash
.venv/bin/python ./scripts/openAPI_call.py '{
    "VpcId": "<VpcId>",
    "VSwitchId": "<VSwitchId>",
    "BackupVSwitchId": "<BackupVSwitchId>",
    "SecurityGroupId": "<SecurityGroupId>",
    "ZoneId": "<ZoneId>",
    "DataRegion": "<DataRegion>",
    "ResourceQuota": "12CU",
    "WorkspaceOption": "CreateNewInstance",
    "WorkspaceName": "<WorkspaceName>",
    "DatabaseOption": "CreateNewInstance",
    "DbInstanceAccount": "<account>",
    "DbInstancePassword": "<password>",
    "KvStoreOption": "CreateNewInstance",
    "KvStoreAccount": "<account>",
    "KvStorePassword": "<password>",
    "VectordbOption": "CreateNewInstance",
    "VectordbAccount": "<account>",
    "VectordbPassword": "<password>",
    "StorageType": "cloud_essd",

scripts/openAPI_call.py:8-13:

python
args = sys.argv[1:]
if len(args) != 1:
    print("Please provide a JSON-formatted string as a command-line argument")
    exit(1)

json_body: Dict[str, Any] = json.loads(args[0])

Technical Analysis

The documented execution flow requires the complete provisioning request, including the database, KV-store, and vector-database passwords, to be supplied as a command-line argument. The script then reads that plaintext JSON from sys.argv.

Command-line arguments are not a secure secret transport mechanism. Depending on the operating system and process isolation settings, they can be visible through process inspection facilities such as /proc, ps, endpoint monitoring, job runners, or process audit logs. If a user manually enters the documented command with literal credentials, it may also be reta ...[truncated 1540 chars]

Remediation
View remediation

Remediation Suggestions

  1. Stop accepting password-bearing JSON through sys.argv.
  2. Accept non-secret request data through standard input or a configuration file with restrictive permissions.
  3. Collect passwords separately using getpass.getpass() for interactive use, or resolve them from an approved secret manager for automation.
  4. If file input is supported, require owner-only permissions, avoid predictable temporary files, and securely delete temporary material after use.
  5. Update SKILL.md so no example places passwords directly in a command invocation.
  6. Ensure agent, CI, and SDK logging redacts all password fields.
  7. Use separate credentials for each backing service where supported, and rotate any credentials previously supplied through the documented command-line flow.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/dify_skill_utils.py:106
Finding

Sensitive Provisioning Credentials Serialized into HTTP Query Parameters

Content
View full analysis

Vulnerability Details

File Location: scripts/dify_skill_utils.py:106-110
Vulnerability Type: Sensitive data exposure through URL/query serialization
Risk Level: Medium

Vulnerable Code

python
request = open_api_models.OpenApiRequest(
    query=OpenApiUtilClient.query(json_body)
)
# The response is a Map containing the body, headers, and HTTP status code.
resp: Dict[str, Any] = client.call_api(params, request, runtime)

return resp

Technical Analysis

json_body contains the complete provisioning object, including DbInstancePassword, KvStorePassword, and VectordbPassword. The code converts that object into query parameters and assigns it to OpenApiRequest.query.

HTTPS protects the request while it is in transit, but it does not prevent query strings from being recorded at either endpoint or by trusted infrastructure. URLs and query parameters are commonly captured by SDK debug output, HTTP diagnostics, API gateways, reverse proxies, traffic observability products, and access logs. Such logs often have broader readership and longer retention periods than secret stores.

The local mask_sensitive_DFS function only masks selected fields in the returned response. It does not redact the outgoing query, SDK diagnostics, proxy records, or server-side request logs.

Attack Path

  1. A user supplies valid credentials in the provisioning JSON.
  2. fill_in_param_body retains those password fields in the request dictionary.
  3. OpenApiUtilClient.query(json_body) serializes the complete dictionary as query parameters.
  4. The SDK, an API gateway, a proxy, or server-side access logging records the request URL or query parameters.
  5. A user with access to operational logs retrieves the plaintext credentials.
  6. The recovered credentials are used against any reachable backing services.

This path depends on the logging behavior of the deployed SDK and network infrastructure, but quer ...[truncated 554 chars]

Remediation
View remediation

Remediation Suggestions

  1. Use the Alibaba Cloud SDK's supported request-body mechanism for sensitive provisioning fields instead of placing them in OpenApiRequest.query.
  2. Confirm the exact API contract for CreateDifyInstance and use a generated request model where available.
  3. If the RPC API unavoidably requires query parameters, explicitly disable request-level debug logging and configure all gateways, proxies, and observability systems to redact the password parameter names.
  4. Never include complete request URLs in exceptions or application logs.
  5. Add tests that verify password values do not appear in captured logs, exception messages, or diagnostic output.
  6. Restrict access to existing API and proxy logs, shorten their retention, and rotate credentials that may already have been recorded.

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
references/ram-policies.md:3
Finding

Full DMS Access Recommended Instead of Least-Privilege Permissions

Content
View full analysis

Vulnerability Details

File Location: references/ram-policies.md:3-5
Vulnerability Type: Excessive cloud IAM permissions
Risk Level: Medium

Vulnerable Code

markdown
## Recommended: Use System Policy

Grant the RAM user or role the system policy `AliyunDMSFullAccess` for full DMS operation permissions related to Dify instance provisioning.

Technical Analysis

The documentation recommends the broad AliyunDMSFullAccess system policy even though the same document identifies a much smaller set of operations required by the Skill: dms:CreateDifyInstance and, only when existing resources must be discovered, dms:ListInstances.

Granting full DMS access violates least-privilege principles by authorizing operations unrelated to provisioning a Dify instance. Although this recommendation does not itself bypass Alibaba Cloud authorization, it encourages users to create an identity whose compromise or misuse has a substantially larger blast radius than the task requires.

Attack Path

  1. An administrator follows the recommended setup and grants AliyunDMSFullAccess to the RAM user or role used by the Skill.
  2. The configured credential becomes available through the Alibaba Cloud default credential chain.
  3. The credential is compromised, or unintended code executes under that identity.
  4. The attacker invokes DMS operations beyond CreateDifyInstance and ListInstances.
  5. Unrelated DMS-managed resources are accessed or modified within the boundaries of the broad system policy.

Exploitation requires compromise or misuse of the provisioned identity, but the documented recommendation materially increases the privileges and resulting impact available in that event.

Impact Assessment

The affected principal may receive broad DMS permissions beyond those needed for this Skill. The precise operations and resource scope are determined by the current definition of Alibaba Cloud's `AliyunDMSFu ...[truncated 220 chars]

Remediation
View remediation

Remediation Suggestions

  1. Make a scoped custom RAM policy the primary and recommended configuration.
  2. Grant only dms:CreateDifyInstance for simple provisioning.
  3. Add dms:ListInstances only when Advanced Mode needs instance discovery.
  4. Add product-specific read-only permissions only when the selected workflow demonstrably requires metadata lookup.
  5. Scope permissions to applicable resources and conditions where Alibaba Cloud supports resource-level restrictions.
  6. Present AliyunDMSFullAccess only as an exceptional troubleshooting fallback, with an explicit warning and user approval requirement.
  7. Use a dedicated short-lived RAM role rather than a personal long-lived AccessKey, and monitor its actions through ActionTrail.
  8. Periodically review and revoke permissions that are no longer required.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description says this skill is for creating/provisioning a new Dify instance in DMS. However, the supplied code only performs a read/list operation by invoking ListDifyInstances with a DataRegion parameter, then outputs the returned instance data. There is no code for creating, deploying, configuring Simple/Advanced modes, or setting up a new instance. This is a material purpose mismatch: the actual behavior is instance discovery, not provisioning.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
83% confidence
Finding

The skill instructs execution of a Python script that relies on the Alibaba Cloud default credential chain, which can silently consume powerful ambient credentials from environment variables, local credential files, or instance roles. In an agent context, this creates risk of unintended cloud-account actions under whatever identity happens to be available, especially since the referenced script is not shown here for independent verification.

Content

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

md
`openAPI_call.py` uses the Alibaba Cloud default credential chain — no environment variables need to be set manually. The SDK automatically resolves credentials in the following order: environment variables, credentials file, instance RAM role, etc.

Configure your credentials by following the official guide:
[Alibaba Cloud Python SDK v2 — Manage Access Credentials](https://help.aliyun.com/zh/sdk/developer-reference/v2-manage-python-access-credentials#3ca299f04bw3c)

> **NEVER hardcode AK/SK values in code or pass them as command-line arguments.**

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
> Run commands from the directory containing this `SKILL.md` file.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest says this skill is for provisioning, deploying, or setting up a new Dify instance on Alibaba Cloud DMS. This file performs a read/list operation by calling the 'ListDifyInstances' API, which detects existing instances rather than creating one, so the implemented behavior does not match the claimed setup/provisioning purpose.

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/ram-policies.md (reported line 46)May include surrounding context.

md
config = open_api_models.Config(credential=credentialsClient)
        config.user_agent = callAliyunOpenAPI._UA_TEMPLATE.format(session_id=session_id)
        # Endpoint 请参考 https://api.aliyun.com/product/dms-enterprise
        config.endpoint = "dms-enterprise.aliyuncs.com"
        return OpenApiClient(config)

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/ram-policies.md (reported line 47)May include surrounding context.

md
config = open_api_models.Config(credential=credentialsClient)
        config.user_agent = callAliyunOpenAPI._UA_TEMPLATE.format(session_id=session_id)
        # Endpoint 请参考 https://api.aliyun.com/product/dms-enterprise
        config.endpoint = "dms-enterprise.aliyuncs.com"
        return OpenApiClient(config)

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

python
config = open_api_models.Config(credential=credentialsClient)
        config.user_agent = callAliyunOpenAPI._UA_TEMPLATE.format(session_id=session_id)
        # Endpoint 请参考 https://api.aliyun.com/product/dms-enterprise
        config.endpoint = "dms-enterprise.aliyuncs.com"
        return OpenApiClient(config)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The launch function constructs an API request from input_dict and sends it to a remote Alibaba Cloud endpoint via client.call_api. While there are technical comments and a helper to mask sensitive fields elsewhere, this code path has no confirmation prompt, logging, or user-facing warning that request contents may be transmitted over the network.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This script directly invokes the Alibaba Cloud API operation CreateDifyInstance using attacker- or user-controlled JSON input, and there is no visible confirmation, dry-run, or policy check before provisioning a resource. In a skill whose purpose is to create cloud infrastructure, this increases the risk of unintended resource creation, cost incurrence, or misuse if the tool is triggered with insufficient user awareness or authorization checks elsewhere.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script prints its usage/help message only in Chinese: "请传入一个区域名称, 如: cn-hangzhou, cn-beijing". This imposes a specific language on users without offering a locale choice or documenting a justified region-specific constraint, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.