Fix possible security issue in inetChecksite()

This commit is contained in:
effectrenan 2021-02-18 14:01:49 -03:00
parent 078ea404f4
commit e64cb03654
2 changed files with 23 additions and 0 deletions

22
lib/poc.js Normal file
View File

@ -0,0 +1,22 @@
let si = require('./internet');
si.inetChecksite([]).then((a) => {
if (a.ok == false)
console.log("inetChecksite is fixed!")
else
console.log("inetChecksite is not fixed!")
});
si.inetLatency([]).then((a) => {
if (a == null)
console.log("inetLatency is fixed!")
else
console.log("inetLatency is not fixed!")
});
si = require('./processes');
si.services([]).then((a) => {
if (typeof a == typeof [])
console.log("services is fixed!")
else
console.log("services is not fixed!")
});

View File

@ -529,6 +529,7 @@ function sanitizeShellString(str, strict = false) {
s[i] === '\'' ||
s[i] === '`' ||
s[i] === '"' ||
strict && s[i] === '@' ||
strict && s[i] === ' ' ||
strict && s[i] == '{' ||
strict && s[i] == ')')) {