Skip to content

Conversation

@saranshsinhaa
Copy link
Member

@saranshsinhaa saranshsinhaa commented Oct 22, 2024

Fixes https://github.com/SRM-IST-KTR/githubsrmv2/security/code-scanning/1

Fixes #99

To fix the problem, we need to ensure that the email value is treated as a literal value and not as a query object. This can be achieved by using MongoDB's $eq operator, which ensures that the value is interpreted as a literal string. Additionally, we should validate that the email is a string before using it in the query.

…led sources

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@vercel
Copy link
Contributor

vercel bot commented Oct 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
githubsrmv2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 22, 2024 2:52pm

@saranshsinhaa saranshsinhaa marked this pull request as ready for review October 22, 2024 14:52
@saranshsinhaa saranshsinhaa self-assigned this Oct 22, 2024
@saranshsinhaa saranshsinhaa added bug The UI needs some changes Fixed Bug fixed security-fix labels Oct 22, 2024
@saranshsinhaa
Copy link
Member Author

@djdiptayan1 @StarlyHere Verify Functionality first then merge

@UtkarshJaiswal1406
Copy link
Contributor

this works. its preventing nosql injection as its supposed to

@saranshsinhaa
Copy link
Member Author

@SRM-IST-KTR/code_review @SRM-IST-KTR/team25-26

Bumping for relevance check, close or merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug The UI needs some changes Fixed Bug fixed security-fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix code scanning alert - Database query built from user-controlled sources

3 participants