T09 · Insecure Skill Coding Practices
Error
- Location
scripts/cleanup-zombie-browsers.sh:38- Finding
User-Controlled Filters Can Broaden Destructive Browser Process Termination
- Content
View full analysis
/dev/null)" || continue if [[ "$verify_cmdline" != *"$OPENCLAW_BROWSER_PATTERN"* ]]; then log "SKIP PID $pid: re-verification failed (cmdline changed)" continue fi fi # Count child processes that will also be terminated child_count=0 if [[ "$OS" == "linux" ]]; then child_count=$(grep -r "PPid:.*$pid" /proc ...[truncated 3832 chars]- Remediation
View remediation
&2 exit 2 } [[ "$GRACE_PERIOD_SECONDS" =~ ^[0-9]+$ ]] || { echo "Invalid --grace value" >&2 exit 2 } ``` Destructive mode should enforce a reasonable nonzero minimum age unless an explicitly named unsafe override is separately confirmed. 4. **Revalidate every safety property immediately before signaling.** Confirm current ownership, executable identity, canonical user-data directory, PPID/orphan state, minimum age, and process start time. 5. **Defend against PID reuse.** Record the process start time during discovery and compare it with the start time immediately before each signal. 6. **Avoid signaling unchecked process groups.** Signal only the verified candidate PID and descendants that have been independently enumerated and validated. If process-group signaling remains necessary, verify every group member first and abort when an unrelated member is present. 7. **Apply the same checks before SIGKILL.** Repeat identity and ownership validation after the grace period so that a changed or reused PID is not forcefully terminated. 8. **Update documentation and help text.** Clearly state the risks of any safety-control overrides, or remove `--pattern` from the public interface entirely. ]]>
