Back to skill

Security audit

Db Explorer

Security checks for vulnerabilities and agentic risk

Overview

This database helper is mostly coherent, but it gives agents high-impact database commands with weak scoping and risky credential examples.

Review this skill before installing. Use it only with least-privileged database accounts, avoid pasting real passwords into command lines, prefer read-only operations by default, and require explicit confirmation plus target verification before any restore, import, migration, or full export. Avoid running the Redis KEYS example on production or shared Redis instances.

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

Error
Location
SKILL.md:40
Finding

Database Credentials Exposed Through Command-Line Arguments

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 40–49 and 64–70
Vulnerability Type: Credential exposure through process arguments and shell history
Risk Level: High

Vulnerable Code

bash
# PostgreSQL
psql "postgresql://user:password@host:5432/dbname" -c "\dt"           # list tables
psql "postgresql://user:password@host:5432/dbname" -c "\d table_name" # describe table
psql "postgresql://user:password@host:5432/dbname" -c "SELECT count(*) FROM table_name;"

# MongoDB
mongosh "mongodb://user:password@host:27017/dbname" --eval "db.getCollectionNames()"
mongosh "mongodb://user:password@host:27017/dbname" --eval "db.collection_name.countDocuments()"

# Redis
redis-cli -h host -p 6379 -a password INFO keyspace
redis-cli -h host -p 6379 -a password DBSIZE
redis-cli -h host -p 6379 -a password KEYS "*"

Technical Analysis

The skill asks users to provide database credentials and demonstrates inserting passwords directly into command-line arguments. Secrets supplied this way can be disclosed through:

  • Shell history files.
  • Process inspection utilities and monitoring agents.
  • Terminal session recordings.
  • Agent transcripts and command logs.
  • Error reports that capture complete command lines.

PostgreSQL and MongoDB connection URIs explicitly contain plaintext passwords. Redis commands use the -a argument, which similarly places the password in the process argument list. This behavior contradicts the skill's own safety rule stating that passwords should not be placed in history. Merely using a connection string does not protect a secret if that string is passed directly as an argument.

Attack Path

  1. A user supplies valid database credentials to the agent as requested by the skill.
  2. The agent substitutes those credentials into one of the documented commands.
  3. The command, including its plaintext password, is saved in shell history, agent logs, or process-monito ...[truncated 853 chars]
Remediation
View remediation

Remediation Suggestions

  • Remove all examples that embed passwords in command-line arguments or connection URIs.
  • For PostgreSQL, use a permission-restricted PGPASSFILE or .pgpass file and pass only a password-free connection target.
  • For MySQL, use mysql_config_editor, an appropriately protected option file, or an interactive password prompt.
  • For MongoDB, use an interactive password prompt or a protected configuration mechanism rather than embedding credentials in the URI.
  • For Redis, prefer an interactive authentication workflow or a tightly scoped secret mechanism. If REDISCLI_AUTH is used, set it only for the required process and clear it immediately afterward.
  • Ensure credential files are readable only by the owning user and are deleted securely when temporary.
  • Redact passwords, authentication tokens, and complete credential-bearing URIs from agent output, command previews, logs, diagnostics, and errors.
  • Add an explicit rule prohibiting direct substitution of secrets into shell commands, rather than suggesting that connection strings inherently avoid history exposure.
  • Use least-privileged, short-lived database credentials and rotate any credential that may already have been used with the documented commands.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:70
Finding

Blocking Redis Keyspace Enumeration Can Degrade Service Availability

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 70
Vulnerability Type: Unsafe unbounded database operation
Risk Level: Medium

Vulnerable Code

bash
redis-cli -h host -p 6379 -a password KEYS "*"

Technical Analysis

Redis processes KEYS "*" by synchronously traversing the complete selected keyspace. Its runtime grows with the number of stored keys, and the operation can block Redis from promptly serving other clients while the scan is performed.

The command is presented as part of the ordinary connection and exploration workflow without a key-count threshold, bounded result size, production warning, or explicit user confirmation. This conflicts with the skill's general requirement to limit query results and creates an avoidable availability risk on large or latency-sensitive Redis deployments.

Attack Path

  1. The skill is invoked to inspect a production or shared Redis instance.
  2. The agent follows the documented exploration command and executes KEYS "*" against a database containing a large number of keys.
  3. Redis synchronously scans the entire selected keyspace.
  4. Normal client requests are delayed while the operation consumes server execution time.
  5. Applications using the instance experience increased latency, request timeouts, cascading retries, or partial service unavailability.

A malicious user with permission to direct the agent's database exploration could intentionally select a large Redis deployment and request complete key enumeration to trigger the same condition.

Impact Assessment

The operation does not grant additional privileges. Its principal impact is degradation of availability within the selected Redis database and potentially the entire Redis instance, because other databases and clients share the same server execution path. The severity depends on keyspace size, server capacity, traffic levels, and application timeout behavior.

Remediation
View remediation

Remediation Suggestions

  • Replace KEYS "*" with incremental SCAN operations.
  • Apply a strict result limit during routine exploration, such as collecting no more than 100 representative keys.
  • Use a cursor-based command or redis-cli --scan and terminate once the configured sample limit is reached.
  • Require explicit user confirmation before any complete keyspace traversal.
  • Display an availability warning before running expensive commands against production or shared Redis instances.
  • Check DBSIZE first and refuse an unrestricted traversal when the key count exceeds a conservative threshold.
  • Prefer replicas or isolated diagnostic environments when comprehensive analysis is necessary.
  • Add timeouts, cancellation support, and rate controls to database exploration procedures.
  • Do not combine the replacement command with a plaintext -a password argument; use a protected authentication mechanism.
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

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

Restore commands are shown as normal operational examples without explicit warnings that they can overwrite, corrupt, or otherwise alter live database contents. In an agent-assisted environment, presenting restores without strong safeguards materially raises the risk of destructive mistakes on production systems.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The activation phrases are broad enough that ordinary user requests like 'check the database' or 'show me the data' could invoke the skill even when the user did not intend database access. Because this skill can enumerate schemas, export data, and includes write-capable guidance elsewhere, unintended activation increases the risk of unnecessary exposure of sensitive systems and data.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The safety guidance says not to expose passwords, yet several examples embed credentials directly in command lines and connection URIs. Command-line arguments and shell history can leak secrets to logs, process listings, screenshots, and audit systems, making credential compromise more likely.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

Export behavior is documented as routine workflow without a prominent warning about data sensitivity, destination handling, or system impact. Even if exports are read-only, they can create local files containing sensitive data and may exfiltrate or persist information beyond the database's normal access controls.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill is presented as a database exploration tool, but it also includes restore and migration/import operations that can modify or overwrite database contents. In an agent setting, this expands the capability from read-only inspection into destructive or state-changing administration, increasing the chance of accidental or unauthorized data loss.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.