T09 · Insecure Skill Coding Practices
Warning
- Location
- scripts/04-rows-columns.sh:20
- Finding
- Ready-to-run example scripts execute destructive spreadsheet operations without confirmation## Vulnerability Details **File Locations**: - `SKILL.md:27-35` - `scripts/01-file-management.sh:44-58` - `scripts/03-write-data.sh:43-49` - `scripts/04-rows-columns.sh:20-26` - `scripts/04-rows-columns.sh:60-66` - `scripts/05-worksheets.sh:53-59` - `scripts/07-charts-pictures.sh:76-80` - `scripts/07-charts-pictures.sh:104-108` **Vulnerability Type**: Unconditional destructive operations in executable examples **Risk Level**: Medium The documentation presents the scripts as ready-to-run commands: ```bash bash scripts/01-file-management.sh bash scripts/02-read-data.sh bash scripts/03-write-data.sh bash scripts/04-rows-columns.sh bash scripts/05-worksheets.sh bash scripts/06-formulas.sh bash scripts/07-charts-pictures.sh bash scripts/08-formatting.sh bash scripts/09-end-to-end.sh ``` However, several scripts execute every embedded API operation sequentially, including destructive operations. For example, `scripts/03-write-data.sh:43-49` clears a cell range without requesting confirmation: ```bash # ── Clear Range ─────────────────────────────────────────────────────────────── echo "=== Clear Range ===" curl -s -X POST "$BASE_URL/api/v1/excel/clear_range" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d "{\"uri\": \"$DOC_ID\", \"sheet\": \"Sheet1\", \"range\": \"D1:F10\"}" \ | jq . ``` `scripts/04-rows-columns.sh:20-26` deletes rows unconditionally: ```bash # ── Delete Rows ─────────────────────────────────────────────────────────────── echo "=== Delete Rows ===" curl -s -X POST "$BASE_URL/api/v1/excel/delete_rows" \ -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d "{\"uri\": \"$DOC_ID\", \"sheet\": \"Sheet1\", \"row\": 5, \"count\": 2}" \ | jq . ``` `scripts/04-rows-columns.sh:60-66` similarly deletes a column: ```bash # ── Delete Columns ─────────────────────────────────────────────────────── ...[truncated 3628 chars]
- Remediation
- ## Remediation Suggestions 1. Convert each script into a single-operation command or require an explicit operation argument, such as `--delete-rows` or `--clear-range`. 2. Require an explicit confirmation flag for destructive actions, for example `--confirm-delete`. 3. Add an interactive confirmation prompt that displays the document ID, worksheet, range, and exact operation before sending the request. 4. Default to a dry-run mode that prints the proposed request without submitting it. 5. Refuse placeholder identifiers such as `your_document_id_here` and validate all required parameters. 6. Recommend or automatically create a document copy or recoverable version before destructive changes. 7. Add prominent warnings to `SKILL.md` explaining that the scripts currently execute every operation in sequence. 8. Add strict shell error handling: ```bash set -euo pipefail ``` 9. Use `curl --fail-with-body --show-error` so API failures stop execution and remain visible. 10. Separate read-only demonstrations from mutation and deletion examples. Destructive examples should not run as part of a general-purpose workflow. 11. Require the user or Agent to explicitly authorize deletion separately from ordinary editing operations.
