Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
e9b666b
Create sample.txt
darvinhts Mar 3, 2025
7b86810
Delete sample.txt
darvinhts Mar 3, 2025
aaeb0f0
Create sample
darvinhts Mar 3, 2025
578c672
Delete sample
darvinhts Mar 3, 2025
8e9509a
Create sample1
darvinhts Mar 3, 2025
1b0563e
Create add
darvinhts Mar 4, 2025
8cedb93
Create test.txt
darvinhts Mar 4, 2025
9b4c2ef
Create BUILD_BREAK
darvinhts Apr 30, 2025
71fff3a
Create TEST.TXT
darvinhts May 2, 2025
c153e1b
Create QTEST.TXT
darvinhts May 2, 2025
7b6e7f2
Create NEW_BUILD_BREAK
darvinhts May 2, 2025
7bc9d34
Create NEWWW
darvinhts May 2, 2025
54aa148
Create sample.txt
darvinhts May 2, 2025
2f0e665
Merge pull request #3 from darvinhts/ed
darvinhts May 2, 2025
469f3cc
Create kj
darvinhts May 5, 2025
6150810
Merge pull request #4 from darvinhts/vc
darvinhts May 5, 2025
25d3eb2
Create testpr
darvinhts May 5, 2025
27cc039
Merge pull request #5 from darvinhts/pr
darvinhts May 5, 2025
828c403
Create vdvvsvdsdsdsvfs
darvinhts May 5, 2025
44544f6
Merge pull request #6 from darvinhts/vvvc
darvinhts May 5, 2025
3419eb1
Create r360_Buildbreak
darvinhts May 9, 2025
07a2a7a
Merge branch 'BUILD_BREAK' into darvinhts-patch-1
darvinhts May 9, 2025
d816c8b
Create sdcdsc
darvinhts May 22, 2025
2cc69b5
Merge branch 'master' into darvinhts-patch-2
darvinhts May 22, 2025
87ed4db
Auto-merged via security webhook
darvinhts May 22, 2025
d3c3dfa
Auto-merged via security webhook
darvinhts May 22, 2025
4f30ef1
Merge pull request #10 from darvinhts/darvinhts-patch-2
darvinhts May 22, 2025
4cdccf7
Create cwec
darvinhts May 22, 2025
60fa615
Merge branch 'master' into darvinhts-patch-1
darvinhts May 22, 2025
11f89b2
Create csadcsaav
darvinhts May 22, 2025
f5d6eda
Merge branch 'master' into darvinhts-patch-2
darvinhts May 22, 2025
8c63d2b
Create vfdvdasvs
darvinhts May 30, 2025
b0be29a
Create off
darvinhts May 30, 2025
359ea8d
Merge pull request #13 from darvinhts/darvinhts-patch-1
darvinhts May 30, 2025
60d45a6
Create bbON
darvinhts May 30, 2025
672febb
Merge branch 'master' into darvinhts-patch-2
darvinhts May 30, 2025
f1d6d37
Merge pull request #14 from darvinhts/darvinhts-patch-2
darvinhts May 30, 2025
ef67bc3
Create hjgciy
darvinhts May 30, 2025
2ca1d0a
Create jcubpiu
darvinhts May 30, 2025
4d8e42d
Merge pull request #15 from darvinhts/darvinhts-patch-1
darvinhts May 30, 2025
d7a9fc2
Create fdbadf
darvinhts May 31, 2025
1795527
Merge branch 'master' into darvinhts-patch-1
darvinhts May 31, 2025
898928a
Create sdfv
darvinhts May 31, 2025
8543162
Merge pull request #16 from darvinhts/darvinhts-patch-1
darvinhts May 31, 2025
af0d2fc
Create re
darvinhts Jun 19, 2025
2b0b09d
Merge branch 'master' into darvinhts-patch-1
darvinhts Jun 19, 2025
32bf6b5
Create dfb
darvinhts Jun 19, 2025
25879b0
Merge pull request #17 from darvinhts/darvinhts-patch-1
darvinhts Jun 19, 2025
5d123e6
Create asdvas
darvinhts Jul 9, 2025
93a448d
Merge branch 'master' into darvinhts-patch-1
darvinhts Jul 9, 2025
ee65d3f
Create nnnnnnnnnn
darvinhts Jul 9, 2025
d524429
Merge pull request #18 from darvinhts/darvinhts-patch-1
darvinhts Jul 9, 2025
5b0828d
Create ljhgv
darvinhts Jul 9, 2025
aedde43
Merge pull request #19 from darvinhts/darvinhts-patch-2
darvinhts Jul 9, 2025
d4fbda9
Create build break on patch 1
darvinhts Jul 9, 2025
f19ccd1
Merge pull request #20 from darvinhts/darvinhts-patch-1
darvinhts Jul 9, 2025
4d12bd4
Create kjhgfhuytr
darvinhts Jul 9, 2025
ee672ed
Merge pull request #21 from darvinhts/darvinhts-patch-1
darvinhts Jul 9, 2025
69a67a7
Create LJ IH UGV
darvinhts Aug 4, 2025
02d3696
Merge pull request #22 from darvinhts/BUILD_BREAK
darvinhts Aug 4, 2025
c84a49b
Create ouiyujthrg
darvinhts Sep 10, 2025
2a5a9a6
Merge pull request #24 from darvinhts/BUILD_BREAK
darvinhts Sep 10, 2025
224176a
Create jlhk.jg,hmgnf
darvinhts Sep 10, 2025
f44f203
Create ihougyftk
darvinhts Sep 11, 2025
a6e6ab3
Merge pull request #27 from darvinhts/NEW
darvinhts Sep 11, 2025
9a46b2a
Create uytr
darvinhts Sep 11, 2025
29476b5
Merge pull request #28 from darvinhts/NEW
darvinhts Sep 11, 2025
66982b1
Add test1 file with initial content
darvinhts Oct 23, 2025
060e631
Create 123445
darvinhts Oct 24, 2025
57e686e
Update form-data package version
darvinhts Nov 5, 2025
934e195
Change hostName to an empty string
darvinhts Nov 5, 2025
1907eb2
Merge pull request #44 from darvinhts/BUILD_BREAK
darvinhts Nov 5, 2025
8a7ee53
Update contributions.js
darvinhts Nov 12, 2025
5b938a3
Update test.js
darvinhts Nov 12, 2025
e725514
Update server.js
darvinhts Nov 12, 2025
1123f2f
Update server.key
darvinhts Nov 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions 123445
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fbdfnadf
1 change: 1 addition & 0 deletions BUILD_BREAK
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BUILD_BREAK
1 change: 1 addition & 0 deletions LJ IH UGV
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
LDF 'LM V
1 change: 1 addition & 0 deletions NEWWW
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JHOUV
1 change: 1 addition & 0 deletions NEW_BUILD_BREAK
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JVHVLYVIU;V
1 change: 1 addition & 0 deletions QTEST.TXT
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JHVHGC
1 change: 1 addition & 0 deletions TEST.TXT
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
JHJH
1 change: 1 addition & 0 deletions add
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cdscwe
124 changes: 63 additions & 61 deletions app/routes/contributions.js
Original file line number Diff line number Diff line change
@@ -1,80 +1,82 @@
const ContributionsDAO = require("../data/contributions-dao").ContributionsDAO;
const {
environmentalScripts
} = require("../../config/config");
const { environmentalScripts } = require("../../config/config");

