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
🎓 Training
📺 Videos
📚 Further Reading
|
 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
🎓 Training
📺 Videos
📚 Further Reading
|
 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
🎓 Training
📺 Videos
📚 Further Reading
|
 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)
|
const errorHandler = (err, req, res,next) => { |
|
res.render("error-template", { |
|
const errorHandler = (err, req, res,next) => { |
|
res.render("error-template", { |
Secure Code Warrior Training Material
🎓 Training
📺 Videos
📚 Further Reading
|
 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) => { |
|
return res.render("profile", { |
Secure Code Warrior Training Material
🎓 Training
📺 Videos
📚 Further Reading
|
 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
🎓 Training
📺 Videos
📚 Further Reading
|
 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) => { |
|
app.post("/login", sessionHandler.handleLoginRequest); |
|
this.handleLoginRequest = (req, res, next) => { |
|
userDAO.validateLogin(userName, password, (err, user) => { |
|
this.validateLogin = (userName, password, callback) => { |
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
|
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
NodeGoat/app/routes/contributions.js
Lines 28 to 37 in 83624e1
Data Flows (1 detected)
NodeGoat/app/routes/index.js
Line 54 in 83624e1
NodeGoat/app/routes/contributions.js
Line 28 in 83624e1
NodeGoat/app/routes/contributions.js
Line 32 in 83624e1
NodeGoat/app/routes/index.js
Line 54 in 83624e1
NodeGoat/app/routes/contributions.js
Line 28 in 83624e1
NodeGoat/app/routes/contributions.js
Line 32 in 83624e1
🎓 Training
📺 Videos
📚 Further Reading
NodeGoat/app/routes/contributions.js
Lines 29 to 38 in 83624e1
Data Flows (1 detected)
NodeGoat/app/routes/index.js
Line 54 in 83624e1
NodeGoat/app/routes/contributions.js
Line 28 in 83624e1
NodeGoat/app/routes/contributions.js
Line 33 in 83624e1
NodeGoat/app/routes/index.js
Line 54 in 83624e1
NodeGoat/app/routes/contributions.js
Line 28 in 83624e1
NodeGoat/app/routes/contributions.js
Line 33 in 83624e1
🎓 Training
📺 Videos
📚 Further Reading
NodeGoat/app/routes/contributions.js
Lines 30 to 39 in 83624e1
Data Flows (1 detected)
NodeGoat/app/routes/index.js
Line 54 in 83624e1
NodeGoat/app/routes/contributions.js
Line 28 in 83624e1
NodeGoat/app/routes/contributions.js
Line 34 in 83624e1
NodeGoat/app/routes/index.js
Line 54 in 83624e1
NodeGoat/app/routes/contributions.js
Line 28 in 83624e1
NodeGoat/app/routes/contributions.js
Line 34 in 83624e1
🎓 Training
📺 Videos
📚 Further Reading
NodeGoat/app/routes/error.js
Lines 6 to 15 in 83624e1
Data Flows (1 detected)
NodeGoat/app/routes/index.js
Line 97 in 83624e1
NodeGoat/app/routes/error.js
Line 3 in 83624e1
NodeGoat/app/routes/error.js
Line 11 in 83624e1
NodeGoat/app/routes/error.js
Line 10 in 83624e1
NodeGoat/app/routes/index.js
Line 97 in 83624e1
NodeGoat/app/routes/error.js
Line 3 in 83624e1
NodeGoat/app/routes/error.js
Line 11 in 83624e1
NodeGoat/app/routes/error.js
Line 10 in 83624e1
🎓 Training
📺 Videos
📚 Further Reading
NodeGoat/app/routes/profile.js
Lines 61 to 70 in 83624e1
Data Flows (7 detected)
Data Flow #1
NodeGoat/app/routes/index.js
Line 50 in 83624e1
NodeGoat/app/routes/profile.js
Line 40 in 83624e1
NodeGoat/app/routes/profile.js
Line 47 in 83624e1
NodeGoat/app/routes/profile.js
Line 71 in 83624e1
NodeGoat/app/routes/profile.js
Line 65 in 83624e1
Data Flow #2
NodeGoat/app/routes/index.js
Line 50 in 83624e1
NodeGoat/app/routes/profile.js
Line 40 in 83624e1
NodeGoat/app/routes/profile.js
Line 48 in 83624e1
NodeGoat/app/routes/profile.js
Line 72 in 83624e1
NodeGoat/app/routes/profile.js
Line 65 in 83624e1
Data Flow #3
NodeGoat/app/routes/index.js
Line 50 in 83624e1
NodeGoat/app/routes/profile.js
Line 40 in 83624e1
NodeGoat/app/routes/profile.js
Line 49 in 83624e1
NodeGoat/app/routes/profile.js
Line 73 in 83624e1
NodeGoat/app/routes/profile.js
Line 65 in 83624e1
View more Data Flows
🎓 Training
📺 Videos
📚 Further Reading
NodeGoat/app/routes/index.js
Lines 84 to 93 in 83624e1
Data Flows (1 detected)
NodeGoat/app/routes/index.js
Line 84 in 83624e1
NodeGoat/app/routes/index.js
Line 86 in 83624e1
NodeGoat/app/routes/index.js
Line 88 in 83624e1
NodeGoat/app/routes/index.js
Line 84 in 83624e1
NodeGoat/app/routes/index.js
Line 86 in 83624e1
NodeGoat/app/routes/index.js
Line 88 in 83624e1
🎓 Training
📺 Videos
📚 Further Reading
NodeGoat/app/data/memos-dao.js
Lines 19 to 28 in 83624e1
Data Flows (1 detected)
NodeGoat/app/routes/index.js
Line 69 in 83624e1
NodeGoat/app/routes/memos.js
Line 11 in 83624e1
NodeGoat/app/routes/memos.js
Line 13 in 83624e1
NodeGoat/app/data/memos-dao.js
Line 15 in 83624e1
NodeGoat/app/data/memos-dao.js
Line 19 in 83624e1
NodeGoat/app/data/memos-dao.js
Line 23 in 83624e1
NodeGoat/app/routes/index.js
Line 69 in 83624e1
NodeGoat/app/routes/memos.js
Line 11 in 83624e1
NodeGoat/app/routes/memos.js
Line 13 in 83624e1
NodeGoat/app/data/memos-dao.js
Line 15 in 83624e1
NodeGoat/app/data/memos-dao.js
Line 19 in 83624e1
NodeGoat/app/data/memos-dao.js
Line 23 in 83624e1
🎓 Training
📺 Videos
NodeGoat/app/data/user-dao.js
Lines 87 to 96 in 83624e1
Data Flows (1 detected)
NodeGoat/app/routes/index.js
Line 36 in 83624e1
NodeGoat/app/routes/session.js
Line 51 in 83624e1
NodeGoat/app/routes/session.js
Line 53 in 83624e1
NodeGoat/app/routes/session.js
Line 56 in 83624e1
NodeGoat/app/data/user-dao.js
Line 57 in 83624e1
NodeGoat/app/data/user-dao.js
Line 92 in 83624e1
NodeGoat/app/data/user-dao.js
Line 91 in 83624e1
NodeGoat/app/routes/index.js
Line 36 in 83624e1
NodeGoat/app/routes/session.js
Line 51 in 83624e1
NodeGoat/app/routes/session.js
Line 53 in 83624e1
NodeGoat/app/routes/session.js
Line 56 in 83624e1
NodeGoat/app/data/user-dao.js
Line 57 in 83624e1
NodeGoat/app/data/user-dao.js
Line 92 in 83624e1
NodeGoat/app/data/user-dao.js
Line 91 in 83624e1
🎓 Training
📺 Videos
NodeGoat/app/routes/research.js
Lines 12 to 21 in 83624e1
Data Flows (1 detected)
NodeGoat/app/routes/index.js
Line 94 in 83624e1
NodeGoat/app/routes/research.js
Line 12 in 83624e1
NodeGoat/app/routes/research.js
Line 15 in 83624e1
NodeGoat/app/routes/research.js
Line 16 in 83624e1
NodeGoat/app/routes/index.js
Line 94 in 83624e1
NodeGoat/app/routes/research.js
Line 12 in 83624e1
NodeGoat/app/routes/research.js
Line 15 in 83624e1
NodeGoat/app/routes/research.js
Line 16 in 83624e1
🎓 Training
📺 Videos
NodeGoat/app/data/allocations-dao.js
Lines 82 to 91 in 83624e1
Data Flows (1 detected)
NodeGoat/app/routes/index.js
Line 65 in 83624e1
NodeGoat/app/routes/allocations.js
Line 11 in 83624e1
NodeGoat/app/routes/allocations.js
Line 20 in 83624e1
NodeGoat/app/routes/allocations.js
Line 23 in 83624e1
NodeGoat/app/data/allocations-dao.js
Line 57 in 83624e1
NodeGoat/app/data/allocations-dao.js
Line 86 in 83624e1
NodeGoat/app/data/allocations-dao.js
Line 60 in 83624e1
NodeGoat/app/data/allocations-dao.js
Line 78 in 83624e1
NodeGoat/app/data/allocations-dao.js
Line 86 in 83624e1
NodeGoat/app/routes/index.js
Line 65 in 83624e1
NodeGoat/app/routes/allocations.js
Line 11 in 83624e1
NodeGoat/app/routes/allocations.js
Line 20 in 83624e1
NodeGoat/app/routes/allocations.js
Line 23 in 83624e1
NodeGoat/app/data/allocations-dao.js
Line 57 in 83624e1
NodeGoat/app/data/allocations-dao.js
Line 86 in 83624e1
NodeGoat/app/data/allocations-dao.js
Line 60 in 83624e1
NodeGoat/app/data/allocations-dao.js
Line 78 in 83624e1
NodeGoat/app/data/allocations-dao.js
Line 86 in 83624e1
🎓 Training
📺 Videos
Findings Overview