From 74cd0a9b62f11bc07c5a1d3ba0098b54883eb0ba Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Tue, 4 Dec 2012 09:17:08 +0100 Subject: - Fix XSS vulnerability in vbscript: and data:text links handling (#1488850) --- tests/MailFunc.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests') diff --git a/tests/MailFunc.php b/tests/MailFunc.php index 967277c2a..4d4250c22 100644 --- a/tests/MailFunc.php +++ b/tests/MailFunc.php @@ -96,6 +96,20 @@ class MailFunc extends PHPUnit_Framework_TestCase $this->assertNotRegExp('/font-style:italic/', $washed, "Allow valid styles"); } + /** + * Test the elimination of some XSS vulnerabilities + */ + function test_html_xss3() + { + // #1488850 + $html = '

Firefox' + .'Internet Explorer

'; + $washed = rcmail_wash_html($html, array('safe' => true), array()); + + $this->assertNotRegExp('/data:text/', $washed, "Remove data:text/html links"); + $this->assertNotRegExp('/vbscript:/', $washed, "Remove vbscript: links"); + } + /** * Test washtml class on non-unicode characters (#1487813) */ -- cgit v1.2.3