/* The ContributionsHandler must be constructed with a connected db */
function ContributionsHandler(db) {
"use strict";
"use strict";

const contributionsDAO = new ContributionsDAO(db);
const contributionsDAO = new ContributionsDAO(db);

this.displayContributions = (req, res, next) => {
const {
userId
} = req.session;
this.displayContributions = (req, res, next) => {
const { userId } = req.session;

contributionsDAO.getByUserId(userId, (error, contrib) => {
if (error) return next(error);
contributionsDAO.getByUserId(userId, (error, contrib) => {
if (error) return next(error);

contrib.userId = userId; //set for nav menu items
return res.render("contributions", {
...contrib,
environmentalScripts
});
});
};

this.handleContributionsUpdate = (req, res, next) => {
contrib.userId = userId; // set for nav menu items
return res.render("contributions", {
...contrib,
environmentalScripts,
});
});
};

/*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);
this.handleContributionsUpdate = (req, res, next) => {
// ✅ SAFE: Never use eval() for user input
// Parse and validate numeric inputs
const parseNumber = (val) => {
if (typeof val === "number") return val;
if (typeof val === "string") {
const num = Number(val.trim());
return Number.isFinite(num) ? num : NaN;
}
return NaN;
};

/*
//Fix for A1 -1 SSJS Injection attacks - uses alternate method to eval
const preTax = parseInt(req.body.preTax);
const afterTax = parseInt(req.body.afterTax);
const roth = parseInt(req.body.roth);
*/
const {
userId
} = req.session;
const preTax = parseNumber(req.body.preTax);
const afterTax = parseNumber(req.body.afterTax);
const roth = parseNumber(req.body.roth);

//validate contributions
const validations = [isNaN(preTax), isNaN(afterTax), isNaN(roth), preTax < 0, afterTax < 0, roth < 0];
const isInvalid = validations.some(validation => validation);
if (isInvalid) {
return res.render("contributions", {
updateError: "Invalid contribution percentages",
userId,
environmentalScripts
});
}
// Prevent more than 30% contributions
if (preTax + afterTax + roth > 30) {
return res.render("contributions", {
updateError: "Contribution percentages cannot exceed 30 %",
userId,
environmentalScripts
});
}
const { userId } = req.session;

contributionsDAO.update(userId, preTax, afterTax, roth, (err, contributions) => {
// ✅ Validate contributions
const validations = [
isNaN(preTax),
isNaN(afterTax),
isNaN(roth),
preTax < 0,
afterTax < 0,
roth < 0,
];

if (err) return next(err);
const isInvalid = validations.some(Boolean);
if (isInvalid) {
return res.render("contributions", {
updateError: "Invalid contribution percentages",
userId,
environmentalScripts,
});
}

contributions.updateSuccess = true;
return res.render("contributions", {
...contributions,
environmentalScripts
});
});
// ✅ Prevent excessive total contributions
if (preTax + afterTax + roth > 30) {
return res.render("contributions", {
updateError: "Contribution percentages cannot exceed 30%",
userId,
environmentalScripts,
});
}

};
contributionsDAO.update(userId, preTax, afterTax, roth, (err, contributions) => {
if (err) return next(err);

contributions.updateSuccess = true;
return res.render("contributions", {
...contributions,
environmentalScripts,
});
});
};
}

