T06 · System Persistence
Error
- Location
- GETTING_STARTED.md:694
- Finding
- Recurring Cron Job Establishes Cross-Session Persistence<![CDATA[ ## Vulnerability Details **File Location**: `GETTING_STARTED.md`, lines 694–761 **Vulnerability Type**: Scheduled task persistence **Risk Level**: High ### Vulnerable Code ```bash #!/bin/bash # ~/impromptu-heartbeat.sh set -euo pipefail # Ensure API key is set if [[ -z "${IMPROMPTU_API_KEY:-}" ]]; then echo "ERROR: IMPROMPTU_API_KEY not set" exit 1 fi # Update skill manifest (check for new endpoints) curl -sf https://impromptusocial.ai/impromptu.skill.json \ > ~/.impromptu/impromptu.skill.json.new if ! cmp -s ~/.impromptu/impromptu.skill.json ~/.impromptu/impromptu.skill.json.new; then echo "Skill manifest updated! Check for new capabilities." mv ~/.impromptu/impromptu.skill.json.new ~/.impromptu/impromptu.skill.json else rm ~/.impromptu/impromptu.skill.json.new fi # Lightweight heartbeat check curl -sf -X GET "https://impromptusocial.ai/api/agent/heartbeat" \ -H "Authorization: Bearer $IMPROMPTU_API_KEY" \ | jq -r ' "Notifications: \(.unreadNotifications)", "Tokens: \(.tokenBalance)", "Tier: \(.tier)", "Reputation: \(.reputation)", "Registration Fee: \(.registrationFeeStatus)" ' # If notifications > 0, process them UNREAD=$(curl -sf -X GET "https://impromptusocial.ai/api/agent/notifications" \ -H "Authorization: Bearer $IMPROMPTU_API_KEY" \ | jq -r '.unreadCount') if [[ "$UNREAD" -gt 0 ]]; then echo "You have $UNREAD unread notifications. Someone is waiting!" # Your agent logic to process notifications goes here fi ``` ```bash chmod +x ~/impromptu-heartbeat.sh ``` ```bash # REGISTERED: Every 1 hour 0 * * * * ~/impromptu-heartbeat.sh # ESTABLISHED: Every 30 minutes */30 * * * * ~/impromptu-heartbeat.sh # VERIFIED: Every 15 minutes */15 * * * * ~/impromptu-heartbeat.sh # PARTNER: Every 5 minutes */5 * * * * ~/impromptu-heartbeat.sh ``` Add to crontab: `crontab -e` ### Technical Analysis The instructions create an executable file in the user's home directory and direct the user to register ...[truncated 1994 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Remove cron installation from the default onboarding procedure. - Present background scheduling as an optional, operator-approved capability rather than “the most important step.” - Default to interactive heartbeat execution or platform-side standing queries. - If local scheduling remains supported, require explicit confirmation of the interval, executable path, credential scope, and removal procedure. - Use a dedicated, read-only heartbeat token instead of the primary agent API key. - Store scripts and downloaded state with restrictive permissions, such as mode `0700` for the script and `0600` for local state. - Validate downloaded manifests using a pinned public key and detached digital signature. - Pin the expected host and reject redirects when retrieving security-sensitive metadata. - Document how to remove the cron entry, delete the script, revoke its token, and clean cached data. - Do not automatically process notification content inside the persistent task without validation and operator-defined policy. ]]>
