Back to skill

Security audit

database-toolkit

Security checks for vulnerabilities and agentic risk

Overview

This database skill does what it claims, but it gives agents direct database read/write/delete power with weak guardrails and unsafe SQL helper patterns.

Install only if you are comfortable giving this skill access to the intended databases. Use least-privilege database accounts, test on backups or staging data first, avoid passing user-controlled table names or where clauses to helper methods, require explicit review before writes/deletes/imports/flushes, and use secured TLS settings for remote MySQL connections.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
database_ops.py:95
Finding

SQL Injection Through Unvalidated Identifiers and Clauses

Content
View full analysis
int: columns = ', '.join(data.keys()) placeholders = ', '.join(['?' for _ in data]) sql = f'INSERT INTO {table} ({columns}) VALUES ({placeholders})' with self.get_cursor() as cursor: cursor.execute(sql, tuple(data.values())) return cursor.lastrowid def update(self, table: str, data: Dict, where: str, params: tuple = None) -> int: set_clause = ', '.join([f'{k} = ?' for k in data.keys()]) sql = f'UPDATE {table} SET {set_clause} WHERE {where}' values = tuple(data.values()) + (params or ()) with self.get_cursor() as cursor: cursor.execute(sql, values) return cursor.rowcount def delete(self, table: str, where: str, params: tuple = None) -> int: sql = f'DELETE FROM {table} WHERE {where}' with self.get_cursor() as cursor: cursor.execute(sql, params or ()) return cursor.rowcount def count(self, table: str, where: str = None) -> int: sql = f'SELECT COUNT(*) as cnt FROM {table}' if where: sql += f' WHERE {where}' return self.fetch_value(sql) or 0 ``` ```python # mysql_ops.py def get_columns(self, table: str): result = self.execute(f'DESCRIBE {table}') return [r['Field'] for r in result] def count(self, table: str, where: str = None) -> int: sql = f'SELECT COUNT(*) as cnt FROM {table}' if where: sql += f' WHERE {where}' return self.fetch_value(sql) or 0 ``` ```python # extra_db.py def get_columns(self, table): return [r[0] for r in self.execute( f"SELECT column_name FROM information_schema.columns WHERE table_name='{table}'" )] ``` ### Technical Analysis Although values are ...[truncated 1948 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
mysql_ops.py:31
Finding

Remote MySQL Connections Do Not Enforce Verified TLS

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Unpinned Third-Party Dependencies Produce Non-Reproducible Installations

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (20)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This markdown file advertises insert, update, delete, backup, import, and export capabilities, but it does not include any caution that these operations can alter or overwrite database contents. For a database-manipulation skill, users should be explicitly warned about risks to data integrity and advised to use backups or test environments before running write operations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

文件名 README_CN.md 且标题与全文内容均为中文,未见任何关于可选语言、用户语言偏好或该中文版本仅为区域化文档的说明。根据规则,未经用户选择而强制单一语言属于自然语言层面的语言/区域策略问题。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill explicitly enables direct database maintenance and backup/restore style operations, but the documentation only gives a generic caution and does not clearly warn about irreversible modification, destructive SQL, or the operational risks of restoring or overwriting data. In a skill that exposes raw SQL and maintenance actions, weak safety guidance increases the chance of accidental destructive use, especially by non-expert operators.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The code exposes a destructive flushdb() operation that can erase all data in the selected Redis database, but there is no confirmation prompt, logging, comment, or docstring warning describing this impact. For a safety-critical deletion operation, the file provides no visible disclosure to the user about the risk of irreversible data loss.

Content

No source excerpt is available for this finding.

Unbounded Resource Access

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill allows unbounded resource consumption (API calls, storage, compute). Without rate limits or quotas, a compromised or misbehaving agent can cause denial-of-service or cost overruns.

Content

Scanner excerpt · database_enhanced.py (reported line 249)May include surrounding context.

