Skip to content

Commit

Permalink
Merge pull request from GHSA-xw2r-f8xv-c8xp
Browse files Browse the repository at this point in the history
add missing html attributes to be filtered against XSS
  • Loading branch information
matks authored Aug 7, 2023
2 parents 70f0344 + e3c71f2 commit fee6b0a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions classes/Validate.php
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,7 @@ public static function isCleanHtml($html, $allow_iframe = false)
$events .= '|ondragleave|ondragover|ondragstart|ondrop|onerrorupdate|onfilterchange|onfinish|onfocusin|onfocusout|onhashchange|onhelp|oninput|onlosecapture|onmessage|onmouseup|onmovestart';
$events .= '|onoffline|ononline|onpaste|onpropertychange|onreadystatechange|onresizeend|onresizestart|onrowenter|onrowexit|onrowsdelete|onrowsinserted|onscroll|onsearch|onselectionchange';
$events .= '|onselectstart|onstart|onstop|onanimationcancel|onanimationend|onanimationiteration|onanimationstart';
$events .= '|onpointerover|onpointerenter|onpointerdown|onpointermove|onpointerup|onpointerout|onpointerleave|onpointercancel|ongotpointercapture|onlostpointercapture';

if (preg_match('/<[\s]*script/ims', $html) || preg_match('/(' . $events . ')[\s]*=/ims', $html) || preg_match('/.*script\:/ims', $html)) {
return false;
Expand Down

0 comments on commit fee6b0a

Please sign in to comment.