T09 · Insecure Skill Coding Practices
Warning
- Location
- core-traffic-rules/revision-draft-comparison.md:135
- Finding
- Unapproved External Document Retrieval and Local File Creation## Vulnerability Details **File Location**: `core-traffic-rules/revision-draft-comparison.md`, lines 135-151 **Related Locations**: `SKILL.md`, lines 23, 49, and 182 **Vulnerability Type**: Insecure automated network and filesystem operations **Risk Level**: Medium ### Complete Vulnerable Snippet The following is a faithful English rendering of the complete affected section: ```markdown ## 6. Follow-up Actions (Pending Trigger) | Action | Trigger Condition | Executor | Output | |---|---|---|---| | Obtain the full revision draft | Published by Xinhua News Agency or Xinhuanet | AI System Architect | Download the PDF to `~/downloads/drafts/` | | Conduct article-by-article comparison | Official draft text received | intelligent-driving-dss Skill | `core-traffic-rules/2026-version-comparison-report.md` | | Update the intelligent-driving module | L3/L4 provision changes confirmed | intelligent-driving-dss Skill | `nev-system-module/intelligent-driving-adaptation-recommendations.md` | | Retest regulatory-checking capability | Differences between versions established | intelligent-driving-dss Skill | `core-function-validation-report.md` | ## 7. Reference Links 1. State Council legislative-plan portal: https://www.gov.cn/liuxiang/gongzuo/xfgz.shtml 2. Ministry of Public Security Traffic Management Bureau: https://www.mps.gov.cn/n16/n905472/n3838/index.html 3. Xinhua legal channel: http://law.news.cn/ This document is the legislative-amendment tracking subfunction of the regulatory-compliance module. The comparison workflow will activate automatically after the 2026 revision draft is officially published. ``` ### Technical Analysis The Skill defines a conditionally activated workflow that downloads an external PDF and writes multiple generated files to local directories. The workflow does not require explicit user approval immediately before either the download or the filesystem writes. It also does not define: ...[truncated 2933 chars]
- Remediation
- ## Remediation Suggestions 1. Remove automatic activation and require explicit, action-specific user confirmation before downloading a document or creating each output file. 2. Allow retrieval only from exact approved HTTPS hostnames. Remove the plain HTTP source, reject unexpected redirects, and validate the final resolved hostname. 3. Download into a dedicated sandboxed temporary directory rather than `~/downloads/`. 4. Enforce strict response-size limits, timeouts, content-type checks, PDF magic-byte validation, and document-parser resource limits. 5. Treat all retrieved document text as untrusted data. Explicitly prohibit following instructions embedded in PDFs, metadata, links, annotations, or extracted text. 6. Present the source URL, checksum, publication date, and proposed destination to the user before processing. 7. Use non-overwriting, collision-resistant filenames and reject symbolic links or paths that resolve outside the approved workspace. 8. Generate reports in a staging directory and require review before moving them into the Skill knowledge base. 9. Record an audit log containing user approval, source URL, final resolved URL, checksum, timestamp, output paths, and validation results. 10. Run document parsing with minimal permissions and without shell execution, external entity resolution, macros, embedded-file execution, or unrestricted network access.
