From aebd039a61cb5135b31ab0b8d9d95ed3fb678c7b Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 26 Mar 2015 14:15:34 +0200 Subject: Add FSCommand and seekSegmentTime to evil HTML attributes list --- system/core/Security.php | 2 +- tests/codeigniter/core/Security_test.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/system/core/Security.php b/system/core/Security.php index 216f0e98b..da497762d 100644 --- a/system/core/Security.php +++ b/system/core/Security.php @@ -772,7 +772,7 @@ class CI_Security { */ protected function _remove_evil_attributes($str, $is_image) { - $evil_attributes = array('on\w*', 'style', 'xmlns', 'formaction', 'form', 'xlink:href'); + $evil_attributes = array('on\w*', 'style', 'xmlns', 'formaction', 'form', 'xlink:href', 'FSCommand', 'seekSegmentTime'); if ($is_image === TRUE) { diff --git a/tests/codeigniter/core/Security_test.php b/tests/codeigniter/core/Security_test.php index b5524da0f..3acd2a598 100644 --- a/tests/codeigniter/core/Security_test.php +++ b/tests/codeigniter/core/Security_test.php @@ -144,6 +144,8 @@ class Security_test extends CI_TestCase { $this->assertEquals('', $this->security->remove_evil_attributes('', FALSE)); $this->assertEquals('onOutsideOfTag=test', $this->security->remove_evil_attributes('onOutsideOfTag=test', FALSE)); $this->assertEquals('onNoTagAtAll = true', $this->security->remove_evil_attributes('onNoTagAtAll = true', FALSE)); + $this->assertEquals('', $this->security->remove_evil_attributes('', FALSE)); + $this->assertEquals('', $this->security->remove_evil_attributes('', FALSE)); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b