T09 · Insecure Skill Coding Practices
- Location
scripts/report-generate.js:463- Finding
Shell Command Injection in PDF Report Generation
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This data-analysis skill is not clearly malicious, but it overstates its capabilities and includes under-scoped network, file-writing, and shell-execution behavior that users should review before installing.
Install only if you are comfortable reviewing and constraining how it runs. Use dedicated input/output folders, avoid passing secrets in command-line arguments or checked-in config files, do not run it against untrusted URLs or datasets, and avoid PDF generation until shell execution and filename validation are fixed. Treat the advertised database, scheduler, AI insight, and one-click install features as incomplete unless the publisher provides matching implementation and documentation.
scripts/report-generate.js:463Shell Command Injection in PDF Report Generation
scripts/data-fetch.js:58Server-Side Request Forgery Through Unrestricted URL Fetching
scripts/report-generate.js:439Path Traversal and Arbitrary File Writes Through User-Controlled Output Paths
scripts/data-viz.js:427Stored HTML Injection Through an Unescaped Visualization Title
scripts/report-generate.js:343Stored HTML Injection Through Dataset-Controlled Report Fields
描述将技能定位为覆盖抓取、清洗、可视化、报告生成的一体化数据分析包,但提供的代码只实现了数据清洗相关流程,并且输入来源仅限本地文件系统中的 CSV/JSON。它没有任何网络抓取、图表渲染、报表生成或更广义的数据分析逻辑,因此描述明显夸大了能力范围。尽管代码确实包含“清洗”和基础“报告”摘要,但整体 declared purpose 与实际行为存在实质性不一致,应判定为 mismatch。
该描述与代码存在明显不一致。代码的主要用途是数据获取/抓取,而不是完整的数据分析流水线。虽然描述中的“抓取”部分与代码相符,但“清洗、可视化、生成报告”这些核心能力均未实现。代码仅支持命令行参数解析、HTTP请求、简易HTML表格/列表提取、API JSON获取,以及导出到JSON/CSV。数据库支持也只是示例占位,不可实际使用。因此,声明显著夸大了实际功能范围,属于描述与行为不匹配。
该代码块的核心功能是本地文件读取与图表渲染,支持通过命令行参数选择图表类型、字段、尺寸和输出格式,并将结果保存为 SVG/HTML。它并未体现任何网络抓取、数据采集、自动化清洗、分析管道或报告生成逻辑。虽然“可视化”这一点与声明部分一致,但声明描述的是一个更完整的数据分析技能包,而实际代码只实现了其中一小部分,属于描述与实际行为的明显不一致。未发现额外的高风险越权行为,但主要用途与能力范围被明显夸大。
声明描述的是一个覆盖抓取、清洗、可视化、报告生成的完整数据分析技能包,但当前代码块的实际功能聚焦于“报告生成”。它会读取指定数据文件,解析 JSON,计算统计指标、生成简单洞察和时间序列趋势文本,并输出 HTML/Markdown/PDF 报告。虽然配置中有 includeCharts 字段,实际代码并未生成图表或可视化,也没有任何网络抓取、原始数据采集、数据清洗处理逻辑。因此,代码行为只覆盖声明中的一部分,且缺少多个核心宣称能力,构成描述与实际行为不一致。
The title and the full user-facing documentation are presented in Chinese, and no alternative language option or opt-in is offered. Per the policy, forcing a specific language without user choice can be a natural-language policy violation unless the locale limitation is explicitly justified.
This markdown file describes network retrieval and database access, including a database URI with embedded credentials and later mentions support for cookie authentication, but the safety notes do not explicitly warn that these operations may transmit sensitive user or system data. Under the markdown criteria for missing user warnings, skills that affect privacy or credentials should disclose those risks clearly.
The skill advertises web scraping, API access, database connections, scheduled execution, and report/file generation but does not warn users about outbound network access, data collection, sensitive-source handling, or where outputs may be written. In an agent skill context, missing disclosure can cause users to expose internal data or permit unintended exfiltration and persistence without informed consent.
The configuration example includes an Authorization bearer token directly in JSON without any warning about secret storage, rotation, redaction, or avoiding commits to source control. This encourages insecure credential handling patterns that can lead to accidental leakage of API keys and unauthorized third-party access.
The file’s natural-language strings, title, help text, logs, and usage instructions are presented exclusively in Chinese, starting with the header and continuing throughout the script. For a general-purpose data-cleaning tool, this effectively imposes a specific language/locale on users without any opt-in or documented regional justification, which matches the language/locale policy violation criteria.
The file's user-facing title, comments, usage text, status messages, and examples are presented in Chinese, and there is no indication that users may select another language or locale. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
console.log(' node data-fetch.js --db <连接字符串> --query <SQL>');
console.log('\n示例:');
console.log(' node data-fetch.js --url "https://example.com/data" --selector "table"');
console.log(' node data-fetch.js --api "https://api.example.com/v1/data" --output data.json');
return;
}
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
console.log(' node data-fetch.js --db <连接字符串> --query <SQL>');
console.log('\n示例:');
console.log(' node data-fetch.js --url "https://example.com/data" --selector "table"');
console.log(' node data-fetch.js --api "https://api.example.com/v1/data" --output data.json');
return;
}
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
console.log(' node data-fetch.js --db <连接字符串> --query <SQL>');
console.log('\n示例:');
console.log(' node data-fetch.js --url "https://example.com/data" --selector "table"');
console.log(' node data-fetch.js --api "https://api.example.com/v1/data" --output data.json');
return;
}
The default configuration forces language: 'zh-CN', and the skill does not offer a user-selectable language option or document this as a justified region-specific constraint. This is a natural-language locale policy issue because the skill behavior is biased toward a specific language by default.
The code uses toLocaleString('zh-CN'), which forces Chinese locale formatting in generated output. Because no user opt-in or locale selection mechanism is provided, this violates the language/locale policy criteria.
The HTML output sets <html lang="zh-CN">, indicating the report is always emitted as Chinese-language content. Without explicit user choice or a clearly justified regional limitation, this is a language/locale policy violation.
The manifest describes a data analysis skill for crawling, cleaning, visualization, and report generation, but this file implements shell-level execution via child_process.execSync to invoke wkhtmltopdf. Spawning external binaries is a stronger capability than ordinary report rendering and is not clearly justified by the stated purpose, especially since it introduces host command execution into an analytics workflow.
This manifest hard-codes the AI insights language to "zh-CN", which is a natural-language locale restriction. The file does not offer a user opt-in or alternative locale selection, and no region-specific compliance justification is documented here.
The configuration sets the AI insight language to "zh-CN", which imposes a specific language/locale by default. Under the policy, locale restrictions should either be user-selectable or clearly justified as region-specific; this file provides neither.
The file uses Chinese-only names, section labels, date formatting, and output conventions, with no indication that users may choose another language or locale. This creates a natural-language locale constraint that is not presented as optional or justified as region-specific.
The skill repeatedly shows commands that write outputs such as clean.csv, chart.png, charts/, report.md, and report.html, plus one-click install/run scripts, but it does not warn users about local file modifications or possible overwrites. For markdown skill descriptions, behaviors affecting user data or system state should be disclosed.
The manifest description is written entirely in Chinese and does not indicate that users may choose another language or locale. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation unless the locale restriction is explicitly documented and justified.
The generated HTML hard-codes lang="zh-CN", which imposes a specific locale on all output regardless of user preference or environment. The file does not provide any opt-in, configuration flag, or documented justification for restricting output to this locale.
The description says the template is suitable for weekly reports, project progress, and team reports, but it does not define any specific trigger phrases, scope limits, or exclusion conditions. In a manifest-style file, this kind of broad invocation description can overlap with common report-writing requests and make activation boundaries unclear.
Detected: suspicious.dangerous_exec