T09 · Insecure Skill Coding Practices
- Location
scripts/clean_linux.py:31- Finding
Documented File-Age Safety Restriction Is Not Enforced
- Content
View full analysis
- Remediation
View remediation
= MIN_AGE_SECONDS except OSError: return False ``` 2. Evaluate each file independently. Do not recursively remove a directory merely because the directory itself appears old. 3. Remove a directory only after all eligible descendants have been processed and the directory is empty. 4. Resolve and validate every configured root against an immutable allowlist before deletion. 5. Use `lstat()` or equivalent non-following operations when handling symlinks. 6. Default to skipping a candidate whenever its age, type, resolved location, or ownership cannot be verified. 7. Add automated tests covering newly created files, mixed-age directory trees, symlinks, permission failures, and elevated execution. ]]>
