Skip to content

add bad code#72

Open
snyk-rfrazier wants to merge 3 commits into
mainfrom
bad_code_20250730
Open

add bad code#72
snyk-rfrazier wants to merge 3 commits into
mainfrom
bad_code_20250730

Conversation

@snyk-rfrazier

Copy link
Copy Markdown
Owner

No description provided.

@snyk-rfrazier

snyk-rfrazier commented Jul 30, 2025

Copy link
Copy Markdown
Owner Author

Snyk checks have failed. 1 issues have been found so far.

Icon Severity Issues
Critical 0
High 1
Medium 0
Low 0

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

code/snyk check is complete. 1 issues have been found. (View Details)

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

Comment thread routes/index.js
Comment thread routes/index.js
Comment thread routes/index.js
Comment thread routes/index.js
Comment thread routes/index.js
Comment thread routes/index.js
Comment thread routes/index.js
Comment thread routes/index.js
Comment thread routes/index.js Outdated
Comment thread routes/index.js

exports.loginHandler = function (req, res, next) {
if (validator.isEmail(req.body.username)) {
User.find({ username: req.body.username, password: req.body.password }, function (err, users) {

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  NoSQL Injection

Unsanitized input from the HTTP request body flows into find, where it is used in an NoSQL query. This may result in an NoSQL Injection vulnerability.

Line 39 | CWE-943 | Priority score 765 | Learn more about this vulnerability
Data flow: 7 steps

Step 1 - 4

if (validator.isEmail(req.body.username)) {

Step 5 - 7

User.find({ username: req.body.username, password: req.body.password }, function (err, users) {

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.

2 participants