T09 · Insecure Skill Coding Practices
- Location
SKILL.md:252- Finding
Unconfirmed Terraform Destruction Can Target the Wrong Environment
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a coherent Terraform cloud automation guide, but it includes unsafe infrastructure destruction and weak environment scoping that could delete the wrong cloud resources.
Review this skill carefully before installing. Use least-privilege cloud credentials, keep dev/test/prod in separate Terraform workspaces or backends, manually review every plan, remove `-auto-approve` from destroy workflows, and do not use the included database template for important data unless backups, deletion protection, encryption, and final snapshots are configured.
SKILL.md:252Unconfirmed Terraform Destruction Can Target the Wrong Environment
SKILL.md:146Terraform Templates Use Unsafe Public Exposure and Data-Retention Defaults
The skill instructs users to run deployment and destroy operations without a prominent warning about irreversible deletion, cloud charges, or production impact. In an agent-execution context, this increases the risk of users or agents triggering costly or destructive actions without informed confirmation.
The skill walks through cloud credential setup but does not warn users not to paste secrets into chat, logs, generated files, or Terraform variables. In an LLM-agent setting, credential-handling guidance is security-sensitive because users may disclose privileged cloud access tokens to the agent or store them insecurely.
Using terraform destroy -auto-approve removes the human confirmation barrier for destructive operations, enabling immediate infrastructure deletion if the command is triggered accidentally or by prompt-driven automation. In a skill with exec capability, this is particularly dangerous because the agent can execute irreversible cloud actions that cause downtime, data loss, and financial impact.
;;
destroy)
cd infra
terraform destroy -auto-approve
echo "已销毁$ENV环境资源"
;;
*)
L444-L457将“多云统一管理”列为免费版不支持的高级功能,但该技能正文已在L47、L80-L112、L368中明确宣称免费版支持AWS/GCP/Azure三大云平台,并提供对应初始化命令。虽然正文强调“单云”而非同时多云,但该限制说明容易与前述已实现/已宣称的平台支持形成直接意图冲突。
版权声明中的改造清单在L430声称新增了“四类Terraform模板(Web应用/数据库/基础网络/安全组)”,但前文“功能二:Terraform模板”实际仅分为Web应用、数据库、基础网络三类章节。安全组只作为Web应用模板中的一个资源片段出现,而非独立第四类模板。
The text says the skill was 'completely Chinese-localized' for Chinese user scenarios, and the document is entirely written in Chinese without offering a language choice. That can be interpreted as forcing a specific language/locale rather than giving the user an explicit opt-in or alternative.
No suspicious patterns detected.