Skip to content

Commit

Permalink
N°6282 Fix XSS vulnerability in soap (#690)
Browse files Browse the repository at this point in the history
* N°6282 Fix XSS vulnerability in soap
  • Loading branch information
Timmy38 authored Dec 19, 2024
1 parent 30ef273 commit 42f3914
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion webservices/itopsoap.examples.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*/

require_once('itopsoaptypes.class.inc.php');
$sItopRoot = 'http'.(utils::IsConnectionSecure() ? 's' : '').'://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/..';
$sItopRoot = 'http://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['SCRIPT_NAME']).'/..';
$sWsdlUri = $sItopRoot.'/webservices/itop.wsdl.php';
//$sWsdlUri .= '?service_category=';

Expand Down
9 changes: 5 additions & 4 deletions webservices/soapserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@

// this file is generated dynamically with location = here
$sWsdlUri = utils::GetAbsoluteUrlAppRoot().'webservices/itop.wsdl.php';
if (isset($_REQUEST['service_category']) && (!empty($_REQUEST['service_category'])))
$sServiceCategory = utils::ReadParam('service_category');
if (!empty($sServiceCategory))
{
$sWsdlUri .= "?service_category=".$_REQUEST['service_category'];
$sWsdlUri .= "?service_category=".$sServiceCategory;
}


Expand All @@ -43,9 +44,9 @@
)
);
// $oSoapServer->setPersistence(SOAP_PERSISTENCE_SESSION);
if (isset($_REQUEST['service_category']) && (!empty($_REQUEST['service_category'])))
if (!empty($sServiceCategory))
{
$sServiceClass = $_REQUEST['service_category'];
$sServiceClass = $sServiceCategory;
if (!class_exists($sServiceClass))
{
// not a valid class name (not a PHP class at all)
Expand Down

0 comments on commit 42f3914

Please sign in to comment.