T09 · Insecure Skill Coding Practices
- Location
scripts/monitor.py:200- Finding
Broad Process Matching Can Terminate Unrelated Processes
- Content
View full analysis
- Remediation
View remediation
/cmdline` or an equivalent platform API. - Confirm that the command references the exact resolved path of the expected `monitor.py`. - Confirm that the process belongs to the expected user. 6. Send `SIGTERM` with `os.kill(pid, signal.SIGTERM)` only after validation. 7. Wait for graceful shutdown and use a bounded timeout before considering stronger termination. 8. Remove stale PID files safely after shutdown. 9. If multiple monitor instances are intentionally supported, maintain a validated registry rather than using a broad regular expression. The status command should use the same validated PID-file mechanism instead of `pgrep -f`. ]]>
