Merge pull request #1 from Mik317/master

[Fix] Semi-patched XSS on "boxbilling"
This commit is contained in:
Jamie Slome authored and GitHub committed 2020-07-03 09:11:24 +01:00
commit a6a334f81f
3 files changed
+12 -8

No files matched your search

+2 -2
View File
@@ -94,7 +94,7 @@ class Guest extends \Api_Abstract
);
$this->di['validator']->checkRequiredParamsForArray($required, $data);
$sld = $data['sld'];
$sld = htmlspecialchars($data['sld'], ENT_QUOTES | ENT_HTML5, 'UTF-8');
$validator = $this->di['validator'];
if (!$validator->isSldValid($sld)) {
throw new \Box_Exception('Domain :domain is not valid', array(':domain' => $sld));
@@ -139,4 +139,4 @@ class Guest extends \Api_Abstract
return TRUE;
}
}
}
+9 -5
View File
@@ -69,7 +69,8 @@ class Service implements \Box\InjectionAwareInterface
}
if (!$validator->isSldValid($data['owndomain_sld'])) {
throw new \Box_Exception('Domain name :domain is not valid', array(':domain' => $data['owndomain_sld']));
$safe_dom = htmlspecialchars($data['owndomain_sld'], ENT_QUOTES | ENT_HTML5, 'UTF-8');
throw new \Box_Exception('Domain name :domain is not valid', array(':domain' => $safe_dom));
}
$required = array(
@@ -85,7 +86,8 @@ class Service implements \Box\InjectionAwareInterface
}
if (!$validator->isSldValid($data['transfer_sld'])) {
throw new \Box_Exception('Domain name :domain is not valid', array(':domain' => $data['transfer_sld']));
$safe_dom = htmlspecialchars($data['transfer_sld'], ENT_QUOTES | ENT_HTML5, 'UTF-8');
throw new \Box_Exception('Domain name :domain is not valid', array(':domain' => $safe_dom));
}
$required = array(
@@ -115,7 +117,8 @@ class Service implements \Box\InjectionAwareInterface
}
if (!$validator->isSldValid($data['register_sld'])) {
throw new \Box_Exception('Domain name :domain is not valid', array(':domain' => $data['register_sld']));
$safe_dom = htmlspecialchars($data['register_sld'], ENT_QUOTES | ENT_HTML5, 'UTF-8');
throw new \Box_Exception('Domain name :domain is not valid', array(':domain' => $safe_dom));
}
$required = array(
@@ -559,7 +562,8 @@ class Service implements \Box\InjectionAwareInterface
$validator = $this->di['validator'];
if (!$validator->isSldValid($sld)) {
throw new \Box_Exception('Domain name :domain is not valid', array(':domain' => $sld));
$safe_dom = htmlspecialchars($sld, ENT_QUOTES | ENT_HTML5, 'UTF-8');
throw new \Box_Exception('Domain name :domain is not valid', array(':domain' => $safe_dom));
}
if (!$model->allow_register) {
@@ -1074,4 +1078,4 @@ class Service implements \Box\InjectionAwareInterface
}
}
}
+1 -1
View File
@@ -1487,4 +1487,4 @@ class Service implements \Box\InjectionAwareInterface
return true;
}
}
}