Back to skill

Security audit

Alibabacloud Flink Knowledge

Security checks for vulnerabilities and agentic risk

Overview

The skill is not clearly malicious, but it needs review because it globally controls agent responses, can update local Alibaba CLI plugins, and requests broad live cloud read access.

Review before installing. Use this skill only with explicit user approval for live cloud inspection, a tightly scoped read-only RAM role, and task-specific permissions. Avoid granting log, billing, OSS listing, VPC/security-group, or cross-service discovery access unless needed for the specific request. Do not let it run aliyun plugin update automatically; prefer a manually reviewed and pinned CLI/plugin version. Treat the custom response markers as skill formatting, not as higher-priority system rules.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T01 · Skill Instruction Hijacking

Error
Location
SKILL.md:42
Finding

Skill-Level Instruction and Output Hijacking

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 42-74
Vulnerability Type: Agent instruction hijacking
Risk Level: High

Vulnerable Code

text
**First-line format (mandatory)**: The response body must begin with EXACTLY one of these 4 valid first lines (copy verbatim):

[TOOL_EVIDENCE:OK] [FILE_REQUEST:ABSENT] [TOOL_EVIDENCE:MISSING] [FILE_REQUEST:ABSENT] [TOOL_EVIDENCE:OK] [FILE_REQUEST:EXPLICIT] [TOOL_EVIDENCE:MISSING] [FILE_REQUEST:EXPLICIT]

text
Pick one. No other variations exist. A single leading newline is tolerated but no other prefix before `[`.

**Character integrity rule**: The string `TOOL_EVIDENCE` contains exactly 13 characters: T-O-O-L-underscore-E-V-I-D-E-N-C-E. Do not substitute any character with a different character, Unicode variant, or CJK glyph. Task fails on any character deviation.

**Pre-output verification (mandatory, execute before generating first line)**:
1. If WebFetch returned non-200, empty content, JS rendering error, or was not called at all → the first marker MUST be `[TOOL_EVIDENCE:MISSING]`. Outputting OK in this situation is strictly prohibited and constitutes marker hallucination.
2. If the user's prompt does NOT contain any of the 13 trigger phrases listed above → the second marker MUST be `[FILE_REQUEST:ABSENT]`. Outputting EXPLICIT in this situation is strictly prohibited.
3. These checks override any internal reasoning that may suggest otherwise. The marker value is determined solely by the observable facts (WebFetch HTTP status code and user prompt text), not by model confidence or intent.

