T06 · System Persistence
- Location
scripts/install.sh:69- Finding
Persistent Cron Jobs Execute Mutable Skill Scripts Indefinitely
- Content
View full analysis
/tmp/crontab.backup 2>/dev/null || true # Add new tasks (crontab -l 2>/dev/null || true; cat << EOF # Session Guardian # Incremental backup */$INCREMENTAL_INTERVAL * * * * bash "$SKILL_DIR/scripts/incremental-backup.sh" >> "$LOG_FILE" 2>&1 # Hourly snapshot 0 */$HOURLY_INTERVAL * * * bash "$SKILL_DIR/scripts/hourly-snapshot.sh" >> "$LOG_FILE" 2>&1 EOF ) | crontab - fi ``` ### Technical Analysis The installer registers two user-level cron jobs that survive the installation process and execute scripts directly from the skill directory. Scheduled execution is related to the declared automatic-backup functionality and requires explicit confirmation, so persistence itself is functionally justified and does not obtain root privileges. However, the implementation lacks several controls expected for safe persistent execution: - There is no check for existing Session Guardian entries before appending new ones. - Re-running the installer can create duplicate jobs. - No uninstall or managed removal command is provided. - The scripts are executed from a mutable workspace path without integrity verification. - The crontab backup uses the predictable shared path `/tmp/crontab.backup`. - The installer does not create a narrowly scoped wrapper or verify ownership and permissions before each scheduled run. This means any process that can later modify the skill scripts gai ...[truncated 1115 chars]- Remediation
View remediation
