@@ -362,6 +362,10 @@ public void testAntiSamyRegressionCDATAWithJavascriptURL() throws Exception {
362362 //
363363 // See AntiSamy GitHub issue #380 (https://github.com/nahsra/antisamy/issues/389) for more details.
364364 //
365+ // The output has changed again as of AntiSamy 1.7.5. The expected output is now:
366+ // Walert(1)
367+ // See AntiSamy Release notes for 1.7.5 (https://github.com/nahsra/antisamy/releases/tag/v1.7.5)
368+ //
365369 // Also, this test, which originally used Validator.isValidSafeHTML(), has been
366370 // changed to use Validator.getValidSafeHTML() instead because Validator.isValidSafeHTML()
367371 // has been deprecated. See GitHub Security Advisory
@@ -375,7 +379,8 @@ public void testScriptTagAfterStyleClosing() throws Exception {
375379 ValidationErrorList errors = new ValidationErrorList ();
376380 String input = "<select<style/>W<xmp<script>alert(1)</script>" ;
377381 // String expected = "W<script>alert(1)</script>"; // Before AntiSamy 1.7.4
378- String expected = "W<xmp<script>alert(1)</script>" ; // AntiSamy 1.7.4 (and later?)
382+ // String expected = "W<xmp<script>alert(1)</script>"; // AntiSamy 1.7.4
383+ String expected = "Walert(1)" ; // AntiSamy 1.7.5 (and later?)
379384 String output = instance .getValidSafeHTML ("escaping style tag attack with script tag" , input , 250 , false , errors );
380385 assertEquals (expected , output );
381386 assertTrue (errors .size () == 0 );
@@ -392,6 +397,10 @@ public void testScriptTagAfterStyleClosing() throws Exception {
392397 //
393398 // See AntiSamy GitHub issue #380 (https://github.com/nahsra/antisamy/issues/389) for more details.
394399 //
400+ // The output has changed again as of AntiSamy 1.7.5. The expected output is now:
401+ // kinput/onfocus=alert(1)>
402+ // See AntiSamy Release notes for 1.7.5 (https://github.com/nahsra/antisamy/releases/tag/v1.7.5)
403+ //
395404 // Also, this test, which originally used Validator.isValidSafeHTML(), has been
396405 // changed to use Validator.getValidSafeHTML() instead because Validator.isValidSafeHTML()
397406 // has been deprecated. See GitHub Security Advisory
@@ -405,7 +414,8 @@ public void testOnfocusAfterStyleClosing() throws Exception {
405414 String input = "<select<style/>k<input<</>input/onfocus=alert(1)>" ;
406415
407416 // String expected = "k<input/onfocus=alert(1)>"; // Before AntiSamy 1.7.4
408- String expected = "k<input<</>input/onfocus=alert(1)>" ; // AntiSamy 1.7.4 (and later?)
417+ // String expected = "k<input<</>input/onfocus=alert(1)>"; // AntiSamy 1.7.4
418+ String expected = "kinput/onfocus=alert(1)>" ; // AntiSamy 1.7.5 (and later?)
409419 String output = instance .getValidSafeHTML ("escaping style tag attack with onfocus attribute" , input , 250 , false , errors );
410420 assertEquals (expected , output );
411421 assertTrue (errors .size () == 0 );
0 commit comments