T09 · Insecure Skill Coding Practices
- Location
scripts/backup-generator.sh:35- Finding
Unvalidated backup parameters enable generated-script and cron command injection
- Content
View full analysis
/dev/null | grep -v "$SCRIPT_PATH"; echo "$SCHEDULE $SCRIPT_PATH >> ${LOG_FILE} 2>&1") | crontab - echo -e "${GREEN}[✓]${NC} cron 任务已添加" fi ``` ### Technical Analysis The generator accepts backup type, target, destination, schedule, retention, output directory, and notification type as arbitrary strings. Several values are interpolated directly into executable shell source inside double-quoted assignments. Embedded quotes, command substitutions, shell metacharacters, or newline characters can break out of the intended assignment and add commands to the generated backup script. The cron schedule and generated script path are also inserted directly into crontab text. In particular, a newline in `SCHEDULE` or `SCRIPT_PATH` can create an additional cron entry. The resulting payload persists and is executed by cron with the privileges of the user wh ...[truncated 1234 chars]- Remediation
View remediation
