Skip to content

Commit 508677c

Browse files
committed
1 parent 280fe74 commit 508677c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

system/core/Security.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -604,12 +604,12 @@ protected function _compact_exploded_words($matches)
604604
protected function _remove_evil_attributes($str, $is_image)
605605
{
606606
// All javascript event handlers (e.g. onload, onclick, onmouseover), style, and xmlns
607-
$evil_attributes = array('on\w*', 'style', 'xmlns', 'formaction');
607+
$evil_attributes = array('(?<!\w)on\w*', 'style', 'xmlns', 'formaction');
608608

609609
if ($is_image === TRUE)
610610
{
611611
/*
612-
* Adobe Photoshop puts XML metadata into JFIF images,
612+
* Adobe Photoshop puts XML metadata into JFIF images,
613613
* including namespacing, so we have to allow this for images.
614614
*/
615615
unset($evil_attributes[array_search('xmlns', $evil_attributes)]);
@@ -872,4 +872,4 @@ protected function _csrf_set_hash()
872872
}
873873

874874
/* End of file Security.php */
875-
/* Location: ./system/libraries/Security.php */
875+
/* Location: ./system/libraries/Security.php */

user_guide/changelog.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ <h3>Bug fixes:</h3>
6565
<li>Fixed a bug (#3094) - <samp>CI_Input::_clean_input_data()</samp> breaks encrypted session cookies.</li>
6666
<li>Fixed a bug (#2508) - <a href="libraries/config.html">Config Library</a> didn't properly detect if the current request is via HTTPS.</li>
6767
<li>Fixed a bug (#3314) - SQLSRV <a href="database/index.html">Database driver</a>'s method <samp>count_all()</samp> didn't escape the supplied table name.</li>
68+
<li>Fixed a bug (#3309) - <samp>CI_Security::xss_clean()</samp> used an overly-invasive pattern to strip JS event handlers.</li>
6869
</ul>
6970

7071
<h2>Version 2.2.0</h2>

0 commit comments

Comments
 (0)