Back to skill

Security audit

alibabacloud-flink-sql-skill

Security checks for vulnerabilities and agentic risk

Overview

ClawScan rates this skill suspicious because it found a confirmed risk that starting a job could target a different deployment than the one the user confirmed, along with concerns about recording job data and sending user comments to an external model; the review is incomplete.

Consider the suspicious verdict carefully before installing. In particular, weigh the risk that a job could start on a deployment other than the one you confirmed, and that observation or example workflows could expose records or comments through logs or an external model. The scan covered 37 of 40 components; some analysis was partial, so it cannot establish that unreported behavior is safe.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
Findings (16)

Context Leakage

High
Category
Data Exfiltration
Confidence
75% confidence
Finding

Code or instructions that leak agent conversation context to external services, potentially exposing sensitive user interactions.

Content

Scanner excerpt · references/diagnosis/job-observability.md (reported line 368)May include surrounding context.

Filtering Logs

For returned logs or local logs supplied by the user, use a read-only search to extract context, for example:

bash
rg -n -C 20 -- 'OutOfMemoryError|CheckpointException|<user-keyword>' <log-file>

Context Leakage

High
Category
Data Exfiltration
Confidence
75% confidence
Finding

Code or instructions that leak agent conversation context to external services, potentially exposing sensitive user interactions.

Content

Scanner excerpt · references/diagnosis/job-observability.md (reported line 641)May include surrounding context.

--flink_api_path '/taskmanagers//thread-dump'

text

Extract thread names, states, and relevant frames, preserving waiting objects or lock information when returned. One WAITING/BLOCKED stack is not proof of a deadlock. Stacks from different times can support further analysis, but this query does not itself establish a root cause.

### Sampling Semantics

Memory Manipulation

High
Category
Memory Poisoning
Confidence
85% confidence
Finding

Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Content

Scanner excerpt · references/git-sync.md (reported line 7)May include surrounding context.

md
## Configuration

`config_init` saves Git settings with the resource scope. See [configuration.md](configuration.md) for question order, defaults, the configuration file, and overwrite rules. Synchronization is disabled when `git.repo_url` is absent. Repository authentication uses only the local Git/SSH environment; never embed credentials in an HTTP(S) URL.

## Automatic Triggers

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/git_sync.py (reported line 321)May include surrounding context.

