T09 · Insecure Skill Coding Practices
- Location
assets/scripts/deploy.mjs:111- Finding
Bucket-Wide Destructive Synchronization Without Scope or Confirmation
- Content
View full analysis
!localKeys.has(k)); if (toDelete.length > 0) { console.log(`[deploy] 删除桶内过期对象 ${toDelete.length} 个…`); // batch delete in chunks of 1000 for (let i = 0; i < toDelete.length; i += 1000) { const chunk = toDelete.slice(i, i + 1000); await client.deleteMultiObjects({ bucket, objects: chunk.map((Key) => ({ key: Key })), quiet: true, }); } } ``` ### Technical Analysis The deployment script lists every object in the configured bucket and treats every key absent from the local `dist/` directory as obsolete. Deletion is not restricted to a deployment prefix, prior deployment manifest, ownership tag, or other namespace controlled by this Skill. The operation is automatic and lacks a dry-run mode or runtime confirmation. This conflicts with the Skill's stated rule to plan and confirm destructive cloud operations. A normal upload operation does not require authority to delete unrelated objects throughout an entire bucket. Configuration can also be overridden through `TOS_BUCKET`, increasing the chance that an unintended bucket is selected. ### Attack Path 1. A user con ...[truncated 1173 chars]- Remediation
View remediation
