T09 · Insecure Skill Coding Practices
- Location
scripts/kingdee_query.py:12- Finding
Hardcoded Database Credentials Expose Direct ERP Database Access
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill openly provides direct credentials and tooling for a specific ERP database, creating serious unauthorized-access risk even though it does not show hidden or destructive behavior.
Do not install this skill unless you are authorized to access this exact Kingdee ERP database and the exposed credential has been rotated or replaced with a managed secret. Treat the listed host, username, password, and ERP tables as confidential, verify the database role is strictly read-only and allowlisted, and avoid running arbitrary SQL or schema-enumeration queries outside an approved audit or reporting workflow.
scripts/kingdee_query.py:12Hardcoded Database Credentials Expose Direct ERP Database Access
scripts/kingdee_query.py:46Generic Query Method Does Not Enforce Read-Only SQL Execution
The skill is described as a business SQL query helper, but it embeds direct access to a specific external PostgreSQL instance, exposes credentials, and documents metadata enumeration queries against information_schema. This materially expands capability from scoped ERP reporting to broad database reconnaissance and arbitrary data access, increasing the chance of unauthorized discovery and extraction of sensitive operational and financial data.
The file contains hardcoded plaintext host, username, password, and database name for what appears to be a live ERP database. Anyone with access to the skill can use these credentials to connect directly, potentially exposing procurement, sales, inventory, and financial records, and the exposure persists until credentials are rotated.
Publishing live database connection details without any safeguards or handling guidance enables direct access to sensitive ERP data by unintended users. Even if the account is read-only, exposed credentials facilitate unauthorized querying, bulk extraction, and schema reconnaissance that can support further compromise or data leakage.
The file hardcodes live PostgreSQL connection details, including a plaintext password and remote host, which is a direct secret exposure. Anyone with access to the skill can reuse these credentials to connect to the ERP database, potentially exfiltrating financial, sales, procurement, and inventory data or performing additional unauthorized actions depending on DB privileges.
The skill advertises querying ERP procurement, sales, inventory, and finance data but does not warn users that these datasets are likely confidential and business-sensitive. In this context, lack of clear handling guidance increases the risk of casual over-collection, improper sharing, or use by unauthorized operators.
The connect routine establishes a network connection to a remote database host without any explicit user warning or consent flow. In a skill context, this can cause sensitive enterprise data to be accessed or transmitted to an external system unexpectedly, increasing privacy, compliance, and trust risks.
The script includes generic schema-enumeration helpers via information_schema, allowing a user to discover table names and column layouts beyond the stated business-document query scope. In an ERP environment, schema discovery materially lowers the barrier to broader data access and follow-on abuse, especially when paired with embedded working credentials.
The skill name, description, headings, and instructions are entirely in Chinese, with no indication that users may choose another language or that the skill is intentionally limited to a Chinese-speaking audience. This can constitute a locale policy issue when a fixed language is imposed without opt-in or explicit justification.
This markdown file is entirely written in Chinese and provides no indication that the user can choose another language or locale. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy concern.
The docstring describes the tool as executing common queries, but the implementation also supports schema inspection. This mismatch can mislead reviewers or users about the breadth of database access, reducing informed consent and making risky capabilities less visible.
The file’s natural-language comments are entirely in Chinese, beginning with the title and usage note, with no indication that another language is supported or that the language choice is optional. Under the stated policy, forcing a specific language or locale without user opt-in is a natural-language policy concern.
These templates include schema-enumeration queries against information_schema that go beyond the declared business-document query purpose. In an agent skill, exposing discovery queries can help a user map the database structure and identify additional tables for follow-on access, weakening least-privilege boundaries and expanding data exposure beyond intended ERP document analysis.
Querying t_bos_atomicincr_generator exposes system numbering-rule configuration, which is outside the stated scope of business document lookup and analysis. While not directly destructive, it reveals internal document generation patterns and configuration details that can aid reconnaissance or misuse of business workflows.