Back to skill

Security audit

huawei-cloud-mrs-hetu-sql-check

Security checks for vulnerabilities and agentic risk

Overview

This skill is a local HetuEngine SQL checker with no evidence of network access, credential use, persistence, or hidden behavior, though its documented coverage is broader than parts of the implementation.

Install is reasonable for local HetuEngine SQL linting. Review SQL/file inputs before running it, avoid passing sensitive non-SQL files, and treat results as advisory because some documented checks are partial and reports/rule text are largely Chinese.

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
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (19)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The skill claims comprehensive syntax, specification, and optimization review, but the finding indicates the implementation is much more limited. This can cause users to trust incomplete analysis results, leading to unsafe SQL or policy violations being missed because the tool overstates its coverage and assurance.

Content

No source excerpt is available for this finding.

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

md
**Typical Use Cases**:
- "Check this HetuEngine SQL: SELECT * FROM t1"
- "Does this CREATE TABLE follow HetuEngine specification?"
- "Validate the syntax of this INSERT OVERWRITE statement"
- "Review my SQL for HetuEngine specification compliance"
- "Check if my SQL uses PARTITIONED BY correctly"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
[hetu_sql_checker.py](scripts/hetu_sql_checker.py)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
[hetu_sql_parser.py](scripts/hetu_sql_parser.py)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| [Keywords](rules/keywords.py) | 400+ HetuEngine SQL keyword definitions |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| [Grammar Rules](rules/grammar_rules.py) | 30+ statement type grammar definitions |

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 · rules/grammar_rules.py (reported line 646)May include surrounding context.

python
"""Get the category of a statement type"""
    rule = STATEMENT_RULES.get(statement_type)
    if rule:
        return rule["category"]
    return None

Memory Manipulation

High
Category
Memory Poisoning
Confidence
80% 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 · rules/keywords.py (reported line 81)May include surrounding context.

python
Collabel("VALUES", KeywordCategory.RESERVED, "Values list"),
    Collabel("SET", KeywordCategory.RESERVED, "Set clause"),
    Collabel("UPDATE", KeywordCategory.RESERVED, "Update statement"),
    Collabel("DELETE", KeywordCategory.RESERVED, "Delete statement"),
    Collabel("INSERT", KeywordCategory.RESERVED, "Insert statement"),
    Collabel("CREATE", KeywordCategory.RESERVED, "Create statement"),
    Collabel("DROP", KeywordCategory.RESERVED, "Drop statement"),

Memory Manipulation

High
Category
Memory Poisoning
Confidence
80% 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 · scripts/hetu_sql_parser.py (reported line 576)May include surrounding context.

python
return node

    # ============================================================
    # DELETE Statement Parser
    # ============================================================

    def _parse_delete(self):

Memory Manipulation

High
Category
Memory Poisoning
Confidence
80% 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 · scripts/hetu_sql_parser.py (reported line 580)May include surrounding context.

python
# ============================================================

    def _parse_delete(self):
        """Parse DELETE statement"""
        node = ASTNode("DeleteStmt")
        start_token = self._current()

Memory Manipulation

High
Category
Memory Poisoning
Confidence
80% 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 · scripts/hetu_sql_parser.py (reported line 1424)May include surrounding context.

python
# ============================================================

    def _parse_set_reset(self, stmt_type):
        """Parse SET/RESET statement"""
        node = ASTNode("SetStmt")
        start_token = self._current()

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill instructs the agent to read and execute local Python scripts, but it does not declare any explicit tool scope such as permissions or allowed-tools. That creates an authorization gap where consumers cannot clearly constrain or audit file access behavior, increasing the chance of unintended local file reads or broader capability use than expected.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill asserts that analysis is static, local-only, and requires no cluster connection, yet later references a rule that needs cluster queries. Conflicting security claims can mislead operators about data exposure and runtime behavior, potentially causing the skill to be used in environments where network or data-access assumptions are stricter than the real implementation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This YAML file’s natural-language names, descriptions, and fix suggestions are entirely in Chinese, and there is no indication that the skill is region-specific or that users can opt into this language. Under the policy, forcing a specific language without user choice or documented justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown template is entirely written in Chinese, including required report headings and field labels, which implies the generated report will be in a fixed language. The file does not offer any language selection, opt-in, or justification for a Chinese-only locale, which is a natural-language locale policy concern under the stated rules.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The manifest includes Chinese-only trigger phrases alongside one English phrase, and the skill's sample output/report sections are presented in Chinese without stating that users may choose another language. This can conflict with a language/locale policy requiring user choice rather than implicitly enforcing one locale.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill says in Step 6 that the checker generates a Markdown report and even shows Markdown output, but later states that the direct command output is JSON format. These are mutually contradictory usage instructions about what the same checker command returns, which can mislead users about the skill's actual behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This YAML file defines all rule names, descriptions, and fix suggestions in Chinese, which can impose a specific language on users or downstream tooling. There is no indication that the skill is intentionally region-specific or that users may opt into another language.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

This is a code file, so SQP-2 applies to safety-relevant operations such as file access. The code opens and reads any path provided by the user, but there is no confirmation prompt or nearby disclosure comment explaining that the tool will access local files; the usage text only says it supports a file path, which does not function as a safety warning.

Content

No source excerpt is available for this finding.