T09 · Insecure Skill Coding Practices
- Location
scripts/04-rows-columns.sh:20- Finding
Ready-to-run example scripts execute destructive spreadsheet operations without confirmation
- Content
View full analysis
Vulnerability Details
File Locations:
SKILL.md:27-35scripts/01-file-management.sh:44-58scripts/03-write-data.sh:43-49scripts/04-rows-columns.sh:20-26scripts/04-rows-columns.sh:60-66scripts/05-worksheets.sh:53-59scripts/07-charts-pictures.sh:76-80scripts/07-charts-pictures.sh:104-108
Vulnerability Type: Unconditional destructive operations in executable examples
Risk Level: MediumThe 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.shHowever, several scripts execute every embedded API operation sequentially, including destructive operations. For example,
scripts/03-write-data.sh:43-49clears 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-26deletes 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-66similarly deletes a column:bash # ── Delete Columns ─────────────────────────────────────────────────────── ...[truncated 3628 chars]- Remediation
View remediation
Remediation Suggestions
- Convert each script into a single-operation command or require an explicit operation argument, such as
--delete-rowsor--clear-range. - Require an explicit confirmation flag for destructive actions, for example
--confirm-delete. - Add an interactive confirmation prompt that displays the document ID, worksheet, range, and exact operation before sending the request.
- Default to a dry-run mode that prints the proposed request without submitting it.
- Refuse placeholder identifiers such as
your_document_id_hereand validate all required parameters. - Recommend or automatically create a document copy or recoverable version before destructive changes.
- Add prominent warnings to
SKILL.mdexplaining that the scripts currently execute every operation in sequence. - Add strict shell error handling:
bash set -euo pipefail- Use
curl --fail-with-body --show-errorso API failures stop execution and remain visible. - Separate read-only demonstrations from mutation and deletion examples. Destructive examples should not run as part of a general-purpose workflow.
- Require the user or Agent to explicitly authorize deletion separately from ordinary editing operations.
- Convert each script into a single-operation command or require an explicit operation argument, such as
