T09 · Insecure Skill Coding Practices
- Location
references/agent-guardrails.md:47- Finding
Destructive MCP operations lack an enforced operator-confirmation gate
- Content
View full analysis
Vulnerability Details
File Location:
references/agent-guardrails.md, lines 47 and 79–81
Vulnerability Type: Missing authorization enforcement for destructive operations
Risk Level: HighVulnerable Snippet
markdown | "Confirm before anything destructive" | Every destructive tool (`osd_purge`, `osd_mark_out`, `pool_delete`, `rbd_image_delete`, `rbd_snapshot_delete`, `set_pool_size`) takes `dry_run=True` for a preview and is `risk=high`, tagged `review` on its audit row. ⚠️ **The double confirmation is a CLI feature, and only `osd_purge` and `osd_mark_out` have CLI commands** — the other four are reachable only over MCP, where nothing prompts. Keep your own confirmation for those. |text - `pool_delete`, `rbd_image_delete`, `rbd_snapshot_delete` and `set_pool_size` have no CLI command, so nothing will ask you to confirm them. Call them with `dry_run=True` first, show the operator what would change, and wait for an explicit go-ahead.Technical Analysis
The Skill exposes
pool_delete,rbd_image_delete,rbd_snapshot_delete, andset_pool_sizethrough MCP. The documentation expressly states that these operations do not produce a confirmation prompt. The dry-run and operator-approval procedure is only a prompt-level instruction to the agent, rather than a control enforced by the MCP operation.Consequently, an agent can submit the real destructive operation without demonstrating that:
- A dry run was completed for the same operation, target, and parameters.
- The dry-run result was presented to the operator.
- The operator explicitly approved that exact change.
- The approval remains current and has not been reused for different parameters.
An audit label such as
risk=highorreviewrecords an operation but does not authorize or prevent it. Likewise, account-level Ceph permissions limit which accounts can perform writes, but a write-enabled account still leaves the model-to-cluster authorization boundary ...[truncated 1410 chars]- Remediation
View remediation
Remediation Suggestions
Enforce destructive-operation approval in the MCP implementation rather than relying on model instructions:
- Require a successful dry run before every destructive operation.
- Bind the dry-run record to the exact operation, target resource, parameters, authenticated account, and cluster.
- Return a cryptographically random, short-lived, single-use confirmation token after the dry run.
- Require the token for the real operation and reject calls with missing, expired, reused, or parameter-mismatched tokens.
- Require the client to obtain explicit operator approval before submitting the token.
- Default destructive calls to dry-run mode and require an explicit execution flag.
- Apply the gate consistently to
pool_delete,rbd_image_delete,rbd_snapshot_delete, andset_pool_size. - Preserve least-privilege Ceph roles as defense in depth, using read-only accounts unless write access is explicitly required.
- Continue audit logging, but treat it as detection and accountability rather than authorization.
