T09 · Insecure Skill Coding Practices
- Location
scripts/excel_import.py:818- Finding
Untrusted spreadsheet values can be written as executable formulas
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This spreadsheet import skill mostly matches its purpose, but it needs Review because it can mishandle sensitive spreadsheet data and some safety controls are weaker than documented.
Install only in a controlled workspace and use copies of spreadsheets. Treat generated workbooks, backups, logs, and reports as potentially sensitive. Do not rely on dry-run being side-effect free, do not rely on the documented encrypt/custom validation behavior unless fixed, and avoid importing untrusted spreadsheets until formula-like values are neutralized or rejected.
scripts/excel_import.py:818Untrusted spreadsheet values can be written as executable formulas
scripts/data_mapper.py:241Unknown validation rules silently succeed
scripts/data_mapper.py:44Documented encryption transform silently preserves sensitive plaintext
scripts/excel_import.py:68Dry-run mode performs configuration-controlled filesystem writes
SKILL.md:21Runtime dependencies are installed without version or integrity pinning
Referenced artifact was not completely inspected
For full parameter docs, see [data-mapping-guide.md](references/data-mapping-guide.md).
Referenced artifact was not completely inspected
For full parameter docs, see [data-mapping-guide.md](references/data-mapping-guide.md).
Referenced artifact was not completely inspected
- **Troubleshooting**: [troubleshooting.md](references/troubleshooting.md) — common issues
The guide recommends rm -rf /tmp/excel_import_temp_* as a cleanup step. Even though it targets a temp path, wildcard recursive deletion is error-prone and can remove unintended files if naming conventions, symlinks, or operator assumptions are wrong; in a spreadsheet import workflow this can destroy temporary evidence needed for troubleshooting or recovery.
df -h
# 清理临时文件
rm -rf /tmp/excel_import_temp_*
# 清理旧备份
find backup/ -name "*.xlsx" -mtime +30 -delete
The guide recommends rm -rf /tmp/excel_import_temp_* as a cleanup step. Even though it targets a temp path, wildcard recursive deletion is error-prone and can remove unintended files if naming conventions, symlinks, or operator assumptions are wrong; in a spreadsheet import workflow this can destroy temporary evidence needed for troubleshooting or recovery.
df -h
# 清理临时文件
rm -rf /tmp/excel_import_temp_*
# 清理旧备份
find backup/ -name "*.xlsx" -mtime +30 -delete
The skill instructs reading source files and writing output spreadsheets, but it does not declare any explicit tool scope or permissions boundaries. In an agent environment, this can lead to overbroad file access assumptions, making it easier for the skill to read or overwrite unintended files if invoked with attacker-controlled paths or ambiguous execution context.
The manifest description includes Chinese-only invocation guidance for when to use the skill, but the file does not state that the skill is region-specific or offer users a language/locale choice. This can violate organizational language/locale policy when a skill implicitly privileges one language without opt-in or justification.
The entire skill description and instructional content are written in Chinese, and there is no indication that users may choose another language or that the skill is intended only for a Chinese-speaking or region-specific context. This creates a natural-language policy concern because it effectively imposes a specific language without opt-in.
The example instructs users to drop rows, fill missing values, coerce parsing failures to NaN, and remove outliers without any warning that these steps irreversibly alter or delete source data semantics. In a data-import skill, users may apply the snippet to production spreadsheets and silently lose records or overwrite meaningful values, which can cause integrity issues and incorrect downstream business decisions.
This markdown file contains executable-style examples that scan a large directory of Excel files and write results to scan_results.json. The surrounding description presents the workflow as a solution, but does not warn users that running it will create output files and process potentially sensitive business data.
Later sections include examples that write errors_.xlsx, processed/.csv, checkpoint.json, import.log, and quality_report.png. Because this is a markdown skill/example file, the expected warning should tell users that executing these steps will persist transformed business data and diagnostic artifacts to disk.
The documentation explicitly states that when multiple source files contain the same key, later-processed files overwrite earlier data, but it does not prominently warn about unintended data loss or integrity issues. In a bulk spreadsheet import skill, silent overwrite behavior can cause users to corrupt or replace records at scale, especially when processing directories automatically.
This markdown file contains user-facing guidance entirely in Chinese and explicitly documents that the feature is primarily optimized for Chinese column names. That creates a language/locale constraint without opt-in or an alternative language path, which matches the policy category for forced language/locale behavior.
The document title and all instructional content are written in Chinese, and there is no indication that users may choose another language or that the locale restriction is intentional and justified. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.
The best-practices document presents 'skip_validation: true' as a performance optimization option, which can encourage disabling integrity checks during import. In this skill context, validation is a primary safeguard against malformed, inconsistent, or maliciously crafted spreadsheet data, so recommending it without stronger constraints increases risk of bad data ingestion and downstream corruption.
options:
preserve_formatting: false # 不保持格式,提升速度
skip_validation: true # 跳过验证(谨慎使用)
The error log example includes raw sensitive values such as an ID number field and corresponding value, which normalizes logging plaintext personal data. In an Excel import workflow that processes HR-style records and identity data, this increases the chance of privacy leakage through log files, backups, and downstream log aggregation systems.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
文件权限:
# 配置文件: 只读
chmod 444 import_config.yaml
# 备份目录: 仅所有者可写
chmod 700 backup/
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
chmod 444 import_config.yaml
# 备份目录: 仅所有者可写
chmod 700 backup/
# 错误日志: 仅所有者可读写
chmod 600 logs/import_errors.log
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
chmod 700 backup/
chmod 600 logs/import_errors.log
### 3. 数据备份策略
The guide uses examples with highly sensitive personal data such as ID numbers and phone numbers, but does not warn users about privacy, minimization, masking, or compliance obligations. In a data-import skill, this can normalize unsafe handling of PII and lead users to process real sensitive data in configs, test files, and logs without safeguards.
The debugging and preview examples print raw mapped values directly to console output, including fields like name, ID card number, and phone number. In this skill’s context, those examples are likely to be copied into real workflows, causing sensitive data exposure through terminals, logs, CI output, shared screenshots, or support bundles.
The document states that target files will be modified and backup copies created automatically, but it does not explicitly warn users about these side effects or the storage implications of backup/rollback behavior. In a file-import skill that operates on spreadsheets, this can lead to unintended data duplication, unexpected persistence of sensitive data in backup folders, and user surprise about destructive or state-changing actions.
The validation report example includes a national ID field and raw sample value, while the logging/reporting guidance does not warn about exposure of personally sensitive data in logs or exported JSON reports. In this skill's context, import errors are likely to involve real spreadsheet records, so logging field values can create secondary privacy leakage through log files, reports, and backups.
The quickstart uses realistic-looking Chinese national ID numbers and demonstrates exporting and backing up personal data to output files without any warning about handling sensitive PII, masking examples, or safe storage practices. In a data-import skill specifically designed to process spreadsheets at scale, this can normalize unsafe handling of real personal data and increase the chance that users copy the pattern into production with unprotected identifiers and duplicated backups.
Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.
调试命令:
# 检查文件是否存在
ls -l /home/user/project/data/data.xlsx
# 检查当前工作目录
pwd