security patch from live

This commit is contained in:
Miodec 2021-08-03 16:08:15 +01:00
parent c4fdeb53ae
commit 6ff2984ef7

View file

@ -80,8 +80,16 @@ function validateConfig(config) {
if (!isConfigKeyValid(key)) {
throw new MonkeyError(500, `Invalid config: ${key} failed regex check`);
}
if (key === "resultFilters") return;
if (key === "customBackground") return;
// if (key === "resultFilters") return;
// if (key === "customBackground") return;
if (key === "customBackground" || key === "customLayoutfluid") {
if (/[<>]/.test(config[key])) {
throw new MonkeyError(
500,
`Invalid config: ${key}:${config.key} failed regex check`
);
}
}
let val = config[key];
if (Array.isArray(val)) {
val.forEach((valarr) => {