T09 · Insecure Skill Coding Practices
- Location
scripts/connect_datasource.py:146- Finding
Automatic schema exploration and query output disclose unmasked sensitive records
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is mostly a local business-data reporting skill, but it can expose raw business records and database credentials in ways users should review before installing.
Install only for trusted local use with least-privileged, read-only datasource accounts. Avoid putting passwords in command lines or connection URIs, assume explore/query outputs may contain raw sensitive records, and review reports generated from untrusted data before sharing them.
scripts/connect_datasource.py:146Automatic schema exploration and query output disclose unmasked sensitive records
scripts/anomaly_detector.py:336Caller-controlled subscription tier bypasses paid-feature authorization
scripts/report_generator.py:32Untrusted datasource values can inject Markdown and Mermaid report content
scripts/connect_datasource.py:282Database credentials can be exposed through process arguments and command history
声明描述的是一个更完整的数据洞察产品能力:接入数据源、生成分析报告和看板。而提供的代码仅实现了对输入 JSON 数据的异常值检测,支持标准差和 IQR 两种方法,输出结构化检测结果。它没有展示任何外部业务数据源连接、报表生成、可视化看板构建或触发式集成逻辑。虽然异常检测可以算作数据分析的一个子功能,但与声明中的主要用途相比过于狭窄且功能重心不同,因此属于明显的描述与行为不匹配。
声明描述强调的是更高层的商业数据分析产出能力(报告、看板)。但给定代码块只负责连接数据库/文件数据源、测试可读性、枚举表结构、统计行数、抽取少量样本数据,并做简单字段角色识别。这与“连接业务数据源”部分一致,但与“自动生成数据分析报告和看板”存在明显能力落差。代码也没有表现出额外危险或越权资源访问;问题主要是声明范围大于实际实现,且主要功能更接近‘数据源连接与Schema探查工具’而非完整BI报告/看板生成器。
声明描述强调的是更高层的“商业数据洞察”能力,即连接业务数据源后自动生成分析报告和看板。但代码本身仅提供数据查询与简单聚合统计功能:支持数据库和文件数据源,构造或接收 SQL,做只读校验,执行查询,并输出 columns/rows/row_count/stats。虽然这些功能可作为数据分析系统的底层支撑,但并没有任何报告生成、可视化、看板布局、图表输出、自然语言总结或自动洞察逻辑。因此其实际主功能与声明存在明显落差。另一方面,连接数据源这一点与声明部分一致,因此不是完全无关,而是“声明过于高层且夸大了已实现能力”的不匹配。
The skill instructs the agent to read environment variables, access local files/paths (CSV/Excel/JSON, reference docs), and connect to external data sources, but it declares no explicit tool scope or permission boundaries. This increases the risk of over-broad access and makes it harder for the runtime or reviewer to constrain what resources the skill may touch.
文件中的自然语言说明明确写明“你始终使用中文与用户沟通”,这会强制施加单一语言/locale 约束。根据规则,若未提供用户选择或 opt-in,这属于语言/locale 政策违规。
该行为准则重复要求始终使用中文,进一步确认这是全局强制性的语言限制,而不是默认偏好。规则要求语言限制需提供用户选择,或在文档中明确说明并合理限定适用场景。
The entire skill description, examples, and invocation guidance are written exclusively in Chinese, and the interactive example query is also Chinese-only. There is no indication that users may use another language or that the skill is intentionally limited to a Chinese-speaking or region-specific context, which creates a language/locale policy concern.
The title and entire guidance are presented as Chinese-only reference material for the skill, and the document explicitly emphasizes Chinese label support later in the file without offering any language choice. For a skill artifact, this can indicate a language/locale constraint that is not framed as optional or region-specific, which matches the language-policy violation criterion.
This markdown file presents all user-facing documentation and report templates exclusively in Chinese, and nowhere indicates that the skill is China-specific or that users may choose another language. That creates a natural-language locale policy concern because the skill appears to force a specific language without user opt-in.
This code file contains user-facing natural-language descriptions entirely in Chinese, including the module description and usage guidance, with no indication that the user can choose another language or that the tool is intentionally limited to a Chinese-speaking or region-specific context. That creates a locale-policy concern under the rule for natural-language policy violations.
The database schema exploration routine returns up to 5 raw rows from every table, which exceeds the stated purpose of connection testing and schema discovery. In a business-data analysis skill, those rows can easily contain PII, credentials, financial records, or other sensitive production data, causing unintended data exposure to whoever invokes or receives the output.
The script exposes sample database rows without any explicit warning that real table contents will be displayed. This increases the likelihood of accidental disclosure because users may reasonably expect schema exploration to reveal structure, not actual data values.
The file exploration path emits raw sample records from local CSV/Excel/JSON files rather than only schema details. Because this skill is designed to inspect business datasets, the sampled rows are likely to contain sensitive business or personal information, creating an unnecessary disclosure channel.
The file exploration workflow displays sample file contents without explicitly informing the user that records will be printed. For local business files, this can leak confidential data into logs, terminals, or downstream systems consuming the JSON output.
The module docstring, usage text, and CLI help/descriptions are written in Chinese, which imposes a specific language on users without any opt-in or alternative locale. The policy explicitly flags language or locale constraints when the skill does not offer a language choice or document a justified region-specific limitation.
This Python file contains user-facing natural-language strings and usage documentation only in Chinese, including the module description and CLI help context. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy violation when no language choice or locale justification is provided.
The module docstring and user-facing documentation strings are written entirely in Chinese, which imposes a language choice without offering users an alternative or opt-in. Under the stated policy, forcing a specific language without documented choice or justification is a natural-language policy violation.
The utility explicitly accepts a database password via a command-line argument. On many systems, command-line arguments are exposed through process listings, shell history, audit logs, or orchestration metadata, which can leak credentials to other local users or monitoring tools. In a business data connector context, those credentials may grant direct access to sensitive databases, making the issue more consequential than in a non-sensitive utility.
The top-level description and usage text are presented only in Chinese, and the CLI help/messages throughout the script also use Chinese without an opt-in or alternative locale. This creates a language policy concern because the skill effectively mandates one language for all users.
No suspicious patterns detected.