mirror of
https://github.com/unraid/webgui.git
synced 2026-05-07 21:01:19 -05:00
Enhanced dockerMan Security
This commit is contained in:
@@ -344,7 +344,7 @@ button[type=button]{margin:0 20px 0 0}
|
|||||||
function makeConfig(opts) {
|
function makeConfig(opts) {
|
||||||
confNum += 1;
|
confNum += 1;
|
||||||
var newConfig = $("#templateDisplayConfig").html();
|
var newConfig = $("#templateDisplayConfig").html();
|
||||||
newConfig = newConfig.format(opts.Name,
|
newConfig = newConfig.format(stripTags(opts.Name),
|
||||||
opts.Target,
|
opts.Target,
|
||||||
opts.Default,
|
opts.Default,
|
||||||
opts.Mode,
|
opts.Mode,
|
||||||
@@ -380,7 +380,10 @@ button[type=button]{margin:0 20px 0 0}
|
|||||||
}
|
}
|
||||||
return newConfig.prop('outerHTML');
|
return newConfig.prop('outerHTML');
|
||||||
}
|
}
|
||||||
|
function stripTags(string) {
|
||||||
|
return string.replace(/(<([^>]+)>)/ig,"");
|
||||||
|
}
|
||||||
|
|
||||||
function escapeQuote(string) {
|
function escapeQuote(string) {
|
||||||
return string.replace(new RegExp('"','g'),""");
|
return string.replace(new RegExp('"','g'),""");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -245,7 +245,7 @@ function xmlSecurity(&$template) {
|
|||||||
$tempElement = htmlspecialchars_decode($element);
|
$tempElement = htmlspecialchars_decode($element);
|
||||||
$tempElement = str_replace("[","<",$tempElement);
|
$tempElement = str_replace("[","<",$tempElement);
|
||||||
$tempElement = str_replace("]",">",$tempElement);
|
$tempElement = str_replace("]",">",$tempElement);
|
||||||
if (preg_match('#<script(.*?)>(.*?)</script>#is',$tempElement) || preg_match('#<iframe(.*?)>(.*?)</iframe>#is',$tempElement)) {
|
if (preg_match('#<script(.*?)>(.*?)</script>#is',$tempElement) || preg_match('#<iframe(.*?)>(.*?)</iframe>#is',$tempElement) || (stripos($tempElement,"<link") !== false) ) {
|
||||||
$element = "REMOVED";
|
$element = "REMOVED";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user