sanitizeShellString() and other security improvements
This commit is contained in:
parent
7922366d70
commit
0be6fcd575
@ -470,7 +470,7 @@ function dockerContainerStats(containerIDs, callback) {
|
|||||||
if (containerIDsSanitized !== '*') {
|
if (containerIDsSanitized !== '*') {
|
||||||
containerIDsSanitized = '';
|
containerIDsSanitized = '';
|
||||||
const s = (util.isPrototypePolluted() ? '' : util.sanitizeShellString(containerIDs, true)).trim();
|
const s = (util.isPrototypePolluted() ? '' : util.sanitizeShellString(containerIDs, true)).trim();
|
||||||
for (let i = 0; i <= 2000; i++) {
|
for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
|
||||||
if (!(s[i] === undefined)) {
|
if (!(s[i] === undefined)) {
|
||||||
s[i].__proto__.toLowerCase = util.stringToLower;
|
s[i].__proto__.toLowerCase = util.stringToLower;
|
||||||
const sl = s[i].toLowerCase();
|
const sl = s[i].toLowerCase();
|
||||||
|
|||||||
@ -46,8 +46,7 @@ function inetChecksite(url, callback) {
|
|||||||
}
|
}
|
||||||
let urlSanitized = '';
|
let urlSanitized = '';
|
||||||
const s = util.sanitizeShellString(url, true);
|
const s = util.sanitizeShellString(url, true);
|
||||||
const mathMin = util.mathMin;
|
for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
|
||||||
for (let i = 0; i <= mathMin(s.length, 2000); i++) {
|
|
||||||
if (!(s[i] === undefined)) {
|
if (!(s[i] === undefined)) {
|
||||||
s[i].__proto__.toLowerCase = util.stringToLower;
|
s[i].__proto__.toLowerCase = util.stringToLower;
|
||||||
const sl = s[i].toLowerCase();
|
const sl = s[i].toLowerCase();
|
||||||
@ -145,8 +144,7 @@ function inetLatency(host, callback) {
|
|||||||
}
|
}
|
||||||
let hostSanitized = '';
|
let hostSanitized = '';
|
||||||
const s = (util.isPrototypePolluted() ? '8.8.8.8' : util.sanitizeShellString(host, true)).trim();
|
const s = (util.isPrototypePolluted() ? '8.8.8.8' : util.sanitizeShellString(host, true)).trim();
|
||||||
const mathMin = util.mathMin;
|
for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
|
||||||
for (let i = 0; i <= mathMin(s.length, 2000); i++) {
|
|
||||||
if (!(s[i] === undefined)) {
|
if (!(s[i] === undefined)) {
|
||||||
s[i].__proto__.toLowerCase = util.stringToLower;
|
s[i].__proto__.toLowerCase = util.stringToLower;
|
||||||
const sl = s[i].toLowerCase();
|
const sl = s[i].toLowerCase();
|
||||||
|
|||||||
@ -1061,8 +1061,7 @@ function networkStatsSingle(iface) {
|
|||||||
process.nextTick(() => {
|
process.nextTick(() => {
|
||||||
let ifaceSanitized = '';
|
let ifaceSanitized = '';
|
||||||
const s = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(iface);
|
const s = util.isPrototypePolluted() ? '---' : util.sanitizeShellString(iface);
|
||||||
const mathMin = util.mathMin;
|
for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
|
||||||
for (let i = 0; i <= mathMin(s.length, 2000); i++) {
|
|
||||||
if (!(s[i] === undefined)) {
|
if (!(s[i] === undefined)) {
|
||||||
ifaceSanitized = ifaceSanitized + s[i];
|
ifaceSanitized = ifaceSanitized + s[i];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -111,8 +111,7 @@ function services(srv, callback) {
|
|||||||
srvString.__proto__.trim = util.stringTrim;
|
srvString.__proto__.trim = util.stringTrim;
|
||||||
|
|
||||||
const s = util.sanitizeShellString(srv);
|
const s = util.sanitizeShellString(srv);
|
||||||
const mathMin = util.mathMin;
|
for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
|
||||||
for (let i = 0; i <= mathMin(s.length, 2000); i++) {
|
|
||||||
if (!(s[i] === undefined)) {
|
if (!(s[i] === undefined)) {
|
||||||
srvString = srvString + s[i];
|
srvString = srvString + s[i];
|
||||||
}
|
}
|
||||||
@ -911,8 +910,7 @@ function processLoad(proc, callback) {
|
|||||||
processesString.__proto__.trim = util.stringTrim;
|
processesString.__proto__.trim = util.stringTrim;
|
||||||
|
|
||||||
const s = util.sanitizeShellString(proc);
|
const s = util.sanitizeShellString(proc);
|
||||||
const mathMin = util.mathMin;
|
for (let i = 0; i <= util.mathMin(s.length, 2000); i++) {
|
||||||
for (let i = 0; i <= mathMin(s.length, 2000); i++) {
|
|
||||||
if (!(s[i] === undefined)) {
|
if (!(s[i] === undefined)) {
|
||||||
processesString = processesString + s[i];
|
processesString = processesString + s[i];
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user