T09 · Insecure Skill Coding Practices
- Location
scripts/report_generator.py:76- Finding
CSV Formula Injection Through Untrusted Report Fields
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill appears to do the stated document-analysis job, with manageable risks around dependency installation and spreadsheet-safe CSV output.
Install the dependencies in an isolated virtual environment, prefer pinned or locked package versions, and process documents from sources you trust. Treat generated CSV reports as containing untrusted document text before opening them in spreadsheet software; JSON and text outputs are safer for exact review. The skill does not appear to modify system security settings.
scripts/report_generator.py:76CSV Formula Injection Through Untrusted Report Fields
requirements.txt:1Unpinned and Unhashed Third-Party Dependencies
声明描述的是一个“覆盖分析”技能,核心能力应包括:读取 CIS PDF、读取 OpenEuler MD、进行规则映射比较、判定覆盖程度并输出分类结果。实际代码只是一个独立的 PDF 解析脚本,用于从 CIS 文档中抽取规则并生成结构化 JSON,属于后续分析的前置步骤。虽然这可能是整体方案中的支持性组件,但就当前提供的代码块而言,其主要行为与声明的主要用途存在实质差异,因此应判定为不匹配。
声明描述的是一个完整的“CIS覆盖分析”技能,核心能力应是同时读取 CIS Benchmark 和 OpenEuler 基线,并进行规则级覆盖分析后给出覆盖分类结果。但提供的代码只是一个单独的解析脚本:它读取 Markdown 文件、识别标题/表格/配置路径、抽取配置项并写出 JSON。该行为更像是后续覆盖分析流程中的前置数据准备步骤,而非所声明的主要功能本身。虽然这种解析可能是支持性实现细节,但当前代码块缺失声明中最关键的能力,因此描述与实际代码行为存在明显不匹配。
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
rules = [v for v in seen_rules.values()
if v["rule_id"] or v["config_path"]]
return rules
def main():
Without declared permissions the skill's intent is opaque and cannot be validated.
L003 列出的触发词中“安全基线比对”“规则覆盖检查”等表述较通用,且描述使用“当用户提到…时,务必使用此技能”的强制触发方式,但未提供排除条件或负例。这会让技能在非 OpenEuler 对比 CIS RHEL 的一般性基线比对场景中也被调用。
The module docstring, usage instructions, CLI descriptions, and runtime messages are all presented in Chinese. This imposes a specific language on users without any visible opt-in or justification that the skill is intended only for a Chinese-speaking environment.
The dependency is specified with a lower-bound only, which allows future installs to resolve to different versions over time. This weakens supply-chain reproducibility and can unintentionally introduce vulnerable or incompatible releases if an upstream package is compromised or later ships a security regression.
pdfplumber>=0.10.0
pandas>=2.0.0
openpyxl>=3.1.0
thefuzz>=0.20.0
Using an unpinned pandas dependency means installations are not reproducible and may pull in a vulnerable or unexpected release. In a skill that processes user-supplied files, dependency drift increases supply-chain risk because parsing libraries and data-processing stacks are attractive attack surfaces.
pdfplumber>=0.10.0
pandas>=2.0.0
openpyxl>=3.1.0
thefuzz>=0.20.0
python-Levenshtein>=0.25.0
Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.
An unpinned openpyxl version allows arbitrary newer releases to be installed, reducing build determinism and making it harder to verify exposure to known issues. This is more relevant here because the skill handles document/spreadsheet-related processing, where parser libraries have historically had security flaws.
pdfplumber>=0.10.0
pandas>=2.0.0
openpyxl>=3.1.0
thefuzz>=0.20.0
python-Levenshtein>=0.25.0
Dependency has known vulnerabilities (CVEs). Using packages with unpatched security flaws exposes the environment to known exploits.
Thefuzz is also unpinned, so deployments may resolve to different releases over time. While the direct exploitability may be lower than file-parsing libraries, this still represents a supply-chain hygiene issue that can affect integrity and reliability.
pdfplumber>=0.10.0
pandas>=2.0.0
openpyxl>=3.1.0
thefuzz>=0.20.0
python-Levenshtein>=0.25.0
python-Levenshtein is not pinned, which permits dependency drift and undermines reproducible builds. Even utility libraries can become a supply-chain entry point if malicious or vulnerable releases are pulled during installation.
pandas>=2.0.0
openpyxl>=3.1.0
thefuzz>=0.20.0
python-Levenshtein>=0.25.0
The module docstring and command usage are written only in Chinese, and the script later emits Chinese-only CLI messages. For a general-purpose analysis tool, this imposes a specific language/locale on users without opt-in or justification, which matches the language-policy concern described by SQP-3.
This code file contains user-facing natural-language strings and usage text primarily in Chinese, including the script description, help text, errors, and status output. The skill does generate English report files, but the interactive CLI messaging itself does not offer users a language or locale choice, which can violate a language/locale policy requiring opt-in rather than forced language.