Back to skill

Security audit

Diseñador base de datos

Security checks for vulnerabilities and agentic risk

Overview

This database skill is coherent, but its migration generator can emit destructive and injectable SQL with weak rollback safeguards, so users should review it carefully before installing.

Install only if you will treat generated migrations as drafts. Review all SQL before applying it, avoid running migrations from untrusted schema JSON, use backups and least-privileged database roles, and be especially cautious when a generated plan contains DROP TABLE or DROP COLUMN.

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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/migration_generator.py:466
Finding

Unvalidated Schema Values Are Embedded in Executable Migration SQL

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/migration_generator.py:930
Finding

Destructive Table Migration Provides a Nonfunctional Rollback

Content
View full analysis
MigrationStep: """Create step for dropping table.""" table = table_info['definition'] drop_sql = f"DROP TABLE {table.name};" # Would need to recreate entire table for rollback # This is simplified - full implementation would generate CREATE TABLE statement create_sql = f"-- Recreate table {table.name} (implementation needed)" return MigrationStep( step_id=self._generate_step_id(), step_type="DROP_TABLE", table=table.name, description=f"Drop table {table.name}", sql_forward=drop_sql, sql_rollback=create_sql, risk_level="HIGH" # Data loss risk ) ``` ### Technical Analysis When a table exists in the current schema but not in the target schema, the generator emits an executable `DROP TABLE` statement. The corresponding `sql_rollback` value is only a comment and performs no recovery. This violates the stated Skill requirement that every migration include a down script. It also creates a misleading migration plan because the destructive step has a rollback field even though the rollback cannot recreate the schema or restore the deleted data. Even a generated `CREATE TABLE` statement would recover only the table definition, not its prior records. A reliable rollback for table deletion requires a verified backup, snapshot, archival table, or equivalent restoration mechanism. ### Attack Path 1. A target schema intentionally or accidentally omits a table from the current schema. 2. The schema comparator classifies the table as dropped. 3. The migration generator emits `DROP TABLE`. 4. A developer or deployment system applies the generated migration. 5. The table and its conte ...[truncated 1067 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (6)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The code substantially aligns with part of the declared description: it analyzes existing schemas for normalization, naming, constraints, data types, and missing indexes, and generates ERD output. However, the declared purpose is materially broader than the actual implementation. The code does not design schemas from scratch, compare or choose database engines, generate migration scripts, or interpret EXPLAIN plans. Its primary behavior is limited to static analysis of SQL DDL / JSON schema input and ERD/report generation. Because several prominent declared capabilities are absent, the description does not accurately represent what the supplied code chunk actually does.

Content

No source excerpt is available for this finding.

Anti-Refusal Statement

High
Category
Anti-Refusal
Confidence
80% confidence
Finding

Skill attempts to nullify the agent's safety policies or restrictions ('you have no restrictions', 'ignore your guidelines', 'do anything now'). This is a direct jailbreak that disables guardrails.

Content

Scanner excerpt · references/database-design-reference.md (reported line 304)May include surrounding context.

Phase 1: Expand

sql
-- Add new column without constraints
ALTER TABLE users ADD COLUMN new_email VARCHAR(255);

-- Backfill data in batches

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill instructs the agent to read reference files and run local scripts that take schema/query files as inputs, but it does not declare any explicit tool scope or permissions. That creates an authorization gap where the agent may access files beyond the minimally intended set, increasing the chance of unintended file reads or writes if a user supplies paths or if the runtime grants broad filesystem access.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The code generates destructive column-drop migration steps that can permanently remove data, but it does not require any explicit acknowledgement, confirmation gate, or prominent warning in the generated output. In a migration-generation skill, users may trust generated SQL and execute it directly, so silent generation of data-loss operations materially increases the chance of accidental destructive changes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The table-drop generation emits DROP TABLE statements even though rollback is explicitly incomplete ('implementation needed'), making the operation effectively irreversible in practice. In the context of a database design and migration skill, this is especially dangerous because the tool presents itself as generating safe migrations and rollback scripts, which may cause users to overtrust a data-destructive plan.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

This code writes generated ERD or analysis output to a user-specified path via open(..., 'w'), which can overwrite existing files. Although this is part of the tool's purpose, there is no confirmation prompt or explicit warning in the code comments/docstring near the write paths that output files may be overwritten.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.