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

Code Security Report: 11 high severity findings, 16 total findings #18

Open
1 task
mend-for-github-com bot opened this issue Nov 7, 2023 · 0 comments
Open
1 task
Labels
Mend: code security findings Code security findings detected by Mend

Comments

@mend-for-github-com
Copy link
Contributor

mend-for-github-com bot commented Nov 7, 2023

Code Security Report

Scan Metadata

Latest Scan: 2024-03-05 02:41am
Total Findings: 16 | New Findings: 16 | Resolved Findings: 16
Tested Project Files: 50
Detected Programming Languages: 1 (JavaScript / TypeScript*)

  • Check this box to manually trigger a scan

Most Relevant Findings

The list below presents the 10 most relevant findings that need your attention. To view information on the remaining findings, navigate to the Mend Application.

SeverityVulnerability TypeCWEFileData FlowsDate
HighCode Injection

CWE-94

contributions.js:33

12024-03-05 02:41am
Vulnerable Code

this.handleContributionsUpdate = (req, res, next) => {
/*jslint evil: true */
// Insecure use of eval() to parse inputs
const preTax = eval(req.body.preTax);
const afterTax = eval(req.body.afterTax);

1 Data Flow/s detected

app.post("/contributions", isLoggedIn, contributionsHandler.handleContributionsUpdate);

this.handleContributionsUpdate = (req, res, next) => {

const afterTax = eval(req.body.afterTax);

 
HighCode Injection

CWE-94

contributions.js:32

12024-03-05 02:41am
Vulnerable Code

this.handleContributionsUpdate = (req, res, next) => {
/*jslint evil: true */
// Insecure use of eval() to parse inputs
const preTax = eval(req.body.preTax);

1 Data Flow/s detected

app.post("/contributions", isLoggedIn, contributionsHandler.handleContributionsUpdate);

this.handleContributionsUpdate = (req, res, next) => {

const preTax = eval(req.body.preTax);

 
HighCode Injection

CWE-94

error.js:10

12024-03-05 02:41am
Vulnerable Code

"use strict";
console.error(err.message);
console.error(err.stack);
res.status(500);
res.render("error-template", {

1 Data Flow/s detected

app.use(ErrorHandler);

const errorHandler = (err, req, res,next) => {

error: err

res.render("error-template", {

 
HighCode Injection

CWE-94

profile.js:65

72024-03-05 02:41am
Vulnerable Code

// Allow only numbers with a suffix of the letter #, for example: 'XXXXXX#'
const testComplyWithRequirements = regexPattern.test(bankRouting);
// if the regex test fails we do not allow saving
if (testComplyWithRequirements !== true) {
const firstNameSafeString = firstName
return res.render("profile", {

7 Data Flow/s detected
View Data Flow 1

app.post("/profile", isLoggedIn, profileHandler.handleProfileUpdate);

this.handleProfileUpdate = (req, res, next) => {

return res.render("profile", {

View Data Flow 2

app.post("/profile", isLoggedIn, profileHandler.handleProfileUpdate);

this.handleProfileUpdate = (req, res, next) => {

return res.render("profile", {

View Data Flow 3

app.post("/profile", isLoggedIn, profileHandler.handleProfileUpdate);

this.handleProfileUpdate = (req, res, next) => {

return res.render("profile", {

View more Data Flows

 
HighCode Injection

CWE-94

contributions.js:34

12024-03-05 02:41am
Vulnerable Code

/*jslint evil: true */
// Insecure use of eval() to parse inputs
const preTax = eval(req.body.preTax);
const afterTax = eval(req.body.afterTax);
const roth = eval(req.body.roth);

1 Data Flow/s detected

app.post("/contributions", isLoggedIn, contributionsHandler.handleContributionsUpdate);

this.handleContributionsUpdate = (req, res, next) => {

const roth = eval(req.body.roth);

 
HighPath/Directory Traversal

CWE-22

index.js:88

12024-03-05 02:41am
Vulnerable Code

app.get("/tutorial/:page", (req, res) => {
const {
page
} = req.params
return res.render(`tutorial/${page}`, {

1 Data Flow/s detected

app.get("/tutorial/:page", (req, res) => {

return res.render(`tutorial/${page}`, {

 
HighNoSQL Injection

CWE-943

user-dao.js:91

12024-03-05 02:41am
Vulnerable Code

noSuchUserError.noSuchUser = true;
callback(noSuchUserError, null);
}
}
usersCol.findOne({

1 Data Flow/s detected

app.post("/login", sessionHandler.handleLoginRequest);

this.handleLoginRequest = (req, res, next) => {

userDAO.validateLogin(userName, password, (err, user) => {

this.validateLogin = (userName, password, callback) => {

userName: userName

usersCol.findOne({

 
HighNoSQL Injection

CWE-943

memos-dao.js:23

12024-03-05 02:41am
Vulnerable Code

const memos = {
memo,
timestamp: new Date()
};
memosCol.insert(memos, (err, result) => !err ? callback(null, result) : callback(err, null));

1 Data Flow/s detected

app.post("/memos", isLoggedIn, memosHandler.addMemos);

this.addMemos = (req, res, next) => {

memosDAO.insert(req.body.memo, (err, docs) => {

this.insert = (memo, callback) => {

memosCol.insert(memos, (err, result) => !err ? callback(null, result) : callback(err, null));

 
HighServer Side Request Forgery

CWE-918

research.js:16

12024-03-05 02:41am
Vulnerable Code

this.displayResearch = (req, res) => {
if (req.query.symbol) {
const url = req.query.url + req.query.symbol;
return needle.get(url, (error, newResponse, body) => {

1 Data Flow/s detected

app.get("/research", isLoggedIn, researchHandler.displayResearch);

this.displayResearch = (req, res) => {

const url = req.query.url + req.query.symbol;

return needle.get(url, (error, newResponse, body) => {

 
HighNoSQL Injection

CWE-943

user-dao.js:104

12024-03-05 02:41am
Vulnerable Code

_id: parseInt(userId)
}, callback);
};
this.getUserByUserName = (userName, callback) => {
usersCol.findOne({

1 Data Flow/s detected

app.post("/signup", sessionHandler.handleSignup);

this.handleSignup = (req, res, next) => {

userName,

if (validateSignup(userName, firstName, lastName, password, verify, email, errors)) {

const validateSignup = (userName, firstName, lastName, password, verify, email, errors) => {

if (validateSignup(userName, firstName, lastName, password, verify, email, errors)) {

userDAO.getUserByUserName(userName, (err, user) => {

this.getUserByUserName = (userName, callback) => {

userName: userName

usersCol.findOne({

Findings Overview

Severity Vulnerability Type CWE Language Count
High Server Side Request Forgery CWE-918 JavaScript / TypeScript* 1
High NoSQL Injection CWE-943 JavaScript / TypeScript* 4
High Path/Directory Traversal CWE-22 JavaScript / TypeScript* 1
High Code Injection CWE-94 JavaScript / TypeScript* 5
Medium Regex Denial of Service (ReDoS) CWE-1333 JavaScript / TypeScript* 1
Low Log Forging CWE-117 JavaScript / TypeScript* 2
Low Sensitive Cookie Without Secure CWE-614 JavaScript / TypeScript* 1
Low Unvalidated/Open Redirect CWE-601 JavaScript / TypeScript* 1
@mend-for-github-com mend-for-github-com bot added the Mend: code security findings Code security findings detected by Mend label Nov 7, 2023
@mend-for-github-com mend-for-github-com bot changed the title Code Security Report: 3 high severity findings, 16 total findings Code Security Report: 11 high severity findings, 16 total findings Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mend: code security findings Code security findings detected by Mend
Projects
None yet
Development

No branches or pull requests

0 participants