📌 Description
The router in src/app/App.tsx passes untrusted path params (:slug, :projectId, :issueId, :ecosystemId, :eventId) straight into detail pages via routeWrappers.tsx, which only null-checks presence. A malformed projectId is then interpolated directly into API endpoints like /projects/${projectId}. Add lightweight param-shape validation (allowed charset/length) in the wrappers so obviously invalid params render the NotFound/empty state instead of issuing a doomed request.
💡 Why it matters: Forwarding arbitrary path segments into API URLs wastes requests and can be abused to probe the backend.
🧩 Requirements and context
- Define a small validator for id/slug params (e.g. UUID-ish or
[a-z0-9-] bounded length).
- Validate in
ProjectDetailPageRoute, IssueDetailPageRoute, EcosystemDetailPageRoute, and the blog :slug path.
- Render the existing not-found/empty state for invalid params rather than fetching.
- Keep the existing presence null-guards.
- Test valid and malformed params per wrapper.
Non-functional requirements
- Must be secure, tested, and documented.
- Should be efficient and easy to review.
🛠️ Suggested execution
1. Fork the repo and create a branch
git checkout -b security/validate-route-params
2. Implement changes
- Write/modify the relevant source:
src/features/dashboard/routeWrappers.tsx (+ blog article page)
- Write comprehensive tests:
routeWrappers.test.tsx
- Add documentation: inline TSDoc on the validator
- Include TSDoc doc comments
- Validate security assumptions: params constrained before URL interpolation
3. Test and commit
npm test -- routeWrappers
- Cover edge cases: empty, overly long, path-traversal-like, encoded params
- Include test output and security notes in the PR description.
Example commit message
security(routing): validate route params before detail fetches
✅ Acceptance criteria
🔒 Security notes
Reject path-traversal (.., /) and encoded variants before they reach apiRequest.
📋 Guidelines
- Minimum 95% test coverage
- Clear documentation
- Timeframe: 96 hours
📌 Description
The router in
src/app/App.tsxpasses untrusted path params (:slug,:projectId,:issueId,:ecosystemId,:eventId) straight into detail pages viarouteWrappers.tsx, which only null-checks presence. A malformedprojectIdis then interpolated directly into API endpoints like/projects/${projectId}. Add lightweight param-shape validation (allowed charset/length) in the wrappers so obviously invalid params render the NotFound/empty state instead of issuing a doomed request.🧩 Requirements and context
[a-z0-9-]bounded length).ProjectDetailPageRoute,IssueDetailPageRoute,EcosystemDetailPageRoute, and the blog:slugpath.Non-functional requirements
🛠️ Suggested execution
1. Fork the repo and create a branch
2. Implement changes
src/features/dashboard/routeWrappers.tsx(+ blog article page)routeWrappers.test.tsx3. Test and commit
npm test -- routeWrappersExample commit message
✅ Acceptance criteria
🔒 Security notes
Reject path-traversal (
..,/) and encoded variants before they reachapiRequest.📋 Guidelines