Back to skill

Security audit

MySQL Skill - 对话式数据库管理

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent MySQL helper, but it gives broad database-changing guidance without clear confirmation safeguards and includes privileged install plus weak credential-handling advice.

Install only if you intend to let an agent help administer MySQL. Use a least-privilege database account, prefer read-only credentials for analysis, protect any credential files with restrictive permissions, avoid long-lived password environment variables, and require manual review plus confirmation before any UPDATE, DELETE, ALTER, restore, or production backup command is run.

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

Warning
Location
SKILL.md:62
Finding

Insecure Database Credential Storage Guidance

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 62–77
Vulnerability Type: Plaintext sensitive credential exposure
Risk Level: Medium

Vulnerable Code

ini
[client]
host = localhost
user = your_username
password = your_password
database = your_database
bash
export MYSQL_HOST=localhost
export MYSQL_USER=your_username
export MYSQL_PASSWORD=your_password
export MYSQL_DATABASE=your_database

Technical Analysis

The skill instructs users to store a MySQL password directly in ~/.my.cnf, but it does not require restrictive file permissions or verify file ownership. If the file is readable by other local accounts or processes, the database credential can be recovered in plaintext.

The alternative recommendation exposes the password through the MYSQL_PASSWORD environment variable. Environment variables are inherited by child processes and may also be captured by diagnostic tooling, debugging utilities, process inspection mechanisms, or crash reports. This unnecessarily broadens credential exposure.

The examples use placeholders rather than embedded real credentials; therefore, this is unsafe security guidance rather than a hardcoded-secret incident in the distributed project.

Attack Path

  1. A user follows the skill instructions and places a valid database password in ~/.my.cnf without applying restrictive permissions, or exports it through MYSQL_PASSWORD.
  2. A local user or compromised process reads the configuration file, inspects an accessible process environment, or obtains the environment from diagnostics or logs.
  3. The attacker extracts the MySQL username, password, host, and database name.
  4. The attacker authenticates to the configured MySQL server.
  5. The attacker performs any operation permitted to that account, potentially including reading records, modifying data, deleting data, changing schemas, or creating database exports.

Exploitation requires local process or account access sufficient to ret ...[truncated 716 chars]

Remediation
View remediation

Remediation Suggestions

  1. Require restrictive ownership and permissions when using an option file:
bash
touch ~/.my.cnf
chmod 600 ~/.my.cnf
chown "$(id -u):$(id -g)" ~/.my.cnf
  1. Prefer MySQL’s encrypted login-path facility over a plaintext password:
bash
mysql_config_editor set \
  --login-path=project-db \
  --host=localhost \
  --user=your_username \
  --password

Then connect with:

bash
mysql --login-path=project-db your_database
  1. For automated environments, retrieve credentials at runtime from a managed secret store and avoid placing secrets in source files, shell initialization files, command-line arguments, or long-lived environment variables.

  2. Use a dedicated MySQL account with only the permissions required for the requested task. Separate read-only, write, backup, restore, and administrative roles.

  3. Document credential rotation procedures and rotate credentials immediately if configuration files, environments, logs, diagnostics, or backups containing them may have been exposed.

  4. Add explicit warnings that configuration files and SQL backups must not be committed to version control and must be protected using restrictive filesystem permissions and encryption where appropriate.

Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (9)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly supports destructive actions such as UPDATE, DELETE, restore, and schema modification, but the examples and usage guidance do not consistently require strong warnings, dry-run previews, or irreversible-action confirmation. In a conversational agent, this can normalize dangerous requests and lead users or downstream tooling to execute data-destructive operations on production databases.

Content

No source excerpt is available for this finding.

Chaining Abuse

High
Category
Tool Misuse
Confidence
89% confidence
Finding

The chained command combines apt update and privileged package installation in a single shell expression, making review, approval, and failure handling less granular. In an agent-driven install context, command chaining increases the chance that a single approved action performs multiple privileged operations without clear user awareness.

Content

Scanner excerpt · package.json (reported line 26)May include surrounding context.

json
"kind": "system",
        "label": "Install MySQL Client",
        "commands": {
          "ubuntu": "sudo apt update && sudo apt install -y mysql-client",
          "macos": "brew install mysql-client"
        }
      }

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill advertises very broad natural-language triggers for MySQL, database queries, table creation, and backup operations, which can cause over-activation in ordinary conversations about databases. In an agent setting, that raises the chance of invoking a powerful database-management skill without sufficiently explicit user intent, potentially leading to unintended SQL generation or execution against live systems.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

Ubuntu/Debian:

bash
sudo apt update
sudo apt install mysql-client

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

Ubuntu/Debian:

bash
sudo apt update
sudo apt install mysql-client

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

This manifest description says the skill works "through natural language" to query and manage MySQL databases, but it does not define specific trigger phrases, scope boundaries, or exclusion conditions. In a manifest file, such broad activation wording can lead to unintended invocation because many common database-related requests could match.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
92% confidence
Finding

The install manifest instructs the platform to execute package installation with sudo, which requires elevated privileges and expands the blast radius if the installation path is abused or tampered with. In a skill ecosystem, embedding privileged system modification in metadata is risky because users or agents may run it with broad trust and limited review.

Content

Scanner excerpt · package.json (reported line 26)May include surrounding context.

json
"kind": "system",
        "label": "Install MySQL Client",
        "commands": {
          "ubuntu": "sudo apt update && sudo apt install -y mysql-client",
          "macos": "brew install mysql-client"
        }
      }

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The natural-language descriptions, examples, and interaction pattern are all presented in Chinese, which implies a fixed language experience. There is no indication that users may choose another language or that the Chinese-only behavior is a documented, justified locale constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
72% confidence
Finding

The user-facing description is written entirely in Chinese, which may impose a language expectation without any stated opt-in or locale justification. The policy requires avoiding forced language or locale constraints unless the skill clearly offers choice or documents a justified regional scope.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.