Back to skill

Security audit

Windows Dev Pitfalls

Security checks for vulnerabilities and agentic risk

Overview

This is a Windows/PowerShell development reference skill, but it asks agents to persistently edit the skill and includes high-impact system-remediation guidance without strong user confirmation gates.

Install only if you want a mutable, living reference skill for Windows defensive-tool development. Before using it, require the agent to ask before editing the skill file, and do not let it automatically apply examples that modify hosts files, firewall rules, services, permissions, watchdog behavior, or delete/quarantine files without backups and explicit confirmation.

Vulnerability Patterns
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (3)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

The skill contains broad, mandatory self-update rules such as 'every time this skill is used' and 'proactively append after conversations,' which can cause the agent to modify persistent skill content based on loosely related interactions. In an adversarial setting, this increases the risk of prompt-injection-driven persistence, accidental contamination of the skill, and unreviewed accumulation of unsafe or irrelevant instructions.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill describes tooling and procedures that include destructive or system-altering behaviors such as modifying hosts files, changing firewall rules, deleting files, altering protections, and interacting with watchdog/self-protection mechanisms, but the top-level description lacks a clear warning to users. Without an upfront warning, operators may invoke the skill in inappropriate contexts and unintentionally damage systems, reduce defenses, or mis-handle production environments.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
78% confidence
Finding

The skill includes operational guidance for destructive system modifications such as chmod a-w, chattr +i, firewall changes, hosts-file edits, service changes, and deletion workflows. In a skill consumed by an agent, these examples can normalize or encourage dangerous system-altering actions without strong execution boundaries, especially because the document mixes analysis advice with prescriptive remediation commands.

Content

Scanner excerpt · SKILL.md (reported line 772)May include surrounding context.

md
- **v1.6.0 (2026-08-17)**:§8/§5 新增辅助脚本审查与重构经验: ① **正则 `^(.*)$` 贪婪匹配会吞入行尾后缀** → 清单解析必须精确锚定可选后缀: `(.*?)(?:\s+\[[^\]]*\])?(?:\s*\|\s*原隔离区:\s*.*)?$` (防恢复落错文件名/回滚失败); ② **`"" | Out-File -Append` 默认 UTF-16, 后续 Add-Content 按 ANSI/UTF8 追加 → 日志中文乱码混排** → 首行必须显式 `-Encoding UTF8`; ③ 辅助脚本与主引擎的**路径回退必须一致** (Clear-Cache 的 LOCALAPPDATA 回退曾与引擎不同, 清不干净); ④ 多脚本复用的"交互序号选择"逻辑抽公共函数 `Get-Selection` (返回 @(-1) 表示取消), 收敛 8 处重复代码, 注意各处块文本细微差异(变量初始化位置/多行 all 分支/文案不同), 需逐处核对; ⑤ 大工程整块替换用**先 dump repr 对比再替换**, 别猜格式(曾因 LF/CRLF、尾随空格、变量初始化顺序差异匹配失败 3 次)。
- **v1.5.0 (2026-08-17)**:§7 新增自查方法论 + §2/§5 补坑: ① **多 agent 并行代码审查** + 逐个复验(不轻信结论, 用 grep/sed 验证每个发现) 是发现隐蔽 bug 的高效方式; ② **`foreach ($a in $args)` 循环内 `$_` 是空**(foreach 不设 `$_`, 只有 ForEach-Object 管道才设)→ 循环内必须用 `$a`(曾致 /threads=N 永不生效); ③ **cmd 里 `goto 未定义标签` 直接终止整个 bat** → 所有 goto 目标必须存在, 自查时 grep 全部 goto 与标签对比; ④ **SYSTEM 计划任务 cmd /c 拼接路径**: cmd 在双引号内仍展开 `%VAR%`, 必须先 `[Environment]::ExpandEnvironmentVariables` 并拒绝残留 `%` 的路径; ⑤ **可预测 /tmp 文件名 + symlink = root 任意文件写**: 写临时文件用 `[IO.File]::Open(path, CreateNew,...)` (O_EXCL 语义) 防符号链接; ⑥ `Move-Item` 等关键操作在全局 `SilentlyContinue` 下**必须显式 `-ErrorAction Stop` + Test-Path 复核**, 否则假成功; ⑦ 前缀匹配 `StartsWith($dir)` 必须补分隔符防 `FooEvil` 绕过; ⑧ 路径提取用 `(\S+)` 遇空格截断 → 改行末 `(.+)$`; ⑨ 关机守护按进程名 kill 会误杀系统/自身触发的合法 shutdown → **系统路径只记录不 kill**, 非系统路径才拦。
- **v1.4.4 (2026-08-17)**:§5 新增网络封锁实战经验: ① Windows 防火墙封禁: `New-NetFirewallRule -Direction Outbound -Action Block` 按 `-RemoteAddress`(IP) 或 `-Program`(进程路径), 需管理员; 查重用 `Get-NetFirewallRule -DisplayName`; ② Linux iptables: `iptables -C OUTPUT -d IP -j DROP` 查重(退出码0=已存在), `-A` 添加 `-D` 删除; **容器默认有 CAP_NET_ADMIN 可真实测试**, 但规则重启即失(未持久化, 工具定位是实时阻断); ③ Linux iptables 无法按进程过滤(需 owner/cgroup match), 进程路径封锁仅记录清单; ④ 规则名用 IP 转义(`-replace '[.:]','_'`)防重名, 进程规则用路径 MD5 前12位; ⑤ 封锁清单同样用「管道符分隔」+ 去重(查重 key 用目标值); ⑥ `/xxx` 管理模式的通用交互(查看清单→序号选择→解除)已复用第 4 处。
- **v1.4.3 (2026-08-17)**:§5 新增威胁锁定实战经验: ① **PowerShell 管道 0 对象不会触发 Set-Content** → 清空文件用 `Clear-Content`, 否则 `$lines | Set-Content` 空数组时文件保持原样(清
...[truncated 26 chars]