Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding new code for snyk code scan #1

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

adding new code for snyk code scan #1

wants to merge 6 commits into from

Conversation

snyk-kevin
Copy link
Owner

No description provided.

@snyk-kevin snyk-kevin closed this Feb 26, 2024
@snyk-kevin snyk-kevin reopened this Feb 26, 2024
@snyk-kevin snyk-kevin closed this Mar 8, 2024
@snyk-kevin snyk-kevin reopened this Mar 8, 2024
@snyk-kevin snyk-kevin closed this Apr 25, 2024
@snyk-kevin snyk-kevin reopened this Apr 25, 2024
@snyk-kevin snyk-kevin closed this Jun 3, 2024
@snyk-kevin snyk-kevin reopened this Jun 3, 2024
@snyk-kevin snyk-kevin closed this Jul 12, 2024
@snyk-kevin snyk-kevin reopened this Jul 12, 2024
@snyk-kevin snyk-kevin closed this Aug 14, 2024
@snyk-kevin snyk-kevin reopened this Aug 14, 2024
@snyk-kevin snyk-kevin closed this Sep 3, 2024
@snyk-kevin snyk-kevin reopened this Sep 3, 2024
@snyk-kevin
Copy link
Owner Author

snyk-kevin commented Sep 3, 2024

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

Icon Severity Issues
Critical 0
High 4
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. 4 issues have been found. (View Details)

@snyk-kevin snyk-kevin closed this Sep 18, 2024
@snyk-kevin snyk-kevin reopened this Sep 18, 2024
Repository owner deleted a comment from github-actions bot Sep 19, 2024
Repository owner deleted a comment from github-actions bot Sep 19, 2024
Repository owner deleted a comment from github-actions bot Sep 19, 2024
@snyk-kevin snyk-kevin closed this Oct 21, 2024
@snyk-kevin snyk-kevin reopened this Oct 21, 2024
Repository owner deleted a comment from github-actions bot Oct 21, 2024
@snyk-kevin snyk-kevin closed this Nov 21, 2024
@snyk-kevin snyk-kevin reopened this Nov 21, 2024
Repository owner deleted a comment from github-actions bot Feb 19, 2025
@snyk-kevin snyk-kevin closed this Feb 19, 2025
@snyk-kevin snyk-kevin reopened this Feb 19, 2025
return (req, res, next) => {
const id = req.body.id
const user = insecurity.authenticatedUsers.from(req)
db.reviews.findOne({ _id: id }).then(review => {
Copy link
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 findOne, where it is used in an NoSQL query. This may result in an NoSQL Injection vulnerability.

Line 15 | CWE-943 | Priority score 805 | Learn more about this vulnerability
Data flow: 8 steps

Step 1 - 4

const id = req.body.id

Step 5 - 8

db.reviews.findOne({ _id: id }).then(review => {

result => {
// Artificial wait for timing attack challenge
setTimeout(function () {
db.reviews.findOne({ _id: id }).then(review => {
Copy link
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 findOne, where it is used in an NoSQL query. This may result in an NoSQL Injection vulnerability.

Line 25 | CWE-943 | Priority score 805 | Learn more about this vulnerability
Data flow: 12 steps

Step 1 - 4

const id = req.body.id

Step 5 - 6 routes/delikeProductReviews.js#L15

Step 7 - 8 routes/delikeProductReviews.js#L19

Step 9 - 12

db.reviews.findOne({ _id: id }).then(review => {

db.reviews.findOne({ _id: id }).then(review => {
var likedBy = review.likedBy
if (!likedBy.includes(user.data.email)) {
db.reviews.update(
Copy link
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 update, where it is used in an NoSQL query. This may result in an NoSQL Injection vulnerability.

Line 18 | CWE-943 | Priority score 805 | Learn more about this vulnerability
Data flow: 10 steps

Step 1 - 4

const id = req.body.id

Step 5 - 6 routes/delikeProductReviews.js#L15

Step 7 - 9 routes/delikeProductReviews.js#L19

Step 10

db.reviews.update(

}
}
utils.solveIf(challenges.timingAttackChallenge, () => { return count > 2 })
db.reviews.update(
Copy link
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 update, where it is used in an NoSQL query. This may result in an NoSQL Injection vulnerability.

Line 35 | CWE-943 | Priority score 805 | Learn more about this vulnerability
Data flow: 14 steps

Step 1 - 4

const id = req.body.id

Step 5 - 6 routes/delikeProductReviews.js#L15

Step 7 - 8 routes/delikeProductReviews.js#L19

Step 9 - 10 routes/delikeProductReviews.js#L25

Step 11 - 13 routes/delikeProductReviews.js#L36

Step 14

db.reviews.update(

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