module.exports = ContributionsHandler;
16 changes: 1 addition & 15 deletions artifacts/cert/server.key
Original file line number Diff line number Diff line change
@@ -1,15 +1 @@
-----BEGIN RSA PRIVATE KEY-----
MIICXgIBAAKBgQCfn8uP4FuHaaAPrMkcl1fNMQM5EGMT4nnNSVoaEVdiDLc6P0mC
AZtUO9W0OjWow+TwGk3HkqoSJOA9KRMrzK7MtEKfwNgzpsHo4m+mHaPg5DUyicnU
/hfUDvjGcHvTQjW8O4/chtMVl2h7P8QtPi9QDcWqxmEXCLqTB6BZXrVkjQIDAQAB
AoGAEfIdKKfIooi1fg2m7pf1PxRrkFbPTMUBfJrqjlO0x0k2sE29LeiQVgAEHqcM
sVSUwIm0hONwS2np6/ZaOWphnGSRt5r0FoHSt8AEakQjh5Oajkn7xw+/IxwFhzSa
fMPkG/xbAlo0zTGGLWtHa0oLhEpvZ/gQ/nk48iFVz+YZ5gECQQDNzGeWyX1FKbNF
8wUzZyBQd7e9UyDSaSCj1x9vWhK0tI6Oyl/p85Izh48gHTKlGjCKOe8ktJQtudJ3
xq9nApZ9AkEAxo/srNkEARmu+/W9P16IvM3QQJQhkF23Mz1WC1uFIDyG4iyng+Le
nmkoqwT6jA9YArj06Mw/ylh4fcjxi4KTUQJBALWXO4CN4f95QDrkqR4mTRkzyelA
xKFlKevoElDLBd51w6SzZdalmcfmQaBwoxOT/Gi7ngyhWm7OnKwboQIgAnECQQCY
H/gxzOoWdbjsbK8a97BHBl/AujykwEf1R86+UNXDhtvIOHH2xz/LmcGAlQXnfHHv
VAi+uo08118o72Svf9ChAkEApRCZgczlNNQpvEsWTUBmNAHqj9hgmLTrJv4ywsPK
kTwqg6U9lF+NaLWVfvSIb1LY+M63juJHafAGKQvH+/di+g==
-----END RSA PRIVATE KEY-----

1 change: 1 addition & 0 deletions asdvas
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
abasfdbadsbdsfb
1 change: 1 addition & 0 deletions bbON
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BBON
1 change: 1 addition & 0 deletions build break on patch 1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test git bui;dbreak
5 changes: 2 additions & 3 deletions config/env/all.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
// default app configuration

const port = process.env.PORT || 4000;
let db = process.env.MONGODB_URI || "mongodb://localhost:27017/nodegoat";

module.exports = {
port,
db,
cookieSecret: "session_cookie_secret_key_here",
cryptoKey: "a_secure_key_for_crypto_here",
cryptoAlgo: "aes256",
hostName: "localhost",
hostName: "",
environmentalScripts: []
};

2 changes: 0 additions & 2 deletions config/env/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@ module.exports = {
// If you want to debug regression tests, you will need the following.
zapHostName: "192.168.56.20",
zapPort: "8080",
// Required from Zap 2.4.1. This key is set in Zap Options -> API _Api Key.
zapApiKey: "v9dn0balpqas1pcc281tn5ood1",
zapApiFeedbackSpeed: 5000 // Milliseconds.
};
1 change: 1 addition & 0 deletions csadcsaav
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
kjsdbojdwb
1 change: 1 addition & 0 deletions cwec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
wcwecewc
1 change: 1 addition & 0 deletions dfb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bsdb
1 change: 1 addition & 0 deletions fdbadf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dfsvv
1 change: 1 addition & 0 deletions hjgciy
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ktycyt
1 change: 1 addition & 0 deletions ihougyftk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gjhgfxdfsd
1 change: 1 addition & 0 deletions jcubpiu
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ljgcycy
1 change: 1 addition & 0 deletions jlhk.jg,hmgnf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
edgrthfjhygkhj.l
1 change: 1 addition & 0 deletions kj
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
,j
1 change: 1 addition & 0 deletions kjhgfhuytr
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
etrbtafgvytyrt54
1 change: 1 addition & 0 deletions ljhgv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ljh f
1 change: 1 addition & 0 deletions nnnnnnnnnn
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fsdvsd
1 change: 1 addition & 0 deletions off
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
off
1 change: 1 addition & 0 deletions ouiyujthrg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
piouyjthrg
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions r360_Buildbreak
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jyufdistrdtliis
1 change: 1 addition & 0 deletions re
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rtg
1 change: 1 addition & 0 deletions sample.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mgcjy
1 change: 1 addition & 0 deletions sample1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions sdcdsc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sdvfsavasv
1 change: 1 addition & 0 deletions sdfv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bbqfq
Loading