T09 · Insecure Skill Coding Practices
- Location
scripts/inspect.sh:14- Finding
Predictable Temporary Report Path Permits Symlink-Based Privileged File Corruption
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a legitimate local Ubuntu inspection tool, but it asks users to run broad host checks with root access while writing sensitive reports insecurely under /tmp.
Install only if you are comfortable running a local system-inspection script and reviewing the generated report. Prefer running it without root first, avoid sharing the report publicly, and consider changing the script to use a private directory, mktemp, and 0600 permissions before running it on multi-user or production servers.
scripts/inspect.sh:14Predictable Temporary Report Path Permits Symlink-Based Privileged File Corruption
scripts/inspect.sh:64Sensitive Host Reconnaissance Data Is Written to an Insufficiently Protected Shared-Directory Report
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# 13. 安全相关
echo "【13. 安全信息】" | tee -a "$REPORT_FILE"
echo "系统用户数量: $(cat /etc/passwd | wc -l)" | tee -a "$REPORT_FILE"
echo "sudo 用户: $(grep -c 'sudo' /etc/group)" | tee -a "$REPORT_FILE"
echo "失败的登录尝试 (最近10次):" | tee -a "$REPORT_FILE"
lastb -n 10 2>/dev/null | tee -a "$REPORT_FILE" || echo " 无记录" | tee -a "$REPORT_FILE"
The script writes a detailed system inspection report to /tmp, a world-accessible shared directory on many systems, and the report contains sensitive host metadata such as hostname, IP addresses, listening ports, login records, users, and service state. Even if the script is intended for legitimate administration, storing this data in /tmp without restrictive permissions or an explicit warning can expose reconnaissance data to local users or other processes.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# 13. 安全相关
echo "【13. 安全信息】" | tee -a "$REPORT_FILE"
echo "系统用户数量: $(cat /etc/passwd | wc -l)" | tee -a "$REPORT_FILE"
echo "sudo 用户: $(grep -c 'sudo' /etc/group)" | tee -a "$REPORT_FILE"
echo "失败的登录尝试 (最近10次):" | tee -a "$REPORT_FILE"
lastb -n 10 2>/dev/null | tee -a "$REPORT_FILE" || echo " 无记录" | tee -a "$REPORT_FILE"
echo "" | tee -a "$REPORT_FILE"
Most user-visible messages in the script are fixed in Chinese, which forces a specific language for output. The file does not provide any opt-in, configuration, or documented justification for restricting output to that locale.