Skip to content

fix: harden instructor portal against NoSQL injection - #16

Open
Abdelrahman21102 wants to merge 2 commits into
Advanced-Computer-Lab-2026:masterfrom
Abdelrahman21102:master
Open

Abdelrahman21102 wants to merge 2 commits into
Advanced-Computer-Lab-2026:masterfrom
Abdelrahman21102:master

Conversation

@Abdelrahman21102

Copy link
Copy Markdown
  • Add express-mongo-sanitize globally to strip $/dotted keys from body, query and params
  • Validate login and search input with Joi (plain strings only, allow-listed search params)
  • Hash instructor passwords with bcrypt (pre-save hook) and verify with bcrypt.compare
  • Mark password and apiKey as select: false; return only public fields from login and search
  • Escape user input before building the name search regex
  • Seed via Instructor.create() so passwords are hashed

Abdelrahman21102 and others added 2 commits November 7, 2026 13:31
- Add express-mongo-sanitize globally to strip $/dotted keys from body, query and params
- Validate login and search input with Joi (plain strings only, allow-listed search params)
- Hash instructor passwords with bcrypt (pre-save hook) and verify with bcrypt.compare
- Mark password and apiKey as select: false; return only public fields from login and search
- Escape user input before building the name search regex
- Seed via Instructor.create() so passwords are hashed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Add Jest/supertest suite for instructor portal injection attacks
- Add GitHub Actions workflow running server tests
- Remove AGENTS.md and CLAUDE.md, clean up README

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant