Back to skill

Security audit

DBCheck 数据库巡检

Security checks for vulnerabilities and agentic risk

Overview

DBCheck is a real database inspection skill, but it handles database and SSH credentials and can expose sensitive infrastructure details in ways that are broader and less clearly disclosed than users are told.

Install only if you are comfortable granting this skill access to database credentials and possibly SSH credentials. Use least-privileged read-only database accounts, avoid passing passwords on the command line, do not use SSH password auth with unknown hosts, keep generated reports/history private, and leave online AI disabled unless you have reviewed the destination and payload.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (5)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/run_inspection.py:801
Finding

Database and SSH credentials are exposed through command-line arguments

Content
View full analysis
\ --port 3306 \ --user \ --password \ --label "" \ --inspector "" ``` The dispatcher also accepts database and SSH credentials as ordinary command-line arguments: ```python parser.add_argument('--user', help='Database username') parser.add_argument('--password', help='Database password') parser.add_argument('--ssh-user', default=None, help='SSH username (optional)') parser.add_argument('--ssh-password', default=None, help='SSH password (optional)') parser.add_argument('--ssh-key', default=None, help='SSH private-key path (optional, alternative to password)') ``` The parsed values are then retained in process memory: ```python db_info = { 'label': args.label, 'host': args.host, 'port': args.port, 'user': args.user, 'password': args.password, } if args.ssh_host: ssh_info = { 'ssh_host': args.ssh_host, 'ssh_port': args.ssh_port, 'ssh_user': args.ssh_user, 'ssh_password': args.ssh_password or '', 'ssh_key_file': args.ssh_key or '', } ``` ### Technical Analysis On common operating systems, process arguments are not a secure secret-delivery mechanism. Depending on the platform and host configuration, they may be exposed through: - Process-listing utilities such as `ps`; - `/proc//cmdline` on Linux; - Shell history; - Process accounting or endpoint monitoring; - Agent execution transcripts and orchestration logs; - Error reports that capture the invoked command. The same problem ...[truncated 1421 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/main_mysql.py:270
Finding

SSH connections automatically trust unknown host keys

Content
View full analysis
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/main_oracle_full.py:401
Finding

Oracle inspection collects excessive host, account, network, and scheduled-task metadata

Content
View full analysis
/dev/null | grep -v '^$'" ).strip() # sysctl parameters data['sysctl'] = self.run_cmd( "grep -E 'kernel.shmall|kernel.shmmax|kernel.sem|kernel.shmmni|" "fs.aio-max-nr|fs.file-max|vm.swappiness|vm.nr_hugepages' " "/etc/sysctl.conf 2>/dev/null" ).strip() # limits.conf data['limits'] = self.run_cmd( "grep -v '^#\\|^$' /etc/security/limits.conf 2>/dev/null" ).strip() # crontab data['crontab'] = self.run_cmd("crontab -l 2>/dev/null").strip() # network data['network'] = self.run_cmd( "ip addr show 2>/dev/null | grep 'inet '" ).strip() # /etc/passwd data['oracle_users'] = self.run_cmd( "grep -E '^(oracle|grid|root):' /etc/passwd 2>/dev/null" ).strip() ``` ### Technical Analysis CPU, memory, disk utilization, and selected Oracle kernel parameters are reasonably related to database health inspection. However, collecting all of the following by default exceeds the minimum information needed for that function: - Non-default `/etc/hosts` mappin ...[truncated 2138 chars]
Remediation
View remediation

other

Warning
Location
scripts/analyzer.py:1323
Finding

Optional online AI analysis can transmit database and host information to unrestricted external endpoints

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
requirements.txt:5
Finding

Dependencies are installed with broad lower-bound constraints and without integrity pinning

Content
View full analysis
=0.8.10 docxtpl>=0.16.0 psutil>=5.9.0 PyYAML>=6.0.0 cryptography>=41.0.0 flask>=2.0.0 flask-socketio>=5.0.0 pymysql>=1.0.0 psycopg2-binary>=2.9.0 oracledb>=1.4.0 dmpython>=1.0.0 pyodbc>=4.0.0 paramiko>=2.10.0 openpyxl>=3.0.0 pandas>=1.3.0 reportlab>=4.0.0 apscheduler>=3.10.0 PyPDF2>=3.0.1 ``` The Skill also recommends an unconstrained direct installation: ```bash pip install pymysql psycopg2-binary paramiko openpyxl docxtpl \ python-docx pandas psutil flask oracledb dmpython pyodbc \ flask-socketio jaydebeapi ``` ### Technical Analysis Nearly all dependencies use lower-bound constraints (`>=`) rather than exact versions. The resulting environment depends on whichever package versions are newest when installation occurs. There are also no package hashes, signed lockfile, or documented package-index restrictions. This creates several risks: - A future compromised release may be selected automatically; - Breaking changes may alter security behavior; - Dependency resolution can vary between installations; - A malicious or misconfigured package index may supply an unexpected artifact; - Optional drivers and web components are installed even when they are unnecessary for the selected inspection mode. No known malicious package or typosquatted dependency was confirmed in the reviewed list. The issue is the absence of reproducible and integrity-verified dependency resolution, not proof that the current packages are malicious. The local YashanDB wheel reference is explicit: ```text yasdb@ file:./drivers/yashandb/yasdb-1.2.0-py3-none-any.whl ``` However, its integrity is not pinned by a cryptographic hash. ### Attack Path 1. A user follows the Skill instructions and executes the broad `pip instal ...[truncated 994 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
Findings (143)

Tainted flow: 'cmd' from input (line 248, user input) → subprocess.run (code execution)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

External input (network, user) flows to a code execution sink. This enables remote code execution or command injection.

Content

Scanner excerpt · scripts/main.py (reported line 196)May include surrounding context.

python
cmd = [sys.executable, script, '--check-config',
               '--host', host, '--port', port or ('3306' if db_type == 'mysql' else '5432'),
               '--user', user, '--password', password, '--label', label]
        subprocess.run(cmd)
    except Exception as e:
        print(f"\n{t('cli.config_baseline_error')}: {e}")

Tainted flow: 'cmd' from input (line 248, user input) → subprocess.run (code execution)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

External input (network, user) flows to a code execution sink. This enables remote code execution or command injection.

Content

Scanner excerpt · scripts/main.py (reported line 251)May include surrounding context.

python
cmd = [sys.executable, script, '--check-config',
               '--host', host, '--port', port or ('3306' if db_type == 'mysql' else '5432'),
               '--user', user, '--password', password, '--label', label]
        subprocess.run(cmd)
    except Exception as e:
        print(f"\n{t('cli.config_baseline_error')}: {e}")

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Undisclosed SSH connectivity, remote command execution, host information collection, bulk credential handling, and possible AI/external service integration materially expand the attack surface beyond simple database health checks. In context, this is especially risky because users are instructed to provide privileged database and possibly SSH credentials, so hidden or under-disclosed behaviors can expose highly sensitive infrastructure data.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Undisclosed SSH connectivity, remote command execution, host information collection, bulk credential handling, and possible AI/external service integration materially expand the attack surface beyond simple database health checks. In context, this is especially risky because users are instructed to provide privileged database and possibly SSH credentials, so hidden or under-disclosed behaviors can expose highly sensitive infrastructure data.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Undisclosed SSH connectivity, remote command execution, host information collection, bulk credential handling, and possible AI/external service integration materially expand the attack surface beyond simple database health checks. In context, this is especially risky because users are instructed to provide privileged database and possibly SSH credentials, so hidden or under-disclosed behaviors can expose highly sensitive infrastructure data.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

Undisclosed SSH connectivity, remote command execution, host information collection, bulk credential handling, and possible AI/external service integration materially expand the attack surface beyond simple database health checks. In context, this is especially risky because users are instructed to provide privileged database and possibly SSH credentials, so hidden or under-disclosed behaviors can expose highly sensitive infrastructure data.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The module-level security note states that AI diagnostics only support local Ollama and do not send data to third parties, but the implementation later supports remote OpenAI-compatible endpoints when online mode is enabled. This is dangerous because operators may rely on the documented safety guarantees and unknowingly allow sensitive database inspection data to be transmitted off-host.

Content

No source excerpt is available for this finding.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/analyzer.py (reported line 1561)May include surrounding context.

python
## Overall Assessment

[One-sentence overall assessment]"""
        return prompt

    def diagnose(self, db_type: str, label: str, context: dict, issues: list,
                 timeout: int = 30, lang: str = 'zh') -> str:

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The run_full_analysis docstring claims AI configuration only supports local Ollama and that all data stays local, yet the code can instantiate an openai backend and send prompts to remote endpoints. This misleading contract can cause unintentional data disclosure during a database health check, especially because the function is a high-level entry point likely used by other components without deeper review.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/i18n/en.py (reported line 435)May include surrounding context.

python
"webui.placeholder_username": "Enter username",
    "webui.placeholder_service": "ORCL or orcl.example.com (leave empty to use host address)",
    "webui.placeholder_ssh_host": "Same as database host",
    "webui.placeholder_ssh_key": "/root/.ssh/id_rsa",
    "webui.placeholder_ssh_password": "SSH password",
    "webui.report_done_title": "Report Generated",
    "webui.reports_load_fail_detail": "Failed to load",

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/i18n/zh.py (reported line 459)May include surrounding context.

python
"webui.placeholder_username": "Enter username",
    "webui.placeholder_service": "ORCL or orcl.example.com (leave empty to use host address)",
    "webui.placeholder_ssh_host": "Same as database host",
    "webui.placeholder_ssh_key": "/root/.ssh/id_rsa",
    "webui.placeholder_ssh_password": "SSH password",
    "webui.report_done_title": "Report Generated",
    "webui.reports_load_fail_detail": "Failed to load",

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

This code sends the collected inspection context and auto-analysis results to an external AI backend without a clear, specific disclosure in the execution flow. Because the context may contain database inventory, user/security details, host information, and operational findings, silent exfiltration to a third party is a serious confidentiality issue.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The slow-query analysis integrates an AI advisor and can transmit query-analysis context without a clear warning, which is especially dangerous because SQL text often contains sensitive identifiers and sometimes embedded literals. In enterprise database tooling, this kind of undisclosed outbound sharing can create compliance, privacy, and data-leakage exposure.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The code loads AI backend configuration and sends the collected inspection context to an external AI advisor. That context can contain database metadata, process lists, usernames, hostnames, platform details, and operational state, so this creates a significant data exfiltration/privacy risk that is not necessary for core local health inspection.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

At the AI diagnostic call site, the code may transmit the full inspection context to an external API without a prominent runtime warning or confirmation. In a DBA/ops tool, users may reasonably expect local-only analysis, so silent network egress of operational data materially increases confidentiality and compliance risk.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The slow-query analysis path also reuses the AI advisor, potentially transmitting deeper operational and SQL-related diagnostic context to an external service. Slow-query data can reveal schema details, business logic, table names, and sensitive query patterns, increasing confidentiality risk beyond what users may expect from a health-check report tool.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
92% confidence
Finding

Using a general shell execution helper with shell=True creates a powerful primitive that can be abused if any future or indirect caller passes user-controlled input. In a tool that accepts connection parameters and may evolve, this pattern is risky because a small change elsewhere can become full command execution on the host.

Content

Scanner excerpt · scripts/main_oracle_full.py (reported line 412)May include surrounding context.

python
else:
            import subprocess
            try:
                return subprocess.check_output(cmd, shell=True, stderr=subprocess.DEVNULL, timeout=30).decode('utf-8', errors='ignore')
            except Exception:
                return ""

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/main_oracle_full.py (reported line 481)May include surrounding context.

python
# 网络
        data['network'] = self.run_cmd("ip addr show 2>/dev/null | grep 'inet '").strip()

        # /etc/passwd(数据库用户检查用)
        data['oracle_users'] = self.run_cmd(
            "grep -E '^(oracle|grid|root):' /etc/passwd 2>/dev/null"
        ).strip()

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/main_oracle_full.py (reported line 483)May include surrounding context.

python
# 网络
        data['network'] = self.run_cmd("ip addr show 2>/dev/null | grep 'inet '").strip()

        # /etc/passwd(数据库用户检查用)
        data['oracle_users'] = self.run_cmd(
            "grep -E '^(oracle|grid|root):' /etc/passwd 2>/dev/null"
        ).strip()

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The code establishes SSH connections to remote hosts and executes shell commands such as top, free, df, uname, and hostname, which is materially broader than simple database inspection. In a skill context, undisclosed remote command execution significantly increases trust requirements and can expose infrastructure details or enable misuse if pointed at unintended systems.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The AI diagnostic step loads external backend configuration and passes the collected inspection data and issues to an AI advisor for diagnosis. Because the inspection data includes database and possibly host-level details, this creates a data exfiltration risk when the manifest does not clearly disclose outbound transmission to a third-party service.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The AI diagnosis call may send collected database and host inspection data to an external service without prominent disclosure or consent at the point of use. In a DBA-oriented inspection tool, such data can contain sensitive infrastructure metadata, query text, backup paths, and operational details that should not leave the environment by default.

Content

No source excerpt is available for this finding.

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · security.md (reported line 56)May include surrounding context.

md
| ClawHavoc Attack Pattern | DBCheck Reality |
|---------------------------|-----------------|
| `curl ... | bash` (remote code download) | None — all code is bundled locally |
| Reads `~/.ssh/`, `~/.aws/credentials` | No — only connects to user-specified DB |
| Sends data to remote C2 server | No — no network exfiltration whatsoever |
| Modifies startup items / crontab | No — read-only health inspection |

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · security.md (reported line 57)May include surrounding context.

md
| ClawHavoc Attack Pattern | DBCheck Reality |
|---------------------------|-----------------|
| `curl ... | bash` (remote code download) | None — all code is bundled locally |
| Reads `~/.ssh/`, `~/.aws/credentials` | No — only connects to user-specified DB |
| Sends data to remote C2 server | No — no network exfiltration whatsoever |
| Modifies startup items / crontab | No — read-only health inspection |
| Uses `eval`/`exec` on obfuscated strings | No — Base64 used only for local password encryption in config |

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README repeatedly highlights that each finding includes '修复 SQL(可直接复制执行)' and '每条风险附可执行的修复 SQL', but it does not prominently warn that these statements may modify database state and should be reviewed, tested, and approved before use. In a database-administration context, operators may over-trust generated SQL and apply it directly to production, leading to configuration drift, outages, privilege changes, or data integrity issues if a recommendation is unsafe or mismatched to the environment.

Content

No source excerpt is available for this finding.