Merge updates from upstream and integrate local security report optimizations - #163
Merge updates from upstream and integrate local security report optimizations#163hbui290 wants to merge 8 commits into
Conversation
… pre-filtering, and bug fixes
… of substring match
… in optimization test
rng1995
left a comment
There was a problem hiding this comment.
Verdict: Request changes (strong) — a 19-file upstream-merge grab-bag with some genuinely good ideas (SQLite cache, block-aware chunking, retry/backoff), but several blocking problems including a fail-open detection regression.
Blocking
- Detection-coverage regression (fail-open).
_SKIP_DIRSinsrc/skillspector/nodes/build_context.pyis expanded to includedocs,doc,tests,test,spec,specs,build,dist,out,target,images,media,brand(~L775-808), now matched against the relative path (~L884). A malicious skill can hide a payload in e.g.tests/ordocs/and evade scanning entirely. For a security scanner this is a serious regression — these must not be skipped by default. (The bundledBAO_CAO_TOI_UU_HOA.mdeven frames this as fixing a "file omission" bug, but the net effect is more directories silently skipped.) - Committed personal/local artifacts.
BAO_CAO_TOI_UU_HOA.mdandHUONG_DAN_SU_DUNG.mdare non-project docs containing dev-machine absolute paths (file:///Users/winston/.gemini/antigravity-ide/scratch/SkillSpector/...). These should not land in the repo. load_dotenv()at package import insrc/skillspector/__init__.py(~L135-136): an import-time side effect that auto-loads.envfrom CWD. Risky for a tool run against untrusted skill directories — it could ingest a scanned skill's.env. Move it behind the CLI entrypoint, not package import.- Production code detecting test mocks.
LLMAnalyzerBase._original_run_batches = LLMAnalyzerBase.run_batches(llm_analyzer_base.py~L673) plus theis_patchedmock-introspection branch insemantic_security_discovery.py(~L730-756) couple prod behavior to the test harness — a code smell that can mask real regressions. - Scope / conflicts. Bundles unrelated changes and overlaps/conflicts with #157 (binary skip), #159/#164/#116 (zip-slip/ingest,
_download_file/_extract_zip), and #142/#153/#122 (_compute_risk_score/ scoring +report.py). Please split into focused PRs and rebase.
The good ideas (persistent SQLite cache, smarter chunk_file_by_lines, deterministic finding ordering, retry/backoff) are worth landing — just on their own focused PRs and without the _SKIP_DIRS expansion, the committed local docs, and the import-time load_dotenv().
rng1995
left a comment
There was a problem hiding this comment.
[Automated SkillSpector Review]
Changes requested. This 19-file merge bundle introduces multiple blocking security and maintainability regressions:
- The expanded file exclusions skip
docs,tests,spec, build/output directories, gitignored files, and lockfiles. A malicious skill can place executable or instruction payloads under those ordinary names and evade analysis entirely. Restore security-oriented traversal that scans untrusted content by default; exclusions must be narrowly justified and tested against bypasses. - Package import calls
load_dotenv()against the process working directory. When SkillSpector runs on untrusted input, importing the package can ingest attacker-controlled environment values. Load configuration only at an explicit trusted CLI boundary. - Remove the two personal/local documentation artifacts containing developer-machine
file:///Users/...links. - Remove production behavior that introspects whether
run_batcheswas replaced by test mocks. Production execution must not branch on test-harness patching. - Split and rebase the unrelated cache, archive handling, AST, scoring, traversal, and LLM changes. The current head is reported as conflicted and is too broad to validate as one security-sensitive change.
These blockers remain present at the current head; GitHub reports no completed check runs.
| ".github", | ||
| ".idea", | ||
| ".settings", | ||
| "docs", |
There was a problem hiding this comment.
This exclusion creates a fail-open scanner: untrusted skills can place executable code or hidden model instructions under docs/, tests/, spec/, or the other newly skipped directories and evade every downstream analyzer. Keep traversal inclusive by default and add regression tests proving payloads in ordinary nested directories remain scanned.
| """Skillspector v2 LangGraph workflow package.""" | ||
|
|
||
| from dotenv import load_dotenv | ||
| load_dotenv() |
There was a problem hiding this comment.
Do not load .env during package import. Because the scanner can be launched from or against an untrusted skill directory, this can ingest attacker-controlled provider, endpoint, or credential-related values before input validation. Move dotenv loading to an explicit trusted CLI startup path.
|
@hbui290 - Please address review comments and resolve merge conflicts. |
This Pull Request merges the upstream changes from NVIDIA/SkillSpector into the codebase and integrates custom enhancements:
All 725+ tests pass successfully.