python
message = json.dumps(message)
        return self.redis.lpush(self.queue_name, message)
    
    def pop(self, blocking=False, timeout=0):
        if blocking:
            import time
            start = time.time()

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The delete method performs row deletion and commits automatically via the cursor context manager, but there is no confirmation prompt, logging, or explicit warning comment/docstring indicating that data will be removed. This file also includes other destructive SQL execution paths, so users of the skill are not clearly warned before irreversible changes occur.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The helper functions at L233-L250 and the example block at L288 use with DatabaseOps(...) as db, which implies the class supports __enter__/__exit__ semantics for safe automatic resource management. However, the DatabaseOps class defined at L16-L229 provides no context-manager methods, so the documented/intended usage contradicts the actual implementation and will fail at runtime.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The export_to_json function reads database contents and writes them to a JSON file, potentially materializing sensitive data on disk. The code contains no user-facing warning, confirmation, or explanatory comment beyond the brief docstring, so the data export side effect is not clearly disclosed.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This code performs persistent database modifications, including inserts, updates, deletes, and SQL commits, but provides no confirmation prompt, logging, print statement, or explanatory comments/docstrings warning that user data may be changed. Because these are safety-relevant write operations in a code file, they should include some visible disclosure unless clearly documented elsewhere.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Multiple docstrings and comments are written in Chinese, including the module header and method descriptions, with no indication that the skill supports other languages or allows user opt-in. This creates a language-policy concern because the file's natural-language guidance appears to require a specific language by default.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

This code performs committed database modifications and deletions through execute_many, insert, insert_many, update, and delete, but provides no confirmation prompt, logging, or explicit user-facing disclosure around these potentially destructive actions. The short Chinese docstrings describe the functions but do not warn that they will immediately modify or remove database records.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The skill documentation uses Chinese headings and descriptions throughout, which can impose a language constraint on users without an explicit opt-in or stated regional scope. The policy requires avoiding forced language or locale choices unless the skill offers alternatives or clearly documents the constraint.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

README 在快速函数示例中直接展示了 DELETE 执行语句,属于可能影响用户数据的破坏性数据库操作。虽然末尾有一般性“写操作前备份”提示,但未在该操作附近或功能说明中明确提醒删除是不可逆/高风险行为,用户警示仍偏不足。

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The code examples demonstrate insert and backup functionality as normal usage patterns without nearby guardrails, confirmations, or warnings about production data impact. While the examples are not inherently malicious, presenting mutating operations this casually can normalize unsafe execution and lead to accidental data corruption or unwanted backups containing sensitive data.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The module docstring contains user-facing descriptive text in Chinese, and many docstrings throughout the file are also Chinese-only. This creates an implicit language constraint without any indication that users can choose another language or locale.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The backup method copies the database to a new file path, which is a file write affecting user data on disk. Although the method name suggests backup behavior, the implementation provides no user-facing log, prompt, or warning about where the backup is written.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The class docstrings use Chinese-only descriptions ("PostgreSQL连接" and "MongoDB连接") while the rest of the file is otherwise English-oriented, with no indication that language choice is optional or region-specific. This can violate a language/locale policy when a skill implicitly fixes one language without offering user choice or documenting the constraint.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
71% confidence
Finding

The connect method uses host, user, password, and database values to establish a network connection to MySQL, but there is no visible warning, logging, or explanatory comment about transmitting credentials or interacting with a remote database. For a code file, this is a network operation involving sensitive authentication data with no user disclosure in the file.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

The dependency manifest specifies pandas without a version pin, which makes builds non-reproducible and can allow installation of unexpectedly vulnerable or breaking releases over time. While this is a supply-chain hygiene issue rather than an immediately exploitable flaw by itself, it increases exposure because the exact installed version cannot be audited or guaranteed.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
pandas
# MySQL (optional): pymysql sqlalchemy

Unverifiable Dependency: pandas has 1 known advisory(ies) (CVE-2020-13091 (** DISPUTED ** pandas through 1.0.3 can unserialize and execute commands from an)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
87% confidence
Finding

Because pandas is unpinned, it is impossible to determine from this manifest whether deployment will select a version affected by the cited advisory. The referenced CVE is disputed, which lowers severity, but the lack of version control still prevents reliable verification and may allow an affected version to be installed in some environments.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.