test(content): add regression fixtures for unsafe hook script patterns#461
test(content): add regression fixtures for unsafe hook script patterns#461Kelvinchen03 wants to merge 4 commits into
Conversation
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (13)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Signed-off-by: Kelvinchen03 <Kelvinchen03@outlook.com>
JSONbored
left a comment
There was a problem hiding this comment.
Thanks for working on this, but I don’t think this PR satisfies #435 in its current form. The issue asked for deterministic regression tests where vulnerable fixtures fail for the intended reason and safe fixtures pass. The added tests mostly check that fixture files exist and contain certain strings, so they do not exercise the real validation path or prove the policy catches unsafe hook bodies. CI is also failing in registry/web/Raycast validation, including the new Hook script assertion. I’d close this version and ask for a smaller rewrite that adds real validator-backed fixture tests without generated artifact churn.
Pull Request
Summary
Adds security regression fixtures for hook script bodies as requested in Issue #435. Created 10 test fixtures (5 vulnerable + 5 safe) under
tests/fixtures/hooks/demonstrating common hook security patterns, plus comprehensive tests intests/content-validation.test.ts(new),tests/registry-artifacts.test.ts, andtests/submission-workflows.test.tsthat validate hook submissions against security vulnerabilities without executing untrusted code.Submission Source
tests/fixtures/hooks/submittedByandsubmittedByUrlfrontmatter matching the PR author.README.md, generated registry outputs, orapps/web/public/downloads/**unless this is a maintainer/internal automation branch./downloads/...package hosting for community-submitted ZIP/MCPB artifacts.Schema and Quality Checks
pnpm validate:contentpassedpnpm validate:packagespassedpnpm scan:packagespassed when package artifacts changedpnpm audit:contentran and I reviewed findingsviewCount,copyCount,popularityScore)skillType,skillLevel,verificationStatus,verifiedAt,retrievalSources,testedPlatforms)Validation
pnpm build)Notes
All 19 tests added for Issue #435 pass successfully. The 5 pre-existing test failures in the output (Windows path separators, line endings, etc.) are unrelated to this PR and predate these changes. Closes #435.