T08 · Insecure Dependencies
- Location
scripts/package.json:9- Finding
Unpinned Dependency Installation Without a Lockfile
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a straightforward local image resize/compression skill, with some dependency and validation hardening issues but no evidence of hidden, deceptive, exfiltrating, or destructive behavior.
Install and run this like a normal local CLI utility, preferably in a project or sandbox without unnecessary credentials. Be aware that npm install will fetch sharp without a lockfile, and avoid processing untrusted images or extreme resize values until the package pins dependencies and adds explicit dimension/resource limits.
scripts/package.json:9Unpinned Dependency Installation Without a Lockfile
scripts/resize_image.js:116Unbounded Image Dimensions Permit Local Resource Exhaustion
This markdown file contains user-facing natural-language instructions entirely in Chinese, which can impose a specific language on users without an explicit opt-in or alternative. The policy scope includes language or locale constraints in markdown content, and no language choice or justification is provided here.
该代码文件中的主要用户可见说明、帮助文本和错误提示均为中文,属于自然语言层面的语言/locale 约束。文件中没有提供语言切换、用户选择机制,亦未说明该工具仅面向特定中文环境或区域,因此符合语言策略违规条件。
showHelp 中所有面向用户的使用说明均固定为中文,命令行用户无法选择其他语言。根据规则,强制单一语言且没有 opt-in 或合理、已记录的区域性限制,属于自然语言政策问题。
L097-L099 的帮助示例明确宣称可用通配符进行批量处理,但实际参数解析只保存一个 input 值,主流程在 L466-L471 也仅对单一路径做 existsSync 检查并调用一次 processImage。该文档会让调用方误以为脚本具备批量处理能力,属于注释/帮助文本与实际行为相矛盾。
运行状态输出如压缩提示、保存结果、错误信息等均为中文,属于用户可见自然语言内容。文件未提供任何语言切换或区域限定说明,因此存在单一语言强制的问题。
The package description is written only in Chinese, which signals a language-specific skill description without offering users a language choice or documenting that the skill is intentionally region-specific. Under the stated policy, forcing a specific language without opt-in can be a natural-language policy violation.
The dependency on sharp uses a caret range (^0.32.6), which allows different patch releases to be installed over time. In a security-sensitive supply chain, this reduces build reproducibility and can result in unexpectedly pulling a vulnerable or maliciously compromised release, especially for a package with native components and install-time behavior.
"resize": "node resize_image.js"
},
"dependencies": {
"sharp": "^0.32.6"
},
"keywords": [
"image",
The manifest references sharp without pinning an exact version, while the package family has multiple known advisories, including issues in transitive native libraries and historical install-time risks. Because sharp processes untrusted image data and bundles/depends on complex native code, unresolved version ambiguity materially increases the chance of shipping a build exposed to memory corruption, denial of service, or supply-chain compromise.
文档在 L017 将 -h 标记为高度参数,但参数解析的 switch 中 L128-L132 已先匹配 '-h' 为 height,导致后面的 L175-L178 帮助分支中的 '-h' 实际不可达。帮助文本和代码共同给出了互相冲突的意图说明,容易误导使用者。
No suspicious patterns detected.