Skip to content

Adding bad code#65

Open
snyk-rfrazier wants to merge 1 commit into
mainfrom
adding_bad_code_1
Open

Adding bad code#65
snyk-rfrazier wants to merge 1 commit into
mainfrom
adding_bad_code_1

Conversation

@snyk-rfrazier

Copy link
Copy Markdown
Owner

No description provided.

@snyk-rfrazier

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

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 805 | 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.

1 participant