Back to skill

Security audit

Lite Sqlite

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a legitimate local SQLite helper, but it gives an agent broad ability to change, delete, and copy databases with weak safeguards.

Install only if you are comfortable letting the agent create, alter, delete, optimize, and copy local SQLite databases it can access. Avoid using it on production or sensitive databases without explicit review, validate table names and WHERE clauses, and take backups before running delete, update, migration, restore, or replace-import workflows.

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
scripts/sqlite_connector.py:74
Finding

SQL Injection Through Unvalidated Identifiers and SQL Clauses

Content
View full analysis
Remediation
View remediation
str: if not isinstance(value, str) or not _IDENTIFIER.fullmatch(value): raise ValueError(f"Invalid SQL identifier: {value!r}") return value ``` 2. **Quote validated identifiers.** Use SQLite double-quoted identifiers and escape embedded quotes. Validation should still be applied to reject unexpected syntax: ```python def quote_identifier(value: str) -> str: validate_identifier(value) return f'"{value.replace(chr(34), chr(34) * 2)}"' ``` Apply this function separately to table names, column names, and generated index names. 3. **Do not accept free-form WHERE clauses in higher-level APIs.** Replace them with structured conditions whose values are always bound: ```python def delete_equal(self, table: str, conditions: Dict[str, Any]) -> int: quoted_table = quote_identifier(table) clauses = [ f"{quote_identifier(column)} = ?" for column in conditions ] sql = f"DELETE FROM {quoted_table} WHERE {' AND '.join(clauses)}" return self.conn.execute(sql, tuple(conditions.values())).rowcount ``` If advanced expressions must remain supported, expose them through an explicitly named trusted-input method such as `delete_raw_where()` and clearly document the security boundary. 4. **Allowlist schema definitions.** Do not accept arbitrary type and constraint strings. Parse requested types and options, then permit only supported values such as `INTEGER`, `REAL`, `TEXT`, `BLOB`, `PRIMARY KEY`, `NOT NULL`, and approved default forms. 5. **Validate batch rows consistently.** Ensure all rows have the same validated column set and build each value tuple according to the first row's explicit column ordering rathe ...[truncated 702 chars]
Vulnerability Patterns
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (14)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
The bundled `sqlite_cli.py` provides command-line access:

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
The bundled `sqlite_cli.py` provides command-line access:

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
The bundled `sqlite_cli.py` provides command-line access:

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
The bundled `sqlite_cli.py` provides command-line access:

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
The bundled `sqlite_cli.py` provides command-line access:

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
The bundled `sqlite_cli.py` provides command-line access:

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest description says to use the skill when 'creating or managing SQLite databases' and for 'agent data storage' in very general terms, without defining specific trigger phrases, constraints, or exclusion conditions. This broad wording could overlap with many ordinary requests about storage or persistence and may cause unintended invocation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The documentation includes direct UPDATE and DELETE examples without warning that they are destructive. In an agent skill context, examples often become copied execution patterns, so omission of confirmation, transaction use, or backup guidance increases the risk of accidental data loss.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

Backup, migration, and schema-change operations are presented as routine examples without caution about integrity validation, rollback, or overwrite risks. In a local persistence skill, these actions can corrupt data, lose historical content, or replace production state if an agent applies them automatically.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The import example uses to_sql(..., if_exists="replace"), which can overwrite an existing table and destroy prior contents. Because the snippet is presented as a normal migration pattern without warning, users or agents may adopt it in production and unintentionally replace live data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The delete command performs row deletion and only reports the result after execution. There is no confirmation prompt, pre-execution warning, or other user disclosure before this irreversible data-changing action occurs.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The backup method creates parent directories and writes a full database backup file, which is a safety-relevant file write that may duplicate stored data. While the code has a docstring, there is no user-facing confirmation, logging, or warning about the persistence and potential sensitivity of the copied database contents.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The auto_backup method automatically generates backup filenames and writes database copies into a target directory, potentially creating repeated persisted copies of user data. The code documents the function for developers, but it does not provide any runtime disclosure, confirmation, or warning to users about these file writes.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The comment 'Auto-cleanup expired entries' is followed by db.query("DELETE FROM cache ..."), which is a mutating delete operation rather than a read/query. This is an active contradiction in the documentation because it labels destructive behavior as a query-style operation.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.