13class CSecurityTaintCheckingTest
16 const REQUEST_TIMEOUT = 3;
17 protected $internalName =
"TaintCheckingTest";
21 require_once(
$_SERVER[
"DOCUMENT_ROOT"].
"/bitrix/modules/main/classes/general/vuln_scanner.php");
34 if(extension_loaded(
'tokenizer') !==
true)
35 throw new CSecurityRequirementsException(
GetMessage(
"SECURITY_SITE_CHECKER_TAINT_TOKENIZER_NOT_FOUND"));
38 throw new CSecurityRequirementsException(
GetMessage(
"SECURITY_SITE_CHECKER_TAINT_EXECUTION_TIME"));
40 if($memoryLimit > 0 && $memoryLimit <= 250 * 1024 * 1024)
41 throw new CSecurityRequirementsException(
GetMessage(
"SECURITY_SITE_CHECKER_TAINT_MEMORY_LIMIT"));
53 $result = $this->formatResults($dirtyResults);
61 protected function formatResults($pResults)
65 if(isset($pResults[
"STATUS"]))
67 $result[
"status"] = $pResults[
"STATUS"];
70 if(isset($pResults[
"IN_PROGRESS"]))
72 $result[
"in_progress"] = $pResults[
"IN_PROGRESS"];
73 $result[
"timeout"] = self::REQUEST_TIMEOUT;
81 if(isset($pResults[
"MESSAGE"]))
83 $result[
"errors"] = self::formatErrors($pResults[
"MESSAGE"]);
97 protected static function formatErrors($pErrors)
100 if(isset($pErrors[
"PROBLEM_COUNT"]) && intval($pErrors[
"PROBLEM_COUNT"]) > 0)
102 $problemCount = $pErrors[
"PROBLEM_COUNT"];
110 $result[
"recommendation"] =
GetMessage(
"SECURITY_SITE_CHECKER_TAINT_RECOMMENDATION");
111 $result[
"detail"] = self::formatDetail($pErrors[
"DETAIL"]);
120 protected static function formatDetail($pDetail)
122 $detail = preg_replace(
"#
123 (<span\sclass=\"checklist-vulnscan-filename\">[^<]+</span>\s*)
124 (<div\sid=\"[^\"]+\">\s*<div\sclass=\"checklist-vulnscan-vulnblock\">\s*)
125 (<div\sclass=\"checklist-vulnscan-vulnscan-blocktitle\">[^<]+</div>)
126 #xis",
"\\3\\2\\1", $pDetail);
static checkVulnerabilities($arParams)
checkRequirements($params=array())
check(array $params=array())
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
$_SERVER["DOCUMENT_ROOT"]
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
GetMessage($name, $aReplace=null)
__construct(?int $storeId, int $productId, string $barcode, int $userId)
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']