T09 · Insecure Skill Coding Practices
- Location
janitor.js:271- Finding
Destructive cleanup executes by default without preview, confirmation, or explicit high-impact scope selection
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This cleanup skill is not exfiltrating data, but it can delete broad local, Docker, and system resources by default with too little user control.
Review before installing. Use only with explicit dry-run-first workflows, avoid running it as root, and scope commands with --only or --skip. The publisher should make preview mode the default, require an explicit apply flag for mutation, and gate Docker and system cleanup behind explicit user authorization.
janitor.js:271Destructive cleanup executes by default without preview, confirmation, or explicit high-impact scope selection
janitor.js:231PATH-based executable resolution permits command substitution, including during root cleanup
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
// 2) Regex protection (.env/.git)
{
const envPath = path.resolve('/tmp/project/.env');
const gitPath = path.resolve('/tmp/project/.git/config');
assert.strictEqual(isSafeToClean(envPath), false, '.env path must be blocked');
assert.strictEqual(isSafeToClean(gitPath), false, '.git path must be blocked');
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
{
const envPath = path.resolve('/tmp/project/.env');
const gitPath = path.resolve('/tmp/project/.git/config');
assert.strictEqual(isSafeToClean(envPath), false, '.env path must be blocked');
assert.strictEqual(isSafeToClean(gitPath), false, '.git path must be blocked');
}
The example trigger phrase "Clean up my disk" is broad, natural language that overlaps with common everyday requests. In an agent environment, this can cause the skill to activate too readily and initiate destructive or privacy-impacting cleanup actions, especially since the default example invokes the cleanup command without --dry-run.
The header states 'ZERO external dependencies. Must run on raw Node.js,' which implies the skill relies only on built-in Node.js functionality. However, later code uses child_process.execSync to invoke external binaries such as docker, npm, yarn, apt-get, brew, pip, and others, so the documentation actively contradicts the implementation.