fix(analyzers): HIGH SC8 when skill ships __pycache__ or .pyc - #357
Conversation
Close the silent bytecode skip described in NVIDIA#356: discovery excludes __pycache__ and treats .pyc as binary, so presence alone must fail the score even before full disassembly exists. Signed-off-by: Alex J Lennon <ajlennon@dynamicdevices.co.uk> Co-authored-by: Cursor <cursoragent@cursor.com>
|
Like you mentioned, I think this solution is not comprehensive enough (we still skip node_modules, git files, etc) and need a more agnostic solution |
rng1995
left a comment
There was a problem hiding this comment.
[Automated SkillSpector Review]
Requesting changes. SC8 detects the files, but it does not deliver the claimed fail-closed behavior: one .pyc scores 23 (MEDIUM / CAUTION) and the CLI exits 0; per-rule scoring caps three SC8 occurrences at 41. Add explicit blocking semantics and an end-to-end verdict/exit regression. Also run and commit Ruff formatting; ruff format --check fails on the touched analyzer file.
|
An explicit acceptance criterion for bytecode-poisoning scenario: shipped .pyc, .pyo, or pycache content must produce an explicit SC8 finding and must not complete as a passing or SAFE scan. |
Signed-off-by: Narendran Raghavan <nraghavan@nvidia.com>
Summary
Closes the silent bytecode skip in #356:
__pycache__is excluded from discovery and.pycis treated as binary, so a skill can ship decoy sources plus malicious bytecode and still score SAFE.This adds SC8 (Shipped Python Bytecode) — a HIGH finding whenever
__pycache__/or*.pyc/*.pyois present under the skill tree (still skipping.git/node_modules/ venvs). Presence alone is enough to fail closed; full.pycdisassembly can follow later.Test plan
uv run --with pytest pytest tests/nodes/analyzers/test_sc8_shipped_bytecode.py -q(2 passed)uv run ruff checkon touched filesAI disclosure
This pull request was AI-assisted (Cursor) on behalf of Alex Lennon, with human review before open.
Fixes #356
Made with Cursor