T09 · Insecure Skill Coding Practices
- Location
src/storage.js:105- Finding
Plaintext Sensitive Data Stored Without Enforced Restrictive Permissions
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a straightforward Chinese-language local JSON storage skill, with manageable risks around plaintext local data, no undo for changes, and unnecessary npm dependencies.
Install only if you are comfortable with a Chinese-language local JSON CRUD helper. Do not store secrets or sensitive personal data unless you control file permissions and backups; remove the unnecessary fs/path npm dependencies before production use if possible.
src/storage.js:105Plaintext Sensitive Data Stored Without Enforced Restrictive Permissions
package.json:17Unnecessary External Packages Duplicate Node.js Built-In Modules
src/storage.js:96Non-Atomic and Uncoordinated Whole-File Storage Updates
该代码块的核心功能是一个 Parser,用于识别命令中的操作类型并解析条件、字段和值,输出 action/conditions/data 结构。它没有展示任何与本地文件存储相关的逻辑(如 fs 模块、文件读写、持久化),也没有任何数据库或内存数据操作实现,因此与“本地文件存储数据,支持增删改查功能”的描述存在实质差异。另外,描述中提到“第一次使用时自动分析数据字段”,代码中也完全没有字段推断、初始化分析或 schema 管理逻辑。虽然“可通过一句话命令进行操作”这一点与代码中的自然语言命令解析相符,但整体上代码只覆盖了描述中的输入解析部分,未覆盖主要宣称能力,因此应判定为不匹配。
代码的核心确实是本地文件存储和增删改查,这与声明的大部分内容一致。但声明中的两个重要能力在此代码中没有体现:其一,init(fields) 只是接收并保存传入的 fields,并不会自动分析现有数据字段;其二,代码仅提供编程接口 add/query/update/delete,没有自然语言命令解析或“一句话命令”处理逻辑。因此描述比实际行为更强,存在描述与实现不完全一致的情况。
The skill advertises delete and modify operations on local data without any warning about irreversibility, confirmation, backup, or recovery. In a local-storage context, users may issue natural-language commands that accidentally overwrite or delete records, causing unintended data loss that is difficult to recover from.
The code returns all user-facing messages in Chinese, including parse errors, unsupported-operation notices, input instructions, and success messages. This imposes a specific language on all users with no opt-in, fallback, or indication that the skill is intentionally region-specific, which matches the language/locale policy-violation category.
The command parser only recognizes Chinese trigger terms such as '添加', '查询', '修改', and '删除', which effectively forces one language for interaction. This is a natural-language policy concern because there is no opt-in, fallback, or documented justification that the skill is intentionally limited to a Chinese-only locale.
The delete method removes matching records and persists the new dataset to disk via saveData, making the change irreversible within this skill. There is no confirmation prompt, warning message, or explanatory comment indicating that data will be deleted from the backing file.
This code file issues commands to store, modify, and delete user information, including email addresses, but provides no confirmation prompt or explicit warning before those state-changing operations occur. Although it logs test step names, the output does not disclose the safety impact of writing or deleting user data.
The description and all usage examples are written as Chinese-only command phrases, implying the skill expects that language for operation. There is no statement that the skill is China/Chinese-specific or that users may choose another language, so this creates a language-policy concern.
The manifest description is written only in Chinese and presents the skill in a single language, with no indication that language selection is optional or that the skill is intended solely for a Chinese-speaking context. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy concern.
The manifest declares fs as an npm dependency even though fs is a built-in Node.js module, and the npm fs package name has known malicious/advisory history. This creates a real supply-chain risk: an install may fetch an unnecessary external package that could execute malicious code during installation or runtime, which is especially dangerous for a local-storage skill with filesystem access.
Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.
"license": "MIT",
"dependencies": {
"fs": "^0.0.1-security",
"path": "^0.12.7"
}
}
All natural-language commands sent to processCommand are written in Chinese, and the file gives no indication that another language is supported or that Chinese is a required locale. This creates a language policy concern because the skill behavior appears tied to a single language without user opt-in or justification.