fix: address remaining audit findings (major, medium, minor) - #2
Open
Alithiel31 wants to merge 1 commit into
Open
fix: address remaining audit findings (major, medium, minor)#2Alithiel31 wants to merge 1 commit into
Alithiel31 wants to merge 1 commit into
Conversation
Security & correctness: - Sanitize markdown-rendered course content after HTML conversion instead of before, closing an XSS gap (marked output was never sanitized) - Fix RBAC bug where requireSelfOrAdmin compared role to role.admin (always undefined) instead of ROLES.ADMIN - Harden the avatar upload middleware: random filenames instead of predictable Date.now(), strict mimetype/extension whitelist CI & tooling: - Replace the lint workflow's fix+auto-commit-to-main steps with a single blocking `npm run lint` check per package - Fix a pre-existing schema mismatch in a test that made the register endpoint's mocked-500 test return 400/409 instead - Fix pre-existing test fixtures using a stale `role` field instead of `roleId`, which didn't match the current Prisma schema Code quality: - Split the 1625-line seeding.ts into per-entity data modules under models/seed-data/, seeding.ts is now a thin orchestrator - Route console.info calls in the global error handler and a swallowed refresh-token error through the shared logger - Add Zod validation to forgotPassword's email input - Remove empty residual files (package.json.fixed, create_table.sql) - Remove 2.4MB of confirmed-orphaned design assets from docs/ Docs & metadata: - Replace the client's default `sv create` README with project- specific instructions - Add CC BY-NC 4.0 LICENSE and align license fields in both package.json files - Tighten .env.example's ALLOWED_ORIGINS example and .gitignore's secret-file patterns Tests: - Add regression tests for the two fixes above (role escalation via PATCH /users/:id, requireSelfOrAdmin's admin bypass) Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016RRHCP6bHMtmTEmcNFwe4D
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Security & correctness:
CI & tooling:
npm run lintcheck per packagerolefield instead ofroleId, which didn't match the current Prisma schemaCode quality:
Docs & metadata:
sv createREADME with project- specific instructionsTests:
Claude-Session: https://claude.ai/code/session_016RRHCP6bHMtmTEmcNFwe4D