T05 · Unauthorized Access and Privilege Escalation
Error
- Location
- SKILL.md:88
- Finding
- Triggered Mode Permits Unconfirmed Upload of Caller-Selected Local Files<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 88–99 **Vulnerability Type**: Unauthenticated local-file upload and missing authorization validation **Risk Level**: High ### Vulnerable Code ```markdown **Triggered mode (upstream skill chaining):** When the agent receives a trigger message containing all required parameters (e.g., from Deep Research), **skip user confirmation** and auto-execute. The trigger message should include: - `报告路径` / `report_path`: path to the source file to upload - `Notebook 名称` / `notebook_name`: name for the notebook (create if not exists) - `产出类型`: Audio Overview / Video Overview / Infographics / Slides - `格式`: deep_dive / brief / etc. - `长度`: short / default / long - `语言`: BCP-47 code In triggered mode, the agent should: 1. Create notebook with `nlm notebook create "<notebook_name>"` 2. Upload source with `nlm source add <notebook_id> --file <report_path> --wait` 3. Proceed directly to Step 4 (Create Content) with the provided parameters 4. Set up polling and notify user when complete ``` ### Technical Analysis The triggered workflow treats the presence of expected message fields as sufficient authority to perform an external upload. It explicitly skips user confirmation and passes the caller-controlled `report_path` to `nlm source add`. No instruction requires the agent to: - Authenticate the upstream skill or verify the provenance of the trigger. - Confirm that the user authorized disclosure of the selected file. - Restrict the source file to an approved project or report directory. - Resolve the path and reject traversal outside an allowed root. - Reject symbolic links or special files. - Preview the resolved path and upload destination before transfer. Consequently, a crafted trigger can nominate any file readable by the account running the agent. Although the `--file` argument is represented as a quoted placeholder in the documentation, quoting only mitigates shell parsing; it does not prevent un ...[truncated 1363 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Require explicit user confirmation before every external file upload, including workflows initiated by another skill. 2. Authenticate upstream invocations using trusted metadata or a capability token rather than relying on the presence of expected fields. 3. Resolve the requested file with a canonical-path operation and require it to remain under a narrowly approved source directory. 4. Reject symbolic links, device files, sockets, directories, and other non-regular files. 5. Present the canonical local path, file size, notebook destination, and external service to the user before transfer. 6. Maintain a separate allowlist of artifacts produced by trusted upstream workflows and pass opaque artifact identifiers instead of arbitrary filesystem paths. 7. Apply file-size and extension restrictions and scan content for secrets before upload. 8. Log the validated caller identity, user approval, canonical source path, destination notebook, and upload result without recording sensitive file contents. ]]>
