T09 · Insecure Skill Coding Practices
- Location
lib/builder.js:533- Finding
Unrestricted File Overwrite Through Attacker-Controlled Output Path
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill appears to be a real poster/image generator, but it needs review because caller-controlled settings can overwrite local files and create very large renders that may exhaust resources.
Install only if you trust the configs passed into it or can wrap it with safeguards. Keep output paths inside a dedicated directory, confirm before overwriting files, reject absolute or traversal paths from untrusted input, and add limits on canvas size and record counts before using it in an automated service.
lib/builder.js:533Unrestricted File Overwrite Through Attacker-Controlled Output Path
lib/builder.js:14Unbounded Canvas Dimensions and Dataset Sizes Permit Resource Exhaustion
Referenced artifact was not completely inspected
- `lib/core.js` — 通用绘制工具(圆角矩形、饼图、柱状图、格式化)
Referenced artifact was not completely inspected
- `lib/builder.js` — Section DSL → Canvas 构建器
The README advertises very broad trigger phrases such as 'generate a poster', 'create a dashboard', and 'make an infographic' for automatic skill invocation. In an agent setting, broad activation increases the chance this skill is selected for common requests and then writes files or processes untrusted structured content without the user explicitly intending to invoke this capability.
The documented auto-invocation phrases are broad enough to trigger on ordinary user requests like '生成海报' or '生成图表', which can cause the skill to activate in contexts the user did not specifically intend. In a skill-capable agent environment, overly broad routing increases the chance of unexpected file generation, unintended data processing, or chaining into side-effecting behavior through dependent skills.
The trigger phrases are broad enough to capture many generic requests such as '生成图表' or '数据可视化图', which can cause this skill to activate outside its intended poster-generation scope. In an agent environment, overbroad routing can lead to unintended file creation, unnecessary dependency invocation by other skills, or misuse of server-side rendering capabilities on unrelated tasks.
The file contains multiple hard-coded Chinese-language comments and default UI strings such as section titles and usage labels, indicating the skill's output is opinionated toward a specific language. There is no natural-language indication that the locale is configurable, optional, or intentionally limited to a region-specific use case.
The documented activation phrases are broad and map to very common user intents such as generating charts, dashboards, and posters. In a skill-routing environment, this can cause the skill to be invoked in situations the user did not explicitly intend, expanding the attack surface and potentially causing unintended file generation or downstream processing of sensitive data.
The skill advertises broad auto-invocation phrases such as '生成海报', '做看板', and '生成长图', which overlap with common user requests and may trigger the skill in situations the user did not specifically intend. Because this skill can generate files and be used as a dependency by other skills, overly broad routing increases the chance of unintended execution and side effects.
文件中的自然语言描述全部以中文规定技能用途与触发方式,但没有说明这是面向特定中文区域的技能,也没有提供语言选择或用户 opt-in。若该技能在通用环境中被发现和调用,可能形成默认强制中文的语言策略问题。
L006 使用了“生成海报”“做看板”“长图”“生成图表”等触发描述,其中多项属于常见、宽泛的用户表达,未限定具体场景、输入类型或排除条件。文档也没有给出负例或明确边界,容易让技能在一般性的制图或说明需求中被意外调用。
This JavaScript file contains multiple user-facing strings in Chinese, including titles, labels, and recommendations, but provides no indication that the skill is intentionally region-specific or that users can opt into that locale. Under the policy, forcing a specific language without user choice is a natural-language policy violation.
The file’s natural-language comments describe the tool specifically as a Chinese-focused drawing utility, and the runtime behavior reinforces that by warning only about CJK font support and formatting currency with the yuan symbol and Chinese numeric unit. This imposes a specific language/locale convention without any opt-in or documented user choice, which matches the language/locale policy concern.
This JavaScript file embeds multiple user-facing strings in Chinese for section titles, headers, and the default footer. That creates a natural-language locale constraint without any visible opt-in, fallback, or justification that the skill is intended only for Chinese-speaking users or a China-specific context.
The README states that setting output writes a PNG to the provided path, but it does not warn that this causes filesystem side effects or constrain where the file may be written. In an agent workflow, if path values are influenced by user or upstream skill input, this can lead to unintended overwrites or writes to sensitive locations.
This markdown file describes a behavior that affects user data on the local filesystem: setting output causes the skill/library to write a PNG file automatically. Under the markdown-specific warning criterion, the description should explicitly disclose that a file will be written, and ideally note overwrite implications if applicable.
The documentation instructs users to write output files to paths like '/tmp/my-poster.png' and exposes an 'output' field, but it does not warn that using this skill has filesystem side effects. In a multi-skill or agent context, missing disclosure can cause unanticipated local file writes, path misuse, or collisions with existing files if callers treat the skill as a pure formatter rather than a file-producing component.
The visible user-facing strings for titles, labels, and recommendations are written in Chinese throughout the demo output. Because the file provides no opt-in, fallback, or indication that it is intentionally region-specific, it forces a specific language/locale in a way that can violate language-choice policy.
The code writes a PNG file to a user-supplied output path with fs.writeFileSync, but there is no confirmation prompt, cautionary comment, or explicit user-facing warning that the file will be created or overwritten. While file output is part of the builder's purpose, the code itself provides no disclosure at the point of the write beyond accepting the path.
This code file contains natural-language content such as the module description and user-facing warning messages in Chinese, but it does not indicate that the skill is intentionally region-specific or provide an opt-in language choice. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern.
The README explicitly advertises writing PNG output to an arbitrary filesystem path but does not warn about file creation or overwrite behavior. In an agent context, this can normalize unsafe usage patterns where user-influenced paths lead to clobbering existing files or writing artifacts to sensitive locations.
This markdown file documents that setting output will automatically write a PNG file, but it does not include any warning or caution about modifying the local filesystem. Under the markdown-file criteria for missing user warnings, file-writing behavior that can affect user data or system state should be disclosed clearly.
The skill invocation guidance is presented only with Chinese trigger phrases and does not indicate that other languages are supported or that the user can choose their preferred language. This can be read as enforcing a specific language for activation without opt-in.
The dependency uses a caret range (^0.1.97), which allows npm to install newer compatible releases within the 0.x series. This creates supply-chain risk because future upstream publishes could change behavior or introduce a compromised version without this package being intentionally updated and reviewed. In a server-side image generation skill, the dependency is directly used in the runtime path, so any malicious or vulnerable update could affect the service process.
"SKILL.md"
],
"dependencies": {
"@napi-rs/canvas": "^0.1.97"
}
}
This JavaScript file embeds multiple fixed Chinese labels and defaults for section titles and footer text, such as '差旅总览', '费用结构', and 'AI 自动生成'. Because the file forces a specific language in user-facing output without offering a language choice or documenting a justified locale restriction, it may violate the language/locale policy.
Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.
"SKILL.md"
],
"dependencies": {
"@napi-rs/canvas": "^0.1.97"
}
}