Back to skill

Security audit

Db Explorer

Security checks for vulnerabilities and agentic risk

Overview

This database skill is transparent about its purpose, but it includes real export, restore, migration, credential, and Redis enumeration examples that deserve review before use on production data.

Install only if you are comfortable giving an agent database access. Use read-only, least-privilege credentials by default; avoid production databases unless explicitly intended; do not paste passwords into command-line examples; review every export, backup, restore, import, or migration command before it runs; and clean up local files that may contain sensitive data.

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
SKILL.md:52
Finding

Database Credentials Exposed Through Command-Line Arguments

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 52–66
Vulnerability Type: Plaintext credential exposure through process arguments and shell history
Risk Level: Medium

Vulnerable Code

bash
# PostgreSQL
psql "postgresql://user:password@host:5432/dbname" -c "\dt"

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

# Redis
redis-cli -h host -p 6379 -a password INFO keyspace

Technical Analysis

The documented commands place database passwords directly in command-line arguments. When an agent substitutes real credentials into these examples, the secrets may be exposed through:

  • Shell history files
  • Process listings and process-monitoring utilities
  • Terminal transcripts
  • Agent tool-call logs
  • Operating-system audit records
  • CI/CD or orchestration logs

This conflicts with the safety rule in the same file that states passwords must not be placed in history. Moving an entire connection string into a normal environment variable does not necessarily eliminate exposure if the shell expands that variable into the child process's argument vector.

Attack Path

  1. A user supplies valid PostgreSQL, MongoDB, or Redis credentials to the agent.
  2. The agent follows the documented examples and inserts the credentials into a connection URI or password argument.
  3. The shell or execution environment records the resulting command, or exposes it through process metadata.
  4. A local user, monitoring service, log reader, or compromised process retrieves the plaintext credential.
  5. The attacker connects to the affected database using the exposed account.
  6. The attacker exercises all privileges assigned to that database account.

Impact Assessment

Successful exploitation grants access equivalent to the exposed database identity. Depending on the account's privileges, the attacker may be able to inspect schemas, read sensitive re ...[truncated 382 chars]

Remediation
View remediation

Remediation Suggestions

  • Remove all examples that place passwords directly in connection URIs or command-line password arguments.
  • Use database-client credential facilities protected by filesystem permissions:
    • PostgreSQL: use PGPASSFILE or a .pgpass file with mode 0600.
    • MySQL: use mysql_config_editor and an encrypted login path.
    • MongoDB: use an interactive password prompt or a protected client configuration file.
    • Redis: use a protected configuration file, ACL-based credentials, or standard-input support where available.
  • If temporary credential files are required, create them with restrictive permissions, avoid predictable names, and securely remove them after use.
  • Disable shell history for commands involving secrets and ensure agent execution logs redact connection strings, password flags, and credential-related environment variables.
  • Use short-lived, narrowly scoped database credentials and rotate any credential that may already have appeared in execution logs.
  • Update the safety instructions to clarify that ordinary environment-variable expansion into command arguments does not protect secrets from process inspection.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:67
Finding

Blocking Redis Keyspace Enumeration Can Disrupt Production Services

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 67
Vulnerability Type: Unbounded synchronous Redis keyspace enumeration
Risk Level: Medium

Vulnerable Code

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

Technical Analysis

Redis processes most commands on its main execution thread. The KEYS "*" command synchronously scans the complete selected keyspace and has time complexity proportional to the number of keys. On a large or heavily used production instance, this operation can monopolize the server long enough to increase latency, trigger client timeouts, and interrupt normal application traffic.

The command is unbounded and contradicts the Skill's broader requirement to limit query results. Limiting terminal output after executing KEYS would not mitigate the server-side scan because Redis has already traversed the keyspace.

Attack Path

  1. The agent connects to a Redis instance while performing the documented exploration workflow.
  2. The selected Redis database contains a large number of keys.
  3. The agent executes KEYS "*" as instructed.
  4. Redis synchronously traverses the complete keyspace on its main thread.
  5. Other commands are delayed while enumeration is in progress.
  6. Applications using the instance experience elevated latency, request failures, or temporary service unavailability.

An attacker or unauthorized user who can induce the agent to explore a known large Redis database could intentionally use this behavior to cause operational disruption.

Impact Assessment

This issue can degrade availability for every application sharing the affected Redis instance or selected deployment. Potential consequences include request timeouts, failed sessions, delayed queue processing, cache failures, and cascading application outages.

Exploitation does not provide additional privileges or directly disclose values stored under the enumerated keys. It does reveal ...[truncated 134 chars]

Remediation
View remediation

Remediation Suggestions

  • Replace KEYS "*" with cursor-based incremental scanning, such as:

    bash
    redis-cli --scan --count 100
    
  • Enforce a maximum number of displayed or processed keys and stop scanning when that limit is reached.

  • Use narrow MATCH patterns whenever the desired key prefix or namespace is known.

  • Require explicit user confirmation before broad enumeration of a production keyspace.

  • Identify the environment and approximate database size before scanning.

  • Use a replica for extensive diagnostics when possible to reduce impact on production traffic.

  • Add a safety rule explicitly prohibiting KEYS on production or unknown-size Redis instances.

  • Apply command restrictions through Redis ACLs when exploration accounts do not require access to blocking keyspace commands.

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

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Broad triggers like 'check the database' or 'show me the data' can activate a powerful database skill in routine conversations without sufficient user intent verification. In the context of a skill that can connect to real databases and includes write-oriented examples, accidental activation can expose sensitive data or lead to unintended operations.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill states it is read-only by default, but later provides direct restore and data-loading commands that perform writes without repeating the confirmation, rollback, or transaction safeguards. This inconsistency is dangerous because downstream agents may rely on the early safety rules while still selecting later write examples that can alter or overwrite production data.

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 export and operational commands that write to /tmp and later sections include backup/restore flows, but the warnings are not prominent at the point of use about data sensitivity, local filesystem persistence, or overwrite risk. This matters because exported database contents may contain secrets or personal data, and restore/import commands can change system state beyond simple inspection.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill is marketed as an exploration/query tool, but it also includes restore, backup, and migration capabilities that can modify databases and local files. This scope expansion increases the chance an agent will perform destructive or high-impact actions under a benign-sounding invocation, especially because restore/import examples are operationally ready to run.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.