Back to skill

Security audit

KWDB Performance Review

Security checks for vulnerabilities and agentic risk

Overview

The skill is not deceptive or executable, but it gives under-scoped advice for cluster-wide database settings and schema-changing SQL despite claiming those areas are out of scope.

Review this skill before installing if you only wanted SQL query review. It can produce useful KWDB performance advice, but it also teaches cluster-wide configuration and schema-changing actions. Treat any SET CLUSTER SETTING, CREATE INDEX, DROP INDEX, or ANALYZE output as DBA-reviewed change-management material, not routine assistant advice.

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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (24)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger list includes broad phrases like 'performance', 'slow query', and related generic wording that can match many ordinary database conversations. Over-broad activation can invoke this skill in the wrong context, leading to irrelevant or unsafe advice, especially where the skill may drift into config tuning or engine-specific recommendations without sufficient confirmation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

Several activation examples are ambiguous and insufficiently constrained, making unintended invocation plausible. In this skill, that matters because mistaken activation could push users toward KaiwuDB-specific query or cluster-setting guidance when they asked a broader database or application-performance question.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documentation first excludes deployment/configuration questions, then later instructs configuration optimization and cluster-setting review. Such contradictory instructions weaken safety boundaries because an agent may follow the more detailed later workflow and provide operationally sensitive advice despite the earlier prohibition.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill metadata and scope statements say deployment/configuration are out of scope, but the body later introduces cluster-setting review and configuration tuning workflows. This inconsistency can cause the agent to engage in higher-risk operational guidance outside its declared boundary, increasing the chance of unsafe activation and user confusion around whether infrastructure-level advice is permitted.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% 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 193)May include surrounding context.

md
6. **Explain WHY the optimization works** - not just what to change
7. **Validate with EXPLAIN** before finishing
8. **Confirm memory and disk before config changes** - never suggest cache/memory size increases without confirmed free resources
9. **Never auto-execute SET CLUSTER SETTING** - only provide SQL for user to review
10. **Never use SHOW CLUSTER SETTINGS** - always query specific settings individually
11. **Resource overload reduce warning** - when recommending reduced values for memory/CPU-impact parameters, always include the risk warning about potential performance degradation

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill is explicitly scoped to SQL query performance review and excludes DDL, schema design, deployment, and DML writes, yet this template shifts the workflow into cluster configuration tuning. That can cause the agent to provide infrastructure-level advice outside its declared competence and safety boundary, increasing the chance of unsafe or irrelevant recommendations that affect the whole cluster rather than a single query.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The template includes concrete SET CLUSTER SETTING statements, enabling the skill to recommend direct modification of global database settings even though the skill's stated purpose is performance review of SQL queries. In context, this is more dangerous because cluster settings are high-impact, affect all workloads, and can degrade performance, increase resource consumption, or destabilize production if applied without proper operational review.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This example instructs the user to execute cluster-wide configuration changes even though the skill is scoped to query performance review and explicitly not for broader operational changes. In an agent setting, this can cause the skill to overstep its intended authority and steer users toward persistent system-level modifications with availability, performance, and resource tradeoff consequences beyond a single query review.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

These examples repeatedly recommend modifying storage compression, cache sizing, and compaction behavior, which are cluster-wide operational controls rather than query-review outputs. Because the skill is framed as performance advice, users may apply these commands without appreciating their blast radius, leading to degraded write throughput, increased memory pressure, altered IO patterns, or broader service instability.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The examples apply the delegation boundary inconsistently: one schema change is explicitly delegated to another skill, while another example later recommends direct index creation. This inconsistency is dangerous because it weakens policy enforcement and can train an agent to sometimes ignore scope limits, leading to unauthorized or unreviewed schema changes.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill metadata explicitly says it is not for DDL or schema design, yet this example directly recommends CREATE INDEX, which is a schema-modifying operation. That boundary violation can cause an agent to perform out-of-scope database changes without proper review, increasing the risk of unsafe production modifications and bypassing intended delegation controls.

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 optimizing SQL query performance and explicitly says it is not for DDL, schema design, deployment, or DML writes, but this file provides broad database cluster configuration optimization guidance. It covers storage, compression, compaction, memory, write performance, disk cleanup, and cluster settings changes, which are materially different from EXPLAIN/query-plan-focused SQL tuning and broaden the skill into operational parameter tuning.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This reference exceeds the skill's declared read-only performance-analysis scope by recommending and showing mutating DDL operations such as CREATE INDEX and DROP INDEX. In an agent setting, that can cause the assistant to suggest or generate schema-changing actions that may disrupt production systems, create lock/contention issues, or remove needed indexes under the guise of performance tuning.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The pseudocode appends cursor_ts directly into the SQL string using interpolation, which teaches an unsafe query construction pattern. If a caller can influence the cursor value, this can lead to SQL injection or malformed queries, and the risk is elevated because the document is instructional guidance likely to be copied into production code.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The example function builds SQL by concatenating an unescaped cursor value into the WHERE clause without any safety guidance. In a performance-tuning skill, readers may treat the sample as best practice and reuse it, creating a realistic path to SQL injection in applications that expose pagination cursors to users or APIs.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest says the skill is not for DDL or schema design, but this file recommends and demonstrates CREATE INDEX statements, which are DDL operations that modify database schema. It also later recommends ANALYZE, a maintenance command that changes optimizer statistics state rather than purely analyzing plans.

Content

No source excerpt is available for this finding.

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/schema-tuning.md (reported line 35)May include surrounding context.

md
### ttl_duration

Automatically removes old data to control table size. Delegate TTL changes to `kwdb-schema-design`.

**Benefits:**
- Automatic data cleanup

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/timeseries-optimization.md (reported line 212)May include surrounding context.

md
### TTL for Data Lifecycle

TTL automatically removes old data to control table size. Delegate TTL changes to `kwdb-schema-design`.

### DICT ENCODING for High-Cardinality Strings

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill is explicitly scoped to query optimization, but this section documents SET CLUSTER SETTING commands that change behavior beyond a single query and can affect the whole deployment. In a guidance skill, this creates an authorization and blast-radius mismatch: a user seeking query tuning could be induced to make administrative changes with system-wide performance, availability, or data-governance consequences.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The documentation presents cluster-level settings as straightforward tuning options but does not warn that they may affect all users, workloads, or result semantics across the cluster. Missing safety context increases the chance of accidental misuse, especially in an agent setting where examples may be copied verbatim as recommendations.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Providing administrative cluster-setting actions is unjustified by the stated purpose of a query-review skill and may normalize privileged operational changes as routine tuning advice. An agent using this material could recommend or emit commands that alter global execution behavior, row limits, or ordering semantics without proper change control.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
61% confidence
Finding

The file frames itself as relational-table-only guidance and includes caveats in some places, but also lists generic recommendations such as inverted indexes and multiple index forms without consistently tying them to confirmed KaiwuDB relational support. That creates mild intent/documentation divergence because the document presents advice as applicable guidance while only partially qualifying engine support.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The example WHERE u.region = 'Beijing'; embeds a specific locale/city value in natural language content. Because the document does not explain that this is merely one interchangeable example or that the skill is region-specific, it can be interpreted as privileging a specific locale without user opt-in.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

ANALYZE table_name is an operational command that updates planner statistics, which goes beyond read-only EXPLAIN analysis and query rewriting guidance described in the manifest. While performance-related, it expands the skill from analysis into modifying database metadata/state.

Content

No source excerpt is available for this finding.