mirror of
https://github.com/trailofbits/skills-curated
synced 2026-06-21 14:12:04 +00:00
86b054f3e9
* Add deterministic security scanner for imported plugins Scans plugin directories for external network access (URLs, curl, Python network imports), unicode tricks (bidi overrides, zero-width chars, homoglyphs in code, punycode domains), and destructive operations (rm -rf, force push, chmod 777). BLOCK findings fail CI; WARN findings surface for human review. - scripts/scan_plugin.py: zero-dependency stdlib scanner (~440 lines) - .github/workflows/security-scan.yml: CI workflow running on push/PR - plugins/skill-importer/commands/import-skill.md: insert scan as Step 17 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: resolve code review findings for PR #6 - Fix fence marker length bug: store full fence length so 4-backtick fences aren't closed by 3-backtick lines - Fix CI always failing: use distinct exit codes (0=clean, 1=usage, 2=BLOCK, 3=WARN) and allow WARN to pass in CI - Fix double PUNYCODE_RE.search: capture match once, remove type: ignore - Fix silent error swallowing: warn on stderr for unreadable files - Use Literal type for Finding.level instead of bare str - Add line.isascii() fast-path to skip unicode checks on ASCII lines - Precompute frozenset of code lines for O(1) lookup instead of O(R) - Detect rm -Rf (capital R) and rm --recursive --force - Extract _discover_plugins and _read_file_text helpers from main - Pass precomputed suffix string instead of Path objects to check fns - Add docstrings to all public and non-trivial functions - Add summary line to stderr output Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Add 7 security check categories to plugin scanner New detections: code execution (pipe-to-shell, eval/exec, subprocess), credential access, encoded payloads, privilege escalation, and compiled bytecode (.pyc/__pycache__). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Convert security scanner from CI gate to PR comment Surface findings as an idempotent PR comment instead of failing CI, so reviewers can see them inline and merge at their discretion. - Add --format=markdown output mode to scan_plugin.py (argparse CLI) - Post/update a single comment using <!-- security-scan --> marker - Auto-trigger only when plugins/ files change (gh API path check) - Manual trigger via 'security-scan' label on any PR Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>