T06 · System Persistence
Error
- Location
- install.sh:148
- Finding
- Installer Automatically Establishes User-Level Cron Persistence<![CDATA[ ## Vulnerability Details **File Location**: `install.sh:148-174` **Vulnerability Type**: Automatic scheduled-task persistence **Risk Level**: High ### Complete Vulnerable Code ```bash # Setup cron job setup_cron() { log_info "Setting up cron job..." if ! command -v crontab &> /dev/null; then log_warning "crontab not available. Skipping cron setup." log_info "You can manually add the following line to your crontab:" echo " ${CRON_TIME} * * * python3 ${SCRIPT_DIR}/scripts/daily_literature_search.py >> ${SCRIPT_DIR}/logs/cron.log 2>&1" return fi # Create cron entry CRON_ENTRY="${CRON_TIME} * * * python3 ${SCRIPT_DIR}/scripts/daily_literature_search.py >> ${SCRIPT_DIR}/logs/cron.log 2>&1" if [ "$UNINSTALL" = true ]; then # Remove existing cron entry (crontab -l 2>/dev/null | grep -v "daily_literature_search.py") | crontab - log_success "Cron job removed." else # Add cron entry (avoid duplicates) TEMP_CRON=$(mktemp) crontab -l 2>/dev/null | grep -v "daily_literature_search.py" > "$TEMP_CRON" || true echo "$CRON_ENTRY" >> "$TEMP_CRON" run_or_dry "crontab $TEMP_CRON" rm -f "$TEMP_CRON" log_success "Cron job installed: Daily search at ${CRON_TIME// /:}" fi } ``` The behavior is also disclosed in `README.md:42-49` and `SKILL.md:101-108`. ### Technical Analysis The default installation process modifies the current user's crontab and schedules the project script to execute every day. This behavior persists across terminal sessions, user logins, and individual skill invocations. Daily scheduling is related to the declared literature-monitoring functionality and is documented rather than concealed. Nevertheless, persistent execution is not necessary for installation or manual operation. Installing it automatically, without a dedicated opt-in flag or confirmation prompt, exceeds the minimum privileges ...[truncated 1405 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Do not install a cron entry during the default installation path. 2. Require an explicit option such as: ```bash ./install.sh --enable-cron ``` 3. Before modifying the crontab, display the exact entry and request affirmative user confirmation. 4. Add a unique marker to the managed entry: ```cron # daily-literature-managed-entry 30 6 * * * /usr/bin/python3 /absolute/path/scripts/daily_literature_search.py ``` 5. During uninstallation, remove only the uniquely marked entry instead of filtering every line containing the script name. 6. Verify that the project directory and executable modules are not writable by untrusted users. 7. Use absolute paths for Python, the configuration file, and log destinations. 8. Document how to inspect, disable, and remove the scheduled task. ]]>
