Back to skill

Security audit

SQL全生命周期审核

Security checks for vulnerabilities and agentic risk

Overview

This SQL-auditing skill is mostly purpose-aligned, but its instructions tell agents to run shell-style commands with user-provided SQL, DDL, database names, and file paths in unsafe templates.

Review before installing. Use this only in an environment where dbskiter is trusted, avoid submitting secrets or confidential database artifacts unless you understand how dbskiter processes them, and require shell-safe execution that passes user SQL, DDL, database names, and file paths as separate validated arguments rather than interpolating them into shell commands.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:27
Finding

Shell Command Injection Through User-Controlled SQL, Database Names, and File Paths

Content
View full analysis
audit sql "" dbskiter --output-mode=ai --database= audit sql "" dbskiter --output-mode=ai --database= audit ddl "" dbskiter --output-mode=ai --database= audit file ``` The associated workflow directs the agent to extract user-provided SQL or DDL and place it directly into these command templates before execution. ### Technical Analysis The skill constructs command-line instructions by textually interpolating user-controlled values into shell command strings. The SQL and DDL arguments are enclosed in double quotes, but double quotes do not suppress shell command substitution through `$(...)` or backticks. A malicious value can therefore cause the shell to execute a nested operating-system command before `dbskiter` receives the argument. The `` database value and `` file value are not quoted at all. If these placeholders are populated from untrusted input, shell separators, redirections, substitutions, whitespace, or option-like values may alter the intended command. The same unsafe pattern appears in the optimization, index recommendation, cost estimation, and rewrite templates at lines 92–116. Exploitation depends on the agent or runtime executing the generated command through a shell. The skill explicitly instructs the agent to execute these textual command templates and does not require an argument-array API, input validation, path restrictions, or shell-safe handling. ### Attack Path 1. An attacker asks the agent to audit SQL or DDL containing shell substitution syntax, for example: ```sql SELECT '$(attacker-controlled-command)' ``` 2. The ski ...[truncated 1391 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill does not warn users that SQL text, DDL, execution plans, or file contents may be transmitted to an external auditing tool, creating a material risk of unintended data disclosure. In this context the danger is elevated because database queries and schema artifacts often contain sensitive table names, tenant identifiers, business logic, or even secrets and internal infrastructure details.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

Broad trigger phrases like '审核SQL' or '检查规范' without scope constraints can cause the skill to activate in unintended contexts and send SQL, DDL, or file paths to the external tool when the user did not explicitly request that action. In a database-oriented skill, accidental invocation is more dangerous because the content may contain sensitive schema details, credentials embedded in queries, or proprietary business logic.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Lines L003-L016 describe a limited audit-focused skill covering SQL audit, DDL impact analysis, file audit, and rule listing. However, lines L090-L118 add new operational capabilities that go beyond auditing into active optimization and rewrite assistance, creating a semantic mismatch between the manifest's declared scope and the documented behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
72% confidence
Finding

All user-facing descriptions, trigger examples, and operational guidance are presented only in Chinese, with no indication that language selection is configurable or intentionally limited to a Chinese-speaking context. This can violate language/locale policy when a skill effectively forces one language without opt-in or justification.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The earlier manifest section at L006-L016 and L025-L031 presents the supported user intents and commands as a small, specific set. The later section at L064-L118 actively reframes the skill as supporting nine commands, including commands not previously declared, which is not merely additional detail but contradictory guidance about what the skill is meant to do.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.