Skip to content

Commit

Permalink
Add more event handlers to sanitize
Browse files Browse the repository at this point in the history
  • Loading branch information
kksidd committed Apr 13, 2019
1 parent 3673576 commit 9a929c9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions couch/parser/HTMLParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ function sanitize( $val ){

// invalidate other dangerous words
// https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet
// https://gist.github.com/kurobeats/9a613c9ab68914312cbb415134795b45
$ra2 = array(
'fscommand', 'onabort', 'onactivate', 'onafterprint', 'onafterupdate', 'onbeforeactivate',
'onbeforecopy', 'onbeforecut', 'onbeforedeactivate', 'onbeforeeditfocus',
Expand All @@ -204,6 +205,8 @@ function sanitize( $val ){
'datafld', 'dataformatas', 'datasrc', 'binding', 'behavior',
'onformchange', 'onforminput', 'formaction', 'oninput', 'dirname', 'pattern', 'mhtml:',
'onhashchange', 'onmessage', 'onoffline', 'ononline', 'onpagehide', 'onpageshow', 'onpopstate', 'onstorage', 'onundo', 'onredo',
'oninvalid', 'onsearch', 'onwheel', 'oncanplay', 'oncuechange', 'ondurationchange', 'onemptied', 'onplay', 'onratechange',
'onstalled', 'onsuspend', 'ontimeupdate', 'onvolumechange', 'onwaiting', 'onshow', 'ontoggle',
);

for( $i = 0; $i < count($ra2); $i++ ){
Expand Down

0 comments on commit 9a929c9

Please sign in to comment.