python
raise GitSyncError(f"Invalid Git branch name: {self.branch}")

    def _run(self, *arguments, cwd=None, check=True, timeout=120):
        environment = os.environ.copy()
        environment["GIT_TERMINAL_PROMPT"] = "0"
        try:
            result = subprocess.run(

Job startup can act on a different Deployment than the one confirmed.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

cmd_start_job requests confirmation for args.deployment_id, but subsequently replaces the entire request body with --body_json, allowing its deploymentId to identify a different Deployment. The API therefore can start a Job for a target that was not confirmed, within the caller's existing cloud permissions; it can also use a restore strategy different from the required CLI argument. This is particularly dangerous in a lifecycle-management agent because starting production workloads can consume resources, process or write data, and violate the skill's explicit resolved-target confirmation requirement.

Content

No source excerpt is available for this finding.

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, file_read, file_write, mcp, network, shell.

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.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

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

md
**High risk**: every `stop_*` and `delete_*` command, any restart or deployment flow that includes a stop, and destructive `execute_sql` statements such as `DROP` or `TRUNCATE`. A bare action request is not advance confirmation for a high-risk operation. If the current request explicitly confirms the high-risk action and its impact, and read-only resolution shows that the real target and strategy remain within the confirmed scope, report the resolved target and execute the CLI with `--confirm` without asking again. Otherwise, use [references/output-schemas.md](references/output-schemas.md) to restate the target, impact, strategy or irreversible consequence, and complete command, then wait for explicit confirmation.

Confirmation, including advance confirmation, applies only to the operations and targets in the current request. If multiple targets match, the scope changes, or the strategy is materially ambiguous, ask only for the missing information and do not reuse the confirmation. A

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/configuration.md (reported line 80)May include surrounding context.

md
`region_id` is an API region. For example, the console host `flink-cn-beijing.data.aliyun.com` maps to `cn-beijing`. It is neither an availability zone nor a workspace ID.

Do not ask the user to paste an AccessKey ID or AccessKey secret into the conversation. Do not read or echo credential values, and never put real credentials in command examples.

## Preflight Check

Operator observing records job data and downloads inspection logs without a privacy-impact warning.

Medium
Category
Output Handling
Confidence
90% confidence
Finding

Operator observing can materialize live business records in inspection logs and download them locally, but this workflow does not explain the resulting privacy exposure or require data-handling safeguards. The mutation confirmation and size limit reduce operational risk but do not address sensitive-record capture, local retention, or subsequent disclosure.

Content

No source excerpt is available for this finding.

The AI integration example sends user comments to an external model service without a privacy warning.

Medium
Category
Output Handling
Confidence
91% confidence
Finding

The example passes raw user-comment text to a model API without explaining that this can transfer personal or confidential information outside the original data-processing boundary. It is illustrative rather than automatically executed, which reduces immediate risk, but adopting it for real streams can create unauthorized disclosure or retention.

Content

No source excerpt is available for this finding.

Unbounded Output

Medium
Category
Output Handling
Confidence
60% confidence
Finding

Output size or generation rate is not bounded. Unbounded output enables denial-of-service through resource exhaustion, log flooding, or context-window stuffing.

Content

Scanner excerpt · references/sql/sink-upsert-materializer.md (reported line 53)May include surrounding context.

md
For example, aggregation by `(shop_id, channel)` normally establishes that pair as an Upsert Key. A Sink primary key of `(shop_id, channel)` is compatible if later operators preserve it. A Sink primary key of `(shop_id)` makes different channels compete for the same row; define the intended reduction or selection instead of simply disabling SUM.

Key expressions require particular care. An encoding must be injective: no truncation, ambiguous concatenation, or NULL/default collisions. For `GROUPING SETS` followed by `COALESCE`, verify that detail, subtotal, and total rows retain distinct keys. The syntax itself does not prove safe removal; the [Alibaba Cloud Changelog guide](https://help.aliyun.com/zh/flink/realtime-flink/use-cases/processing-changelog-events-out-of-orderness-in-flink-sql) describes conservative inference in this situation.

## Why One Sink Task or a Final Shuffle Is Insufficient

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

python
environment = os.environ.copy()
        environment["GIT_TERMINAL_PROMPT"] = "0"
        try:
            result = subprocess.run(
                ["git", "-c", "core.hooksPath=/dev/null", *arguments],
                cwd=cwd,
                text=True,

Excessive Permissions

Low
Category
Privilege Escalation
Confidence
80% confidence
Finding

Skill requests more permissions than appear necessary for its stated functionality. Review if elevated access is justified.

Content

Scanner excerpt · references/diagnosis/job-observability.md (reported line 621)May include surrounding context.

md
- API absent or rejected by proxy: verify target version, path, and permissions; do not conclude immediately that flame graphs are unsupported.
- Operator feature disabled, target ended, or sampling pending: report the actual state; do not collapse them into “no data.”
- JM/TM profiling failure: inspect the actual error and process logs. It may involve profiling scripts, native tools, event support, or system permissions; do not install tools or elevate permissions automatically.

### Thread Dumps

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Confidence
50% confidence
Finding

Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Content

Scanner excerpt · scripts/client.py (reported line 70)May include surrounding context.

python
for attr, env_name, config_key in fields:
        if not hasattr(args, attr):
            continue
        current = getattr(args, attr, None)
        if isinstance(current, str) and current.strip():
            args._scope_sources[attr] = "command line"
            continue

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Confidence
50% confidence
Finding

Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Content

Scanner excerpt · scripts/client.py (reported line 357)May include surrounding context.

python
missing argument.
    """
    for name in names:
        val = getattr(args, name, None)
        if val is None or (isinstance(val, str) and val.strip() == ""):
            return error_response(
                getattr(args, "subcommand", "unknown"),

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Confidence
50% confidence
Finding

Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Content

Scanner excerpt · scripts/metric_history.py (reported line 98)May include surrounding context.

python
class ConsoleClient:
    def __init__(self, args, cookie):
        for name in ("workspace", "namespace"):
            if not re.fullmatch(r"[a-zA-Z0-9][a-zA-Z0-9_-]*", getattr(args, name) or ""):
                raise MetricError(f"Invalid {name} format.", "ValidationError")
        origin = getattr(args, "console_url", None)
        if not origin: