T09 · Insecure Skill Coding Practices
- Location
SKILL.md:159- Finding
Unvalidated Trace-Controlled Path Permits Modification of Arbitrary User Files
- Content
View full analysis
/` in repo or `~/.opencli/clis//` for npm installs) - **Never modify** `src/`, `extension/`, `tests/`, `package.json`, or `tsconfig.json` ``` ```markdown Read `summaryPath` first. It is the LLM-oriented entry point and includes front matter: ```yaml --- schemaVersion: 1 opencliVersion: "..." traceId: "..." status: failure site: "example" command: "example/search" adapterSourcePath: "/path/to/clis/example/search.js" errorCode: "SELECTOR" errorMessage: "Could not find element: .old-selector" --- ``` ``` ```markdown Read the adapter source file at `adapterSourcePath` from the trace summary front matter and make targeted fixes. This path is authoritative — it may be in the repo (`clis/`) or user-local (`~/.opencli/clis/`). Use the `Read` tool on the exact path from summary.md front matter. ``` ### Technical Analysis The Skill treats `adapterSourcePath`, a value obtained from a trace artifact, as an authoritative filesystem location. It instructs the Agent to read and modify the exact referenced file without requiring: - Canonicalization of the supplied path. - Validation that the resolved path remains inside an approved adapter directory. - Rejection of path traversal sequences. - Rejection of symbolic links. - Validation of the expected adapter file extension or structure. - Explicit confirmation of the fully resolved target before modification. The rule that only one file may be modified does not enforce a meaningful security boundary. If the trace is malformed, compromised, or attacker-controlled ...[truncated 1805 chars]- Remediation
View remediation
