fix(registry): reject unsafe content slugs#2093
Conversation
|
Important Gittensory found maintainer review notesPublic GitHub metadata was checked for review readiness. Gittensor-specific context appears only when confirmed. Readiness score: 93/100
Signal definitions
Review context
Maintainer notes
Contributor next steps
Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers. Learn more about Gittensor contribution workflows. |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Warning Review limit reached
More reviews will be available in 6 minutes and 44 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
🔍 Maintainer advisory reviewReviewed 5 changed file(s) — two independent AI reviewers. This is an advisory review — it does not merge or close the PR. Suggested action: 🛠️ Request changes. Address the items below before merging. Reviewer A · Risks:
Suggestions:
Suggestions
Worth double-checking
Reviewer B · Suggestions
Worth double-checking
|
Motivation
slug(e.g.../../../../foo) to cause generated artifact writes outsideapps/web/public/datawhen the registry builder runs after merge.Description
SAFE_CONTENT_SLUG_PATTERNand reject frontmatter slugs that do not match the safe pattern invalidateEntryso traversal-style slugs fail content validation (packages/registry/src/content-schema.js).entry.slugin the registry artifact builder (packages/registry/src/artifacts.js).artifactOutputPath()that resolves artifact target paths and refuses to write files whose resolved path is outsideapps/web/public/data, and use it when writing generated artifacts (scripts/build-content-index.mjs).tests/content-validation.test.ts(tests/artifact-path-safety.test.ts, updatedtests/content-validation.test.ts).Testing
pnpm exec vitest run tests/artifact-path-safety.test.ts tests/content-validation.test.ts tests/classify-pr-changes.test.ts --reporter=dotand all included tests passed.pnpm validate:content:strict(which invokesnode scripts/validate-content.mjs --strict-recommended) and it completed successfully (Content validation passed.).node scripts/build-content-index.mjsto exercise artifact generation and confirmed artifact writes are blocked for unsafe slugs and normal generation succeeds for existing content.pnpm validate:packagesand package-level validations passed.pnpm test:registry-artifacts; 43/45 tests passed while 2 long-running artifact tests hit the per-test timeout in this environment (timeouts observed during this run).Codex Task