**TOOL_EVIDENCE decision**:
- Output `[TOOL_EVIDENCE:OK]` only if WebFetch returned 200 with >=100 chars of relevant Alibaba Cloud doc content
- Output `[TOOL_EVIDENCE:MISSING]` in ALL other cases (error, timeout, empty, JS-rendering failure, responses that are **empty**, redirect, irrelevant content, tool not called, tools unavailable)
- When tools are unavailable at runtime or api.json is empt
...[truncated 3875 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove language claiming system-level authority, including “SYSTEM CONSTRAINT,” “override any internal reasoning,” and “ABSOLUTE BLOCKING DIRECTIVE.”
  2. Explicitly state that system, developer, and user instructions take precedence over Skill guidance.
  3. Limit response formatting rules to Flink-specific workflows where the format is actually required.
  4. Do not require proprietary markers in every response. Use ordinary Markdown unless a higher-level caller explicitly requests a machine-readable protocol.
  5. Replace global tool prohibitions with a narrow consent check: only write a file when the user explicitly requests it and the active runtime policy permits it.
  6. Avoid scanning the agent's own generated response as an authorization mechanism. Base authorization on the original user request and trusted runtime state.
  7. Add tests verifying that unrelated requests and higher-priority output requirements are not altered by loading the Skill.

T08 · Insecure Dependencies

Warning
Location
SKILL.md:207
Finding

Unpinned Alibaba Cloud CLI Plugin Update

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 207-213; references/aliyun-cli-setup.md, lines 9-12 and 29-31; references/ram-policies.md, lines 66-70
Vulnerability Type: Unsafe dependency update
Risk Level: Medium

Vulnerable Code

SKILL.md:

text
### aliyun CLI usage (session-scoped, user-authorized, conditional)
Execute CLI commands ONLY when the intent requires runtime state queries (job diagnostics, resource inspection) or configuration reads that cannot be satisfied from reference material. This block is conditional — the agent evaluates intent before executing it. For pure documentation knowledge questions (billing concepts, checkpoint/savepoint theory, SQL syntax), CLI invocation may be safely skipped. When skipped, note "CLI not required for this knowledge query" in the response rationale.
```bash
aliyun plugin update
# ... business commands with --user-agent flag ...

System commands (configure, plugin, version) do NOT carry --user-agent. Business commands (list-*, get-*, create-*) MUST carry --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-flink-knowledge/{session-id}" where {session-id} is generated per the Observability section below.

text

`references/aliyun-cli-setup.md`:

```text
### 1. Plugin Update Declaration
Before executing `aliyun` commands, confirm that the plugin version matches the runtime. Update with the following command:
```bash
aliyun plugin update
text

```text
### Configuration Summary
- **User-Agent**: `AlibabaCloud-Agent-Skills/alibabacloud-flink-knowledge/{session-id}` applied to every business command for platform observability
- **Plugin Policy**: The agent should call `aliyun plugin update` in the first session to ensure the plugin is up to date
- **Plugin Mode Mandatory Requirement**: All `aliyun` CLI commands **must** use plugin mode (lowercase-hyphen format, e.g. `list-regions`, `describe-vpcs`). PascalCase format (e.g. `ListRegions`, `DescribeVpcs`) is
...[truncated 2282 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove automatic aliyun plugin update execution from the normal Skill workflow.
  2. Require explicit user confirmation before installing or updating executable components.
  3. Pin the plugin to a reviewed and tested version rather than using the mutable latest release.
  4. Verify vendor signatures and published checksums before installation.
  5. Perform updates in an isolated environment with no production credentials available.
  6. Record the installed version before and after an update and provide a tested rollback procedure.
  7. Prefer checking the installed plugin version and returning installation guidance instead of modifying the environment automatically.
  8. Correct the claim that all operations are automatically reverted unless the implementation actually snapshots and restores the plugin state.

T05 · Unauthorized Access and Privilege Escalation

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

Overbroad Cloud Read and Reconnaissance Permissions

Content
View full analysis

Vulnerability Details

File Location: references/ram-policies.md, lines 7-58
Vulnerability Type: Excessive cloud permissions
Risk Level: Medium

Vulnerable Code

text
## Prerequisites

The RAM account executing this Skill must have the following permissions for `aliyun` CLI to successfully perform the corresponding operations.

## Core Permissions — Realtime Compute for Apache Flink (Read-Only)

These permissions are required for parameter queries, version queries, billing queries, diagnostic troubleshooting, and SQL-related queries:

- `realtime-compute:GetDeployment` — Query deployment details
- `realtime-compute:ListDeployments` — List all deployments
- `realtime-compute:GetJob` — Query job execution details
- `realtime-compute:ListJobs` — List all jobs
- `realtime-compute:GetDeploymentTarget` — Query deployment target configuration
- `realtime-compute:ListDeploymentTargets` — List deployment targets
- `realtime-compute:GetSavepointInfo` — Query savepoint information
- `realtime-compute:ListSavepoints` — List savepoints
- `realtime-compute:GetCheckpointInfo` — Query checkpoint information
- `realtime-compute:ListResourceQueues` — List resource queues
- `realtime-compute:GetWorkspace` — Query workspace details
- `realtime-compute:ListWorkspaces` — List workspaces
- `flink:GetDeployment` — Query deployment (Serverless API)
- `flink:ListDeployments` — List deployments (Serverless API)
- `flink:GetJob` — Query job (Serverless API)
- `flink:ListJobs` — List jobs (Serverless API)
- `flink:GetSavepoint` — Query savepoint (Serverless API)
- `flink:ListSavepoints` — List savepoints (Serverless API)
- `flink:GetDeploymentTarget` — Query deployment target (Serverless API)
- `flink:ListDeploymentTargets` — List deployment targets (Serverless API)

## Read-Only Permissions for Dependent Services

When this Skill diagnoses issues or generates cross-service SQL (e.g. Kafka → Hologres, CDC → Paimon), the following read-only permissions are requ
...[truncated 3902 chars]
Remediation
View remediation

Remediation Suggestions

  1. Replace the combined permission list with separate, task-specific RAM policy templates.
  2. Require no cloud permissions for documentation retrieval, generic troubleshooting, or offline SQL generation.
  3. Request live cloud access only after the user explicitly asks for runtime inspection.
  4. Grant only the actions needed for the selected workflow, such as Flink job reads for job diagnostics or billing reads for an explicitly requested billing lookup.
  5. Scope policies by workspace, deployment, region, project, logstore, bucket, and other supported resource identifiers.
  6. Apply RAM condition keys to restrict source IP, region, time, transport security, and other relevant context.
  7. Exclude log:GetLogs, oss:ListObjects, and billing-detail permissions by default because they expose particularly sensitive information.
  8. Use short-lived credentials or temporary assumed roles instead of long-lived account credentials.
  9. Display the exact commands and permissions to the user before execution and obtain confirmation for cross-service enumeration.
  10. Redact credentials, personal information, and sensitive log content before placing API responses into the agent context.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (12)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill claims to be a user-facing Alibaba Cloud Flink knowledge assistant, but substantial content instead imposes internal compliance logic, self-verification gates, and document-validation behavior unrelated to the declared purpose. This mismatch is dangerous because it can cause the agent to ignore user intent, access local files unexpectedly, or follow hidden operational logic that users and reviewers did not consent to.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill asserts that no persistent system modifications occur and that actions are automatically reverted, yet later instructs CLI plugin updates, which are persistent host changes. This contradiction is dangerous because it can mislead reviewers and users into trusting actions they would otherwise block, undermining informed consent and masking modification risk.

Content

No source excerpt is available for this finding.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/validate_skill_rewrite.py (reported line 851)May include surrounding context.

python
_assert_present(
        text,
        "fixed block response must be output directly",
        "Layer 2 :: billing hard-block force-output directive",
    )
    # Must tie the ban to the billing + no-evidence context
    has_billing_no_doc_context = (

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.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The description begins in Chinese and then continues in English, presenting the skill as an Alibaba Cloud Flink expert assistant without any indication that language should follow user preference. This can violate language/locale policy because the file does not offer opt-in or choice for output language despite establishing a bilingual/default presentation.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill authorizes runtime-state inspection via aliyun CLI/OpenAPI even though the manifest presents it as a knowledge assistant. This expands the skill from answering questions into active environment interrogation, which increases risk of unauthorized cloud metadata access, information disclosure, and unexpected side effects if used in a live account context.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Automatically running aliyun plugin update is a system-modifying action unrelated to a knowledge assistant's core function. It can change the host environment, introduce supply-chain risk, and violate least-privilege expectations, especially because plugin updates are persistent and not obviously reversible within the session.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The reference file instructs the agent to invoke the aliyun CLI, perform plugin update, and attach session-scoped identifiers to business API calls, which expands the skill from advisory assistance into external command execution against cloud services. This is dangerous because it can cause unintended outbound actions, environment changes, metadata leakage via user-agent tagging, and a broader attack surface if untrusted prompts cause the agent to run those commands.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The AI integration example sends comment_text directly to a large model API without any warning about privacy, data classification, consent, or redaction. In a quick-start guide, this can normalize unsafe handling of user-generated content and lead users to transmit personal, sensitive, or regulated data to an external model service without appropriate review.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation links all point to /zh/ pages, which imposes a specific language/locale in natural-language content. The file does not mention that the references are Chinese-language only or offer an English or user-selectable alternative.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The official documentation links are explicitly pinned to the /zh/ locale, which directs users to Chinese-language content by default. Under the policy, forcing a specific language without offering user choice can be a natural-language locale violation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The document repeatedly frames the skill's required access as least-privilege and read-only, but its verification section tells users to run aliyun plugin update, which modifies the local CLI environment. That inconsistency can mislead operators into performing an unnecessary state-changing action during what should be a non-invasive permission validation flow, increasing supply-chain and change-management risk.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.