T09 · Insecure Skill Coding Practices
- Location
style_report.json:2475- Finding
Packaged Report Exposes Internal Infrastructure Information
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This DrawIO skill is mostly local and purpose-related, but its package includes a report that exposes internal infrastructure details and it can place untrusted diagram text into AI-read reports.
Review before installing. The main risk is not hidden execution, but included source-diagram content: remove or regenerate style_report.json with only style attributes before publishing or sharing, and avoid analyzing untrusted DrawIO files unless labels are escaped or treated strictly as data. Run the scripts only on files you trust or inside a resource-limited workspace.
style_report.json:2475Packaged Report Exposes Internal Infrastructure Information
scripts/ref_analyze.py:112Untrusted DrawIO Labels Are Embedded in Agent-Consumed Markdown
scripts/extract_style.py:32Unbounded DrawIO Decompression Enables Resource-Exhaustion Attacks
代码行为与声明仅部分一致。它确实实现了“从已有 .drawio 文件中提取个人绘制风格特征”的一部分能力:读取本地目录下的 .drawio 文件、解析并解码图内容、统计样式属性、输出 JSON 报告。但声明将技能描述为一个完整的 DrawIO 绘图与导出工具,而当前代码片段没有任何图表生成、应用 preset 生成新图、或导出 PNG/SVG/PDF 的实现。因此,若以整个技能声明对照该代码片段,代码的实际能力明显更窄,不能支撑声明中的主要功能,属于描述与行为不匹配。
The code accurately supports one declared sub-capability: deterministic extraction of drawing style presets from existing .drawio files. It parses and decompresses draw.io XML, extracts palette/roles/shapes/font/edge defaults, and saves a preset JSON. However, the broader declared description presents the skill primarily as a full DrawIO diagram generation and export tool, including generating many diagram types, applying a named visual style, and exporting rendered outputs. None of those behaviors appear in this code chunk. There are no suspicious undeclared external accesses or unrelated triggers, but the implemented functionality is materially narrower than the declared capability set, so this chunk does not accurately represent the full declared description.
This section exposes sensitive infrastructure descriptors including domain names, internal network ranges, server roles, databases, gateways, monitoring systems, security components, and workflow details, none of which are required to extract a visual style preset. Such disclosure materially lowers the cost of reconnaissance for attackers and may reveal security controls, trust boundaries, and high-value targets for phishing, intrusion, or lateral movement.
The skill documentation describes capabilities that imply file reads, file writes, and possible network access, but it does not declare any explicit tool scope or permissions boundaries. In an agent environment, missing scope declarations can cause overbroad tool access, making it easier for the skill to read unrelated local files, overwrite workspace content, or fetch untrusted remote data without clear operator review.
The manifest description and title are written entirely in Chinese, and the document frames the skill around Chinese-specific usage such as added Chinese role vocabulary. This creates a natural-language locale constraint without any explicit user choice, opt-in, or justification that the skill is intended only for a Chinese-language environment.
The module description is written only in Chinese and the script's user-facing output is likewise Chinese, indicating the skill is designed to operate in a fixed language. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified, which is not present here.
This code's natural-language interface is written entirely in Chinese, including the main module description and usage text shown to users. The file does not offer a language choice or explain that the skill is intentionally limited to a Chinese-speaking context, which can violate language/locale policy requirements.
The artifact contains far more than style metadata: it embeds full diagram labels, business process text, internal architecture descriptions, hostnames, internal IP addresses, domains, and environment details. For a style-preset extraction artifact, this is unnecessary data retention and creates a sensitive information disclosure risk because anyone with access to the skill package can reconstruct internal systems and organizational workflows.
This code creates or overwrites style_report.json, which is a file write affecting the local filesystem. Although the script prints the saved path afterward, there is no prior warning, confirmation, or explanatory comment at the write site informing the user that running the skill will persist a report file.
The module docstring states that --style is optional and that the default behavior is to extract style from the reference image itself, but the implementation instead prefers a bundled styles/linlan.json preset when present and only falls back to self-extraction if that preset is missing. This is an intent/documentation mismatch that changes the semantic meaning of the analysis output.
This JSON file contains natural-language labels in both English and Chinese, suggesting the underlying skills or artifacts may assume a specific locale presentation. Because there is no accompanying note in this file that the locale is user-selectable or explicitly constrained to a region-specific use case, it may conflict with language/locale choice expectations.