Merged in mcuiza/processmaker/veracode_29-04-15 (pull request #2057)

Validaciones nuevas incidencias reporte veracode 29-04-15
This commit is contained in:
Julio Cesar Laura Avendaño
2015-04-30 21:02:55 -04:00
30 changed files with 434 additions and 50 deletions

0
gulliver/system/class.g.php Executable file → Normal file
View File

View File

@@ -324,7 +324,16 @@ class OutputDriverGeneric extends OutputDriver {
public function encryptOld($string) public function encryptOld($string)
{ {
return md5($string); if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
return G::encryptOld($string);
} }
} }

View File

@@ -224,7 +224,16 @@ class OutputDriverPdflib16 extends OutputDriverPdflib {
public function encryptOld($string) public function encryptOld($string)
{ {
return md5($string); if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
return G::encryptOld($string);
} }
} }
?> ?>

View File

@@ -220,7 +220,16 @@ class FPDF_Protection extends FPDF
public function encryptOld($string) public function encryptOld($string)
{ {
return md5($string); if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
return G::encryptOld($string);
} }
} }

View File

@@ -935,7 +935,16 @@ class HTTP_Request {
public function encryptOld($string) public function encryptOld($string)
{ {
return md5($string); if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
return G::encryptOld($string);
} }
} }

View File

@@ -668,8 +668,21 @@ class HTTP_WebDAV_Server
if(!is_array($file) || empty($file) || !isset($file["path"])) continue; if(!is_array($file) || empty($file) || !isset($file["path"])) continue;
$path = $file['path']; $path = $file['path'];
if(!is_string($path) || $path==="") continue; if(!is_string($path) || $path==="") continue;
if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$ns_defs = $filter->xssFilterHard($ns_defs);
echo " <D:response $ns_defs>\n"; echo ' <D:response '.$ns_defs.'>\n';
/* TODO right now the user implementation has to make sure /* TODO right now the user implementation has to make sure
collections end in a slash, this should be done in here collections end in a slash, this should be done in here
@@ -808,12 +821,25 @@ class HTTP_WebDAV_Server
$this->http_status("207 Multi-Status"); $this->http_status("207 Multi-Status");
header('Content-Type: text/xml; charset="utf-8"'); header('Content-Type: text/xml; charset="utf-8"');
if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$_mergePathes = $filter->xssFilterHard($this->_urlencode($this->_mergePathes($_SERVER["SCRIPT_NAME"], $this->path)));
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"; echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
echo "<D:multistatus xmlns:D=\"DAV:\">\n"; echo "<D:multistatus xmlns:D=\"DAV:\">\n";
echo " <D:response>\n"; echo " <D:response>\n";
echo " <D:href>".$this->_urlencode($this->_mergePathes($_SERVER["SCRIPT_NAME"], $this->path))."</D:href>\n"; echo " <D:href>".$_mergePathes."</D:href>\n";
foreach($options["props"] as $prop) { foreach($options["props"] as $prop) {
echo " <D:propstat>\n"; echo " <D:propstat>\n";
@@ -1131,7 +1157,21 @@ class HTTP_WebDAV_Server
case 'HTTP_CONTENT_ENCODING': // RFC 2616 14.11 case 'HTTP_CONTENT_ENCODING': // RFC 2616 14.11
// TODO support this if ext/zlib filters are available // TODO support this if ext/zlib filters are available
$this->http_status("501 not implemented"); $this->http_status("501 not implemented");
echo "The service does not support '$val' content encoding";
if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$val = $filter->xssFilterHard($val);
echo 'The service does not support \''.$val.'\' content encoding';
return; return;
case 'HTTP_CONTENT_LANGUAGE': // RFC 2616 14.12 case 'HTTP_CONTENT_LANGUAGE': // RFC 2616 14.12
@@ -1176,7 +1216,21 @@ class HTTP_WebDAV_Server
default: default:
// any other unknown Content-* headers // any other unknown Content-* headers
$this->http_status("501 not implemented"); $this->http_status("501 not implemented");
echo "The service does not support '$key'";
if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$key = $filter->xssFilterHard($key);
echo 'The service does not support \''.$key.'\' ';
return; return;
} }
} }
@@ -1375,6 +1429,20 @@ class HTTP_WebDAV_Server
} else { } else {
$timeout = "Infinite"; $timeout = "Infinite";
} }
if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$options = $filter->xssFilterHard($options);
$timeout = $filter->xssFilterHard($timeout);
header('Content-Type: text/xml; charset="utf-8"'); header('Content-Type: text/xml; charset="utf-8"');
header("Lock-Token: <$options[locktoken]>"); header("Lock-Token: <$options[locktoken]>");
@@ -2007,6 +2075,15 @@ class HTTP_WebDAV_Server
public function encryptOld($string) public function encryptOld($string)
{ {
return md5($string); if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
return G::encryptOld($string);
} }
} }

View File

@@ -129,6 +129,15 @@ class Log_observer
public function encryptOld($string) public function encryptOld($string)
{ {
return md5($string); if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
return G::encryptOld($string);
} }
} }

View File

@@ -294,6 +294,15 @@ class Log_sql extends Log
public function encryptOld($string) public function encryptOld($string)
{ {
return md5($string); if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
return G::encryptOld($string);
} }
} }

View File

@@ -224,7 +224,16 @@ class Log_sqlite extends Log
public function encryptOld($string) public function encryptOld($string)
{ {
return md5($string); if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
return G::encryptOld($string);
} }
} }

View File

@@ -100,7 +100,16 @@ class Net_FTP_Observer
public function encryptOld($string) public function encryptOld($string)
{ {
return md5($string); if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
return G::encryptOld($string);
} }
} }

View File

@@ -1221,7 +1221,16 @@ class Net_POP3 {
public function encryptOld($string) public function encryptOld($string)
{ {
return md5($string); if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
return G::encryptOld($string);
} }

View File

@@ -467,13 +467,17 @@ Wrote: /usr/src/redhat/RPMS/i386/PEAR::Net_Socket-1.0-1.i386.rpm
$plist = implode(" ", $params); $plist = implode(" ", $params);
$cmd = "$php -C -d include_path=$cwd$ps$ip -f $run_tests -- $plist"; $cmd = "$php -C -d include_path=$cwd$ps$ip -f $run_tests -- $plist";
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); if (!class_exists('G')) {
$docuroot = explode( '/', $realdocuroot ); $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
array_pop( $docuroot ); $docuroot = explode( '/', $realdocuroot );
$pathhome = implode( '/', $docuroot ) . '/'; array_pop( $docuroot );
array_pop( $docuroot ); $pathhome = implode( '/', $docuroot ) . '/';
$pathTrunk = implode( '/', $docuroot ) . '/'; array_pop( $docuroot );
require_once($pathTrunk.'gulliver/system/class.inputfilter.php'); $pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
G::LoadSystem('inputfilter');
$filter = new InputFilter(); $filter = new InputFilter();
$cmd = $filter->validateInput($cmd); $cmd = $filter->validateInput($cmd);

View File

@@ -364,7 +364,16 @@ class PEAR_Remote extends PEAR
public function encryptOld($string) public function encryptOld($string)
{ {
return md5($string); if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
return G::encryptOld($string);
} }
} }

View File

@@ -82,15 +82,20 @@ function print_test_names()
function print_endpoint_names() function print_endpoint_names()
{ {
global $iop; global $iop;
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot ); if (!class_exists('G')) {
array_pop( $docuroot ); $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$pathhome = implode( '/', $docuroot ) . '/'; $docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot ); array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/'; $pathhome = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.inputfilter.php'); array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
G::LoadSystem('inputfilter');
$filter = new InputFilter(); $filter = new InputFilter();
$currTest = $filter->xssFilterHard($iop->currentTest); $currTest = $filter->xssFilterHard($iop->currentTest);
if (!$iop->getEndpoints($iop->currentTest)) { if (!$iop->getEndpoints($iop->currentTest)) {
die("Unable to retrieve endpoints for $currTest\n"); die("Unable to retrieve endpoints for $currTest\n");
} }
@@ -148,6 +153,20 @@ foreach ($args[0] as $arg) {
break; break;
case 'v': case 'v':
if ($arg[1] != 'php' && $arg[1] != 'soapval') { if ($arg[1] != 'php' && $arg[1] != 'soapval') {
if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$arg[1] = $filter->xssFilterHard($arg[1]);
die('Incorrect value for argument v: ' . $arg[1] . "\n"); die('Incorrect value for argument v: ' . $arg[1] . "\n");
} }
$iop->paramType = $arg[1]; $iop->paramType = $arg[1];

View File

@@ -205,7 +205,16 @@ class SOAP_Transport_SMTP extends SOAP_Transport
public function encryptOld($string) public function encryptOld($string)
{ {
return md5($string); if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
return G::encryptOld($string);
} }
} }

View File

@@ -808,6 +808,20 @@ class nusoap_base_colosa {
*/ */
function varDump($data) { function varDump($data) {
ob_start(); ob_start();
if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$data = $filter->xssFilterHard($data);
var_dump($data); var_dump($data);
$ret_val = ob_get_contents(); $ret_val = ob_get_contents();
ob_end_clean(); ob_end_clean();
@@ -3029,7 +3043,16 @@ class soap_transport_http extends nusoap_base_colosa {
public function encryptOld($string) public function encryptOld($string)
{ {
return md5($string); if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
return G::encryptOld($string);
} }
} }
@@ -3251,6 +3274,20 @@ class soap_server_colosa extends nusoap_base_colosa {
$this->appendDebug($this->wsdl->getDebug()); $this->appendDebug($this->wsdl->getDebug());
$this->wsdl->clearDebug(); $this->wsdl->clearDebug();
if($err = $this->wsdl->getError()){ if($err = $this->wsdl->getError()){
if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$err = $filter->xssFilterHard($err);
die('WSDL ERROR: '.$err); die('WSDL ERROR: '.$err);
} }
} }
@@ -3298,7 +3335,21 @@ class soap_server_colosa extends nusoap_base_colosa {
} }
} elseif ($data == '' && $this->wsdl) { } elseif ($data == '' && $this->wsdl) {
$this->debug("In service, there is no data, so return Web description"); $this->debug("In service, there is no data, so return Web description");
print $this->wsdl->webDescription();
if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$webDescription = $filter->xssFilterHard($this->wsdl->webDescription());
print $webDescription;
} else { } else {
$this->debug("In service, invoke the request"); $this->debug("In service, invoke the request");
$this->parse_request($data); $this->parse_request($data);

View File

@@ -805,6 +805,20 @@ class nusoap_base {
*/ */
function varDump($data) { function varDump($data) {
ob_start(); ob_start();
if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$data = $filter->xssFilterHard($data);
var_dump($data); var_dump($data);
$ret_val = ob_get_contents(); $ret_val = ob_get_contents();
ob_end_clean(); ob_end_clean();
@@ -3032,7 +3046,16 @@ class soap_transport_http extends nusoap_base {
public function encryptOld($string) public function encryptOld($string)
{ {
return md5($string); if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
return G::encryptOld($string);
} }
} }
@@ -3254,6 +3277,20 @@ class soap_server extends nusoap_base {
$this->appendDebug($this->wsdl->getDebug()); $this->appendDebug($this->wsdl->getDebug());
$this->wsdl->clearDebug(); $this->wsdl->clearDebug();
if($err = $this->wsdl->getError()){ if($err = $this->wsdl->getError()){
if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$err = $filter->xssFilterHard($err);
die('WSDL ERROR: '.$err); die('WSDL ERROR: '.$err);
} }
} }
@@ -3301,7 +3338,21 @@ class soap_server extends nusoap_base {
} }
} elseif ($data == '' && $this->wsdl) { } elseif ($data == '' && $this->wsdl) {
$this->debug("In service, there is no data, so return Web description"); $this->debug("In service, there is no data, so return Web description");
print $this->wsdl->webDescription();
if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$webDescription = $filter->xssFilterHard($this->wsdl->webDescription());
print $webDescription;
} else { } else {
$this->debug("In service, invoke the request"); $this->debug("In service, invoke the request");
$this->parse_request($data); $this->parse_request($data);

View File

@@ -257,7 +257,16 @@ class soapclientmime extends soapclient {
public function encryptOld($string) public function encryptOld($string)
{ {
return md5($string); if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
return G::encryptOld($string);
} }
} }
@@ -482,7 +491,16 @@ class nusoapservermime extends soap_server {
public function encryptOldNusoap($string) public function encryptOldNusoap($string)
{ {
return md5($string); if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
return G::encryptOld($string);
} }
} }
?> ?>

View File

@@ -865,7 +865,16 @@ class PhingFile {
public function encryptOld($string) public function encryptOld($string)
{ {
return md5($string); if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
return G::encryptOld($string);
} }
} }
?> ?>

View File

@@ -205,7 +205,16 @@ class StringHelper {
public function encryptCrc32($string) public function encryptCrc32($string)
{ {
return crc32($string); if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
return G::encryptCrc32($string);
} }
} }

View File

@@ -1939,7 +1939,16 @@ class Smarty
public function encryptCrc32($string) public function encryptCrc32($string)
{ {
return crc32($string); if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
return G::encryptCrc32($string);
} }
} }

View File

@@ -2302,7 +2302,16 @@ class Smarty_Compiler extends Smarty {
public function encryptOld($string) public function encryptOld($string)
{ {
return md5($string); if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
return G::encryptOld($string);
} }
} }

View File

@@ -98,7 +98,7 @@ class TCPDFBarcode {
header('Pragma: public'); header('Pragma: public');
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Content-Disposition: inline; filename="'.md5($code).'.svg";'); header('Content-Disposition: inline; filename="'.$this->encryptOld($code).'.svg";');
//header('Content-Length: '.strlen($code)); //header('Content-Length: '.strlen($code));
echo $code; echo $code;
} }
@@ -2280,6 +2280,20 @@ class TCPDFBarcode {
} }
return $table; return $table;
} }
public function encryptOld($string)
{
if (!class_exists('G')) {
$realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] );
$docuroot = explode( '/', $realdocuroot );
array_pop( $docuroot );
$pathhome = implode( '/', $docuroot ) . '/';
array_pop( $docuroot );
$pathTrunk = implode( '/', $docuroot ) . '/';
require_once($pathTrunk.'gulliver/system/class.g.php');
}
return G::encryptOld($string);
}
} // end of class } // end of class
//============================================================+ //============================================================+

View File

@@ -1076,7 +1076,8 @@ class adminProxy extends HttpProxyController
} else { } else {
$failed = "3"; $failed = "3";
} }
unlink ($dir . '/tmp' . $fileName); $path = $filter->xssFilterHard($dir . '/tmp' . $fileName, 'path');
unlink ($path);
} catch (Exception $e) { } catch (Exception $e) {
$failed = "3"; $failed = "3";
} }
@@ -1088,6 +1089,7 @@ class adminProxy extends HttpProxyController
} }
$uploaded = $filter->validateInput($uploaded,'int'); $uploaded = $filter->validateInput($uploaded,'int');
$files_img_type = $filter->xssFilterHard($files_img_type); $files_img_type = $filter->xssFilterHard($files_img_type);
$failed = $filter->validateInput($failed,'int');
echo '{success: true, failed: ' . $failed . ', uploaded: ' . $uploaded . ', type: "' . $files_img_type . '"}'; echo '{success: true, failed: ' . $failed . ', uploaded: ' . $uploaded . ', type: "' . $files_img_type . '"}';
exit(); exit();
} }
@@ -1236,6 +1238,11 @@ class adminProxy extends HttpProxyController
public function showLogo($imagen) public function showLogo($imagen)
{ {
$info = @getimagesize($imagen); $info = @getimagesize($imagen);
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$imagen = $filter->validateInput($imagen, "path");
$fp = fopen($imagen, "rb"); $fp = fopen($imagen, "rb");
if ($info && $fp) { if ($info && $fp) {
header("Content-type: {$info['mime']}"); header("Content-type: {$info['mime']}");
@@ -1295,6 +1302,11 @@ class adminProxy extends HttpProxyController
} }
$newDir .= PATH_SEP.$base64Id; $newDir .= PATH_SEP.$base64Id;
$dir .= PATH_SEP.$base64Id; $dir .= PATH_SEP.$base64Id;
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$dir = $filter->validateInput($dir, "path");
copy($dir,$newDir); copy($dir,$newDir);
self::showLogo($newDir); self::showLogo($newDir);
die; die;

0
workflow/engine/controllers/installer.php Executable file → Normal file
View File

View File

@@ -47,6 +47,7 @@ function RefreshDependentFields(ObjectName, Fields, InitValue) {
global $HTTP_GET_VARS; global $HTTP_GET_VARS;
if ($HTTP_SESSION_VARS['CURRENT_APPLICATION'] == '') $HTTP_SESSION_VARS['CURRENT_APPLICATION'] = '0'; if ($HTTP_SESSION_VARS['CURRENT_APPLICATION'] == '') $HTTP_SESSION_VARS['CURRENT_APPLICATION'] = '0';
$appid = $HTTP_SESSION_VARS['CURRENT_APPLICATION']; $appid = $HTTP_SESSION_VARS['CURRENT_APPLICATION'];
$appid = $filter->xssFilterHard($appid);
if ($HTTP_GET_VARS['dynaform'] != ''){ if ($HTTP_GET_VARS['dynaform'] != ''){
$Dynaform = '&__dynaform__=' . $HTTP_GET_VARS['dynaform']; $Dynaform = '&__dynaform__=' . $HTTP_GET_VARS['dynaform'];
$Dynaform = $filter->xssFilterHard($Dynaform); $Dynaform = $filter->xssFilterHard($Dynaform);

0
workflow/engine/methods/cases/cases_Ajax.php Executable file → Normal file
View File

View File

@@ -147,7 +147,8 @@ try {
$response['data'] = $result; $response['data'] = $result;
$filtersData['action'] = $filters["action"]; $filtersData['action'] = $filters["action"];
$response['totalCount'] = $list->countTotal($userUid, $filtersData); $response['totalCount'] = $list->countTotal($userUid, $filtersData);
$response = $filter->xssFilterHard($response);
echo G::json_encode($response); echo G::json_encode($response);
} catch (Exception $e) { } catch (Exception $e) {
$msg = array("error" => $e->getMessage()); $msg = array("error" => $e->getMessage());

View File

@@ -41,15 +41,16 @@ switch ($RBAC->userCanAccess('PM_SETUP_ADVANCE'))
G::LoadClass( "plugin" ); G::LoadClass( "plugin" );
G::LoadSystem('inputfilter'); G::LoadSystem('inputfilter');
$filter = new InputFilter(); $filter = new InputFilter();
$pluginName = $_REQUEST["pluginUid"]; $pluginName = $_REQUEST['pluginUid'];
$pluginName = $filter->xssFilterHard($pluginName);
if (file_exists( PATH_PLUGINS . $pluginName . ".php" )) { if (file_exists( PATH_PLUGINS . $pluginName . ".php" )) {
$pluginRegistry = &PMPluginRegistry::getSingleton(); $pluginRegistry = &PMPluginRegistry::getSingleton();
$pluginRegistry->uninstallPlugin( $pluginName ); $pluginRegistry->uninstallPlugin( $pluginName );
$path = $filter->validateInput(PATH_DATA_SITE . 'plugin.singleton', 'path');
$pluginRegistry->unSerializeInstance( file_get_contents( PATH_DATA_SITE . "plugin.singleton" ) ); $pluginRegistry->unSerializeInstance( file_get_contents( $path ) );
} }
G::auditLog("RemovePlugin","Plugin Name: ".$pluginName); G::auditLog("RemovePlugin","Plugin Name: ".$pluginName);
echo $pluginName . " " . nl2br( $filter->xssFilterHard(G::LoadTranslation( "ID_MSG_REMOVE_PLUGIN_SUCCESS" )) ); echo $pluginName . ' ' . nl2br( $filter->xssFilterHard(G::LoadTranslation( 'ID_MSG_REMOVE_PLUGIN_SUCCESS' )) );

View File

@@ -78,10 +78,10 @@ $G_PUBLISH->AddContent( 'template', '', '', '', $template );
G::RenderPage( 'publish' ); G::RenderPage( 'publish' );
if (isset( $_GET['module'] )) { if (isset( $_GET['module'] )) {
$module = $filter->xssFilterHard($_GET['module']); $module = $filter->xssFilterHard($_GET['module']);
print " print '
<script> <script>
admToolsContent.location='" . $module . "'; admToolsContent.location=\''.$module.'\';
</script> </script>
"; ';
} }