T09 · Insecure Skill Coding Practices
- Location
scripts/convert.js:30- Finding
Shell Command Injection Through User-Controlled File Paths
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a real HTML-to-PPTX conversion skill, but it has unsafe path handling that can turn normal conversion inputs into local command execution or unintended local file reads.
Install only if you will convert trusted local HTML and control the filenames and output paths. Do not run it on attacker-supplied HTML or paths until convert.js avoids shell string execution and embed-css.py restricts CSS reads to approved local asset files.
scripts/convert.js:30Shell Command Injection Through User-Controlled File Paths
scripts/embed-css.py:45Arbitrary Local File Read Through Stylesheet Path Traversal
声明描述的是一个端到端的 HTML 转 PPTX 完整流程,核心能力应包括解析 HTML 结构并生成可编辑 PPTX。实际代码却只完成“自动内嵌外部 CSS”这一前置预处理步骤,没有任何 PPTX 生成、幻灯片构建、pptxgenjs 调用或保留版式到演示文稿的实现。因此代码的实际主要用途比声明显著更窄,属于描述与行为不匹配。代码访问的资源(本地 HTML/CSS 文件)与已实现步骤一致,没有发现额外未声明的敏感能力;问题在于声明明显夸大了整体功能范围。
声明描述的是“HTML 转 PPTX 完整工作流”,尤其强调“自动内嵌外部 CSS”以及“保留文字、布局、样式”。但提供的代码块仅是生成 PPTX 的脚本:它从本地文件读取 HTML,未见任何抓取、解析或内嵌外部 CSS 的逻辑,也没有处理 样式表、style 标签级联规则、选择器匹配或计算样式。实际样式处理仅限于解析元素的 inline style 字符串中的少数字段,如 font-size、color、text-align、display、visibility 等。布局方面也不是按原 HTML 坐标/盒模型还原,而是用固定 margin 和递增 yPos 顺序排版,因此“保留布局、样式”的表述明显过强。核心目的仍与 HTML 转 PPTX 相关,但声明包含了此代码未实现的重要能力,因此应判定为描述与行为不一致。
Referenced artifact was not completely inspected
node scripts/convert.js input.html output.pptx
Referenced artifact was not completely inspected
node scripts/convert.js input.html output.pptx
Referenced artifact was not completely inspected
node scripts/convert.js input.html output.pptx
Referenced artifact was not completely inspected
node scripts/convert.js input.html output.pptx
Referenced artifact was not completely inspected
node scripts/convert.js input.html output.pptx
The lockfile pins image-size to 1.2.1, and the supplied advisories indicate denial-of-service issues caused by infinite loops in multiple image parsers. Because pptxgenjs consumes image metadata and this skill converts HTML into PPTX, attacker-controlled image inputs could plausibly reach this dependency and hang the process during PPT generation.
The lockfile includes undici 7.25.0 with multiple reported advisories affecting HTTP connection handling and response parsing. In this skill's context, external CSS is automatically inlined, which suggests network fetching of remote resources; if undici is used for those requests through cheerio or related code paths, malformed or attacker-controlled upstream responses could cause request smuggling-style confusion, information leakage, or crashes.
The skill describes a workflow that reads local HTML/CSS files and writes PPTX and temporary files, but it declares no explicit tool scope such as permissions or allowed-tools. In an agent environment, missing scope boundaries can let the skill be invoked with broader file access than users expect, increasing the chance of unintended reads, overwrites, or misuse of the host filesystem.
The workflow reads local files and writes output and temporary files, but the user-facing description does not clearly warn about filesystem effects such as overwriting output paths or creating temp artifacts. In agent-driven execution, omission of these side effects can lead to accidental data loss, writes to sensitive locations, or user surprise about what the skill changes on disk.
L079 明确写明远程 URL 的 CSS 会“跳过”,表示步骤 1 不会获取网络 CSS;但清单描述 L003 又宣称“自动内嵌外部 CSS”,其自然含义通常包含外部/远程样式。两处文档共同描述了同一能力,却对远程外部 CSS 是否会被内嵌给出相互冲突的说法。
The manifest describes a document-conversion workflow that embeds CSS and generates editable PPTX files. In this file, the implementation invokes external interpreters via child_process.execSync to run other scripts, which introduces command-execution capability beyond the stated conversion function and is not declared in the manifest description.
This code file contains natural-language descriptions and comments in Chinese, including the module docstring and function docstring, with no indication that the skill is region-specific or that users can opt into that language. Under the language/locale policy, forcing a specific language without user choice can be a policy violation.
The primary skill description is written in Chinese and the README provides no indication that other languages are supported or that users can choose their preferred language. Under the language/locale policy, forcing a specific language without opt-in is a natural-language policy concern.
The document declares lang="zh-CN", and all visible content is presented only in Simplified Chinese. Under the policy, forcing a specific language or locale without user opt-in or documented justification is a natural-language policy concern.
The dependency uses a caret range (^3.12.0), which allows newer minor and patch versions to be installed. This can introduce supply-chain risk by pulling in unreviewed upstream changes or compromised releases, especially in a workflow that processes untrusted HTML and relies on third-party parsing/generation libraries.
"test": "node scripts/test.js"
},
"dependencies": {
"pptxgenjs": "^3.12.0",
"cheerio": "^1.0.0-rc.12"
},
"keywords": [
The dependency is specified with a lower bound only, which allows future installs to resolve to different versions over time. This weakens build reproducibility and can unintentionally introduce vulnerable or incompatible releases through the supply chain.
beautifulsoup4>=4.12.0
cssutils>=2.7.0
requests>=2.31.0
Using an unpinned cssutils version means installations are not deterministic and may pull in a later release with security or stability issues. In a workflow that processes external HTML/CSS, dependency predictability is important to reduce supply-chain risk.
beautifulsoup4>=4.12.0
cssutils>=2.7.0
requests>=2.31.0
The requests package is unpinned, so deployments may install different versions, including releases affected by known advisories. Because this skill's purpose includes fetching external resources such as CSS, the network-facing context makes dependency version drift more consequential than a purely local tool.
beautifulsoup4>=4.12.0
cssutils>=2.7.0
requests>=2.31.0
The manifest references requests without pinning, and requests has multiple known advisories across versions, so the actual installed version may be vulnerable. In this skill, requests is especially relevant because the workflow likely retrieves external CSS or related content, increasing exposure to URL-handling, redirect, credential, or TLS-related flaws if an affected version is installed.
The file’s banner, step descriptions, and usage text are presented in Chinese only, and there is no indication that users can choose another language or that the skill is region-specific. This can violate language/locale policy when a skill imposes a specific language without user opt-in.
This code file includes its primary descriptive comments exclusively in Chinese, which imposes a specific language context without indicating user opt-in or a documented locale-specific reason. Under the natural-language policy rule, language constraints should either offer choice or be clearly justified.