Skip to content

Commit c99d84e

Browse files
committed
#712 Fix some security issues
1 parent 6f93ca4 commit c99d84e

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

API/Backend/Datasets/models/datasets.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ function makeNewDatasetTable(name, columns, success, failure) {
160160
failure({
161161
status: "failure",
162162
message: "Failed to find existing datasets",
163-
error: error,
163+
error: err,
164164
name: name,
165165
});
166166
});

API/Backend/Draw/routes/filesutils.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,12 @@ function getfile(req, res, next) {
146146
(published ? "AND action_index=4 " : "") +
147147
"ORDER BY time DESC" +
148148
" " +
149-
"FETCH first " +
150-
(published ? req.body.id.length : "1") +
151-
" rows only",
149+
"FETCH first :first rows only",
152150
{
153151
replacements: {
154152
id: ids,
155153
time: atThisTime,
154+
first: published ? req.body.id.length : 1,
156155
},
157156
}
158157
)

API/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,14 +186,14 @@ const Utils = {
186186
forceAlphaNumUnder: function (str) {
187187
if (typeof str === "string") {
188188
return str
189-
.replace(/[`~!@#$%^&*|+\-=?;:'",.<>\{\}\[\]\\\/]/gi, "")
189+
.replace(/[`~!@#$%^&*|+\-=?;:'",.<>\{\}\[\]\\\//() ]/gi, "")
190190
.replace(/[^ -~]+/g, "");
191191
} else if (typeof str === "number") {
192192
return str;
193193
} else if (Array.isArray(str)) {
194194
return str
195195
.join(",")
196-
.replace(/[`~!@#$%^&*|+\-=?;:'".<>\{\}\[\]\\\/]/gi, "")
196+
.replace(/[`~!@#$%^&*|+\-=?;:'".<>\{\}\[\]\\\//() ]/gi, "")
197197
.replace(/[^ -~]+/g, "")
198198
.split(",");
199199
} else {

0 commit comments

Comments
 (0)