Skip to content

Code Security Report: 11 high severity findings, 16 total findings [master] #29

@mend-developer-platform-dev

Description

@mend-developer-platform-dev

Code Security Report

Scan Metadata

Latest Scan: 2025-09-17 08:32AM
Total Findings: 16 | New Findings: 0 | Resolved Findings: 0
Tested Project Files: 50
Detected Programming Languages: 1 (JavaScript / TypeScript*)

Most Relevant Findings

The list below presents the 10 most relevant findings that need your attention.

Severity
Vulnerability Type
CWE
File
Data Flows
Detected
Violated Workflows
Violation Priority
Violation SLA
High
Code Injection
1
2025-09-17 08:32AM
Code Test
HIGH
2025-10-17
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);
const roth = eval(req.body.roth);
/*
//Fix for A1 -1 SSJS Injection attacks - uses alternate method to eval

Data Flows (1 detected)

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

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

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

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

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

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

Secure Code Warrior Training Material
High
Code Injection
1
2025-09-17 08:32AM
Code Test
HIGH
2025-10-17
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);
/*
//Fix for A1 -1 SSJS Injection attacks - uses alternate method to eval
const preTax = parseInt(req.body.preTax);

Data Flows (1 detected)

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

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

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

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

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

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

Secure Code Warrior Training Material
High
Code Injection
1
2025-09-17 08:32AM
Code Test
HIGH
2025-10-17
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);
/*
//Fix for A1 -1 SSJS Injection attacks - uses alternate method to eval
const preTax = parseInt(req.body.preTax);
const afterTax = parseInt(req.body.afterTax);

Data Flows (1 detected)

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

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

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

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

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

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

Secure Code Warrior Training Material
High
Code Injection
1
2025-09-17 08:32AM
Code Test
HIGH
2025-10-17
Vulnerable Code

console.error(err.message);
console.error(err.stack);
res.status(500);
res.render("error-template", {
error: err
});
};
module.exports = { errorHandler };

Data Flows (1 detected)

app.use(ErrorHandler);

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

error: err

res.render("error-template", {

app.use(ErrorHandler);

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

error: err

res.render("error-template", {

Secure Code Warrior Training Material
High
Code Injection
7
2025-09-17 08:32AM
Code Test
HIGH
2025-10-17
Vulnerable Code

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", {
updateError: "Bank Routing number does not comply with requirements for format specified",
firstNameSafeString,
lastName,
ssn,
dob,

Data Flows (7 detected)
Data Flow #1

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

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



return res.render("profile", {

Data Flow #2

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

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



return res.render("profile", {

Data Flow #3

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

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

bankRouting

bankRouting,

return res.render("profile", {

View more Data Flows


Secure Code Warrior Training Material
High
Path/Directory Traversal
1
2025-09-17 08:32AM
Code Test
HIGH
2025-10-17
Vulnerable Code

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

Data Flows (1 detected)

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


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

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


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

Secure Code Warrior Training Material
High
NoSQL Injection
1
2025-09-17 08:32AM
Code Test
HIGH
2025-10-17
Vulnerable Code

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

Data Flows (1 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));

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));

Secure Code Warrior Training Material
High
NoSQL Injection
1
2025-09-17 08:32AM
Code Test
HIGH
2025-10-17
Vulnerable Code

callback(noSuchUserError, null);
}
}
usersCol.findOne({
userName: userName
}, validateUserDoc);
};
// This is the good one, see the next function

Data Flows (1 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({

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({

Secure Code Warrior Training Material
High
Server Side Request Forgery
1
2025-09-17 08:32AM
Code Test
HIGH
2025-10-17
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) => {
if (!error && newResponse.statusCode === 200) {
res.writeHead(200, {
"Content-Type": "text/html"
});
}

Data Flows (1 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) => {

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) => {

Secure Code Warrior Training Material
High
NoSQL Injection
1
2025-09-17 08:32AM
Code Test
HIGH
2025-10-17
Vulnerable Code

userId: parsedUserId
};
}
allocationsCol.find(searchCriteria()).toArray((err, allocations) => {
if (err) return callback(err, null);
if (!allocations.length) return callback("ERROR: No allocations found for the user", null);
let doneCounter = 0;
const userAllocations = [];

Data Flows (1 detected)

app.get("/allocations/:userId", isLoggedIn, allocationsHandler.displayAllocations);

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


allocationsDAO.getByUserIdAndThreshold(userId, threshold, (err, allocations) => {

this.getByUserIdAndThreshold = (userId, threshold, callback) => {

allocationsCol.find(searchCriteria()).toArray((err, allocations) => {

const searchCriteria = () => {

$where: `this.userId == ${parsedUserId} && this.stocks > '${threshold}'`

allocationsCol.find(searchCriteria()).toArray((err, allocations) => {

app.get("/allocations/:userId", isLoggedIn, allocationsHandler.displayAllocations);

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


allocationsDAO.getByUserIdAndThreshold(userId, threshold, (err, allocations) => {

this.getByUserIdAndThreshold = (userId, threshold, callback) => {

allocationsCol.find(searchCriteria()).toArray((err, allocations) => {

const searchCriteria = () => {

$where: `this.userId == ${parsedUserId} && this.stocks > '${threshold}'`

allocationsCol.find(searchCriteria()).toArray((err, allocations) => {

Secure Code Warrior Training Material

Findings Overview

Severity Vulnerability Type CWE Language Count
High Code Injection CWE-94 JavaScript / TypeScript* 5
High NoSQL Injection CWE-943 JavaScript / TypeScript* 4
High Path/Directory Traversal CWE-22 JavaScript / TypeScript* 1
High Server Side Request Forgery CWE-918 JavaScript / TypeScript* 1
Low Log Forging CWE-117 JavaScript / TypeScript* 2
Low Unvalidated/Open Redirect CWE-601 JavaScript / TypeScript* 1
Low Sensitive Cookie Without Secure CWE-614 JavaScript / TypeScript* 1
Low Regex Denial of Service (ReDoS) CWE-1333 JavaScript / TypeScript* 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions