T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/install.sh:183- Finding
Root Cron Jobs Execute Scripts from a Potentially User-Writable Skill Directory
- Content
View full analysis
/etc/cron.d/agent-security << 'EOF' # VPS Security Hardening - Automated Tasks # Daily briefing at 08:00 0 8 * * * root $SKILL_DIR/scripts/daily-briefing.sh # Log size check every 6 hours 0 */6 * * * root $SKILL_DIR/scripts/audit-log-monitor.sh # Weekly security report (Sundays) 0 9 * * 0 root $SKILL_DIR/scripts/weekly-report.sh EOF chmod 644 /etc/cron.d/agent-security log " Cron jobs installed" } ``` ### Technical Analysis The installer registers three scheduled jobs under the `root` account. Their intended targets are scripts in the original Skill directory rather than copies installed into a protected system directory. The documented installation procedure places the Skill under a user's OpenClaw skills directory and then invokes the installer with `sudo`. The installer does not: - Copy scheduled executables into a root-owned directory. - Recursively change ownership to `root`. - Verify that scripts and parent directories are not writable by non-root users. - Check for symbolic links before registering the paths. - Pin the scheduled content through a trusted wrapper or integrity mechanism. If a non-root user retains write access to a scheduled script or any relevant parent directory, that user can replace the executable and cause attacker-controlled commands to run as `root`. The persistence is related to the declared monitoring functionality, but executing mutable project files as root violates least privilege and turns the scheduled tasks into a local privilege-escalation mechanism. ### Attack Path 1. A user installs the Skill from a directory that remains owned or writable by that user. 2. The installer creates `/etc/cron.d/agent-security` with jo ...[truncated 858 chars]- Remediation
View remediation
