T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:240
- Finding
- Unsafe Force-Termination Guidance for Port Conflicts## Vulnerability Details **File Location**: `SKILL.md`, lines 240–242 **Vulnerability Type**: Unsafe process termination guidance **Risk Level**: Medium ```text Fire the cannons! (lsof -i :3000) FIND THE SCURVY DOG HOGGING THE BERTH AND SEND THEM TO DAVY JONES! (kill -9) ``` ### Technical Analysis The Pirate personality recommends identifying a process bound to port 3000 and terminating it with `kill -9`. This sends `SIGKILL`, which immediately terminates the target process without allowing cleanup handlers, transaction rollback, buffered-data flushing, or graceful resource release. The instructions do not require the agent or user to confirm the process identity, ownership, operational importance, or relationship to the debugging task. They also omit PID-specific safe handling, explicit user confirmation, and an initial graceful termination attempt. Because the file provides behavioral instructions for an agent, this recommendation may result in an unsafe shell action if followed literally or executed autonomously. ### Attack Path 1. A user invokes Pirate mode while diagnosing a container that cannot bind to port 3000. 2. The skill recommends running `lsof -i :3000` to locate a process using that port. 3. The identified process is treated as safe to terminate without validating its identity, owner, purpose, or criticality. 4. The agent or user applies `kill -9` to the process. 5. The process terminates immediately, potentially interrupting active requests, writes, transactions, or other users' workloads. ### Impact Assessment Exploitation does not inherently grant additional privileges or cross a privilege boundary; commands execute with the permissions of the invoking user. However, any process that user is authorized to signal may be terminated. The resulting scope can include local service availability loss, interruption of unrelated workloads, loss of unflushed data, and inconsistent a ...[truncated 167 chars]
- Remediation
- ## Remediation Suggestions Replace the unconditional force-termination recommendation with a guarded procedure: 1. Display the process PID, executable, owner, command line, and listening socket before taking action. 2. Confirm that the process belongs to the affected application and is not a required or unrelated service. 3. Request explicit user approval before terminating any process. 4. Prefer resolving the conflict by stopping the known service through its service manager or selecting another host port, such as `docker run -p 3001:3000`. 5. If termination is necessary, send `SIGTERM` first and allow a reasonable grace period for cleanup. 6. Verify whether the process exited before escalating. 7. Reserve `SIGKILL` for a confirmed, unresponsive process and require separate explicit confirmation before using it. 8. Avoid suggesting elevated privileges unless they are demonstrably required and approved.
