Skip to content

Commit fc4c860

Browse files
committed
xss: SLA Name
This mitigates an issue discovered by Gais Cyber Security where the SLA Name can be exploited via XSS to execute code. This sanitizes the content for `create()` and `update()` with `Format::htmlchars()` so we are safe from any XSS attempts.
1 parent de41aeb commit fc4c860

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: include/class.sla.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ static function getVarScope() {
106106
}
107107

108108
function update($vars, &$errors) {
109-
109+
$vars = Format::htmlchars($vars);
110110
if (!$vars['grace_period'])
111111
$errors['grace_period'] = __('Grace period required');
112112
elseif (!is_numeric($vars['grace_period']))
@@ -208,6 +208,7 @@ static function getIdByName($name) {
208208
}
209209

210210
static function create($vars=false, &$errors=array()) {
211+
$vars = Format::htmlchars($vars);
211212
$sla = new static($vars);
212213
$sla->created = SqlFunction::NOW();
213214
return $sla;

0 commit comments

Comments
 (0)