@@ -362,6 +362,10 @@ public void testAntiSamyRegressionCDATAWithJavascriptURL() throws Exception {
362
362
//
363
363
// See AntiSamy GitHub issue #380 (https://github.com/nahsra/antisamy/issues/389) for more details.
364
364
//
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
+ //
365
369
// Also, this test, which originally used Validator.isValidSafeHTML(), has been
366
370
// changed to use Validator.getValidSafeHTML() instead because Validator.isValidSafeHTML()
367
371
// has been deprecated. See GitHub Security Advisory
@@ -375,7 +379,8 @@ public void testScriptTagAfterStyleClosing() throws Exception {
375
379
ValidationErrorList errors = new ValidationErrorList ();
376
380
String input = "<select<style/>W<xmp<script>alert(1)</script>" ;
377
381
// 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?)
379
384
String output = instance .getValidSafeHTML ("escaping style tag attack with script tag" , input , 250 , false , errors );
380
385
assertEquals (expected , output );
381
386
assertTrue (errors .size () == 0 );
@@ -392,6 +397,10 @@ public void testScriptTagAfterStyleClosing() throws Exception {
392
397
//
393
398
// See AntiSamy GitHub issue #380 (https://github.com/nahsra/antisamy/issues/389) for more details.
394
399
//
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
+ //
395
404
// Also, this test, which originally used Validator.isValidSafeHTML(), has been
396
405
// changed to use Validator.getValidSafeHTML() instead because Validator.isValidSafeHTML()
397
406
// has been deprecated. See GitHub Security Advisory
@@ -405,7 +414,8 @@ public void testOnfocusAfterStyleClosing() throws Exception {
405
414
String input = "<select<style/>k<input<</>input/onfocus=alert(1)>" ;
406
415
407
416
// 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?)
409
419
String output = instance .getValidSafeHTML ("escaping style tag attack with onfocus attribute" , input , 250 , false , errors );
410
420
assertEquals (expected , output );
411
421
assertTrue (errors .size () == 0 );
0 commit comments