Back to skill

Security audit

vps-maintenance

Security checks for vulnerabilities and agentic risk

Overview

This VPS maintenance skill is mostly purpose-aligned, but it includes high-impact root system changes and broad cleanup commands that are not fully scoped or disclosed.

Install only if you want an agent to help with root-level VPS administration. Review each command before execution, keep an active SSH session before changing SSH or firewall rules, customize timezone and ports, and replace broad rm -rf cleanup of /tmp, /var/tmp, and caches with age-based or service-aware cleanup.

Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (10)

Scope Creep

Medium
Confidence
95% confidence
Finding
The cleanup section deletes files outside the declared deletion scope in the manifest. The manifest only authorizes deletion of old files under /var/log, but the skill also removes /tmp/*, /var/tmp/*, and ~/.cache/*, creating a mismatch that can lead to broader destructive behavior than users or enforcement systems expect.

Scope Creep

Medium
Confidence
97% confidence
Finding
The skill creates /swapfile and appends to /etc/fstab, but those write targets are not covered by the declared writable filesystem paths. This creates undeclared persistent system changes that can bypass user expectations, policy review, or tool sandbox assumptions.

Natural-Language Policy Violations

Medium
Confidence
88% confidence
Finding
The skill unconditionally forces the system timezone to Asia/Shanghai without scoping it to user preference or deployment region. This is not a direct exploit primitive, but it can cause logging inconsistencies, operational confusion, and compliance issues on production systems.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
find /var/log -type f -name "*.old" -delete 2>/dev/null

# 4. 清理临时文件
rm -rf /tmp/* 2>/dev/null
rm -rf /var/tmp/* 2>/dev/null

# 5. 清理用户缓存
Confidence
90% confidence
Finding
This is the same destructive deletion primitive identified at the cleanup section: rm -rf on a top-level temporary directory path. In an agent skill, broad force-deletion patterns are dangerous because small path or expansion mistakes can cause substantial data loss while suppressing errors with redirection.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
find /var/log -type f -name "*.log" -mtime +7 -delete 2>/dev/null

# 清理临时文件
rm -rf /tmp/* 2>/dev/null
rm -rf /var/tmp/* 2>/dev/null

echo "=== 清理完成 ==="
Confidence
90% confidence
Finding
This occurrence appears in the reusable cleanup script, making the destructive pattern more operationally dangerous because it is packaged for repeated execution. Automating rm -rf against temporary directories materially raises the chance of accidental service disruption or unintended data removal.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
find /var/log -type f -name "*.old" -delete 2>/dev/null

# 4. 清理临时文件
rm -rf /tmp/* 2>/dev/null
rm -rf /var/tmp/* 2>/dev/null

# 5. 清理用户缓存
Confidence
90% confidence
Finding
This is the same destructive deletion primitive identified at the cleanup section: rm -rf on a top-level temporary directory path. In an agent skill, broad force-deletion patterns are dangerous because small path or expansion mistakes can cause substantial data loss while suppressing errors with redirection.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
# 4. 清理临时文件
rm -rf /tmp/* 2>/dev/null
rm -rf /var/tmp/* 2>/dev/null

# 5. 清理用户缓存
rm -rf ~/.cache/* 2>/dev/null
Confidence
90% confidence
Finding
The command forcefully and recursively deletes all contents of /var/tmp, a location often used for longer-lived temporary state by applications. This can disrupt running workloads, erase recovery artifacts, and cause outages when executed automatically or without service awareness.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
find /var/log -type f -name "*.log" -mtime +7 -delete 2>/dev/null

# 清理临时文件
rm -rf /tmp/* 2>/dev/null
rm -rf /var/tmp/* 2>/dev/null

echo "=== 清理完成 ==="
Confidence
90% confidence
Finding
This occurrence appears in the reusable cleanup script, making the destructive pattern more operationally dangerous because it is packaged for repeated execution. Automating rm -rf against temporary directories materially raises the chance of accidental service disruption or unintended data removal.

Tool Parameter Abuse

High
Category
Tool Misuse
Content
# 清理临时文件
rm -rf /tmp/* 2>/dev/null
rm -rf /var/tmp/* 2>/dev/null

echo "=== 清理完成 ==="
df -h
Confidence
90% confidence
Finding
This scripted deletion of /var/tmp/* is a broad destructive operation in a persistent maintenance script. Because /var/tmp is intended for data preserved across reboots, indiscriminate cleanup can break applications and remove diagnostically useful artifacts.

YARA rule 'agent_skill_destructive_autonomous_actions': Autonomous destructive filesystem, shell history, or repository actions in AI agent skills [agent_skills]

High
Category
YARA Match
Content
- [ ] Fail2Ban 已启用
- [ ] BBR 已启用
- [ ] 时区正确(NTP 同步)
- [ ] 自动安全更新已配置
- [ ] Swap 已配置(低内存 VPS)

## ⚖️ 权限声明
Confidence
87% confidence
Finding
The YARA hit is driven by the combination of unattended behavior and destructive cleanup primitives in a root-level maintenance skill. Although not obviously malicious, packaging autonomous cleanup and update actions together increases blast radius if run without review or if assumptions about system state are wrong.

Static analysis

No suspicious patterns detected.