Skip to content

Commit afc252e

Browse files
committed
fix: upgrade Antisamy to 1.7.5 to resolve CVE-2024-23635
1 parent ddd2cda commit afc252e

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

pom.xml

+7-2
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,18 @@
243243
<dependency>
244244
<groupId>org.owasp.antisamy</groupId>
245245
<artifactId>antisamy</artifactId>
246-
<version>1.7.4</version>
246+
<version>1.7.5</version>
247247
<exclusions>
248248
<!-- excluded because we directly import newer version below. -->
249249
<exclusion>
250250
<groupId>org.slf4j</groupId>
251251
<artifactId>slf4j-api</artifactId>
252252
</exclusion>
253+
<!-- excluded because commons-beanutils imports a newer version. -->
254+
<exclusion>
255+
<groupId>commons-logging</groupId>
256+
<artifactId>commons-logging</artifactId>
257+
</exclusion>
253258
</exclusions>
254259
</dependency>
255260
<dependency>
@@ -281,7 +286,7 @@
281286
-->
282287
<groupId>commons-io</groupId>
283288
<artifactId>commons-io</artifactId>
284-
<version>2.14.0</version>
289+
<version>2.15.1</version>
285290
</dependency>
286291

287292
<!-- SpotBugs dependencies -->

src/test/java/org/owasp/esapi/reference/validation/HTMLValidationRuleCleanTest.java

+12-2
Original file line numberDiff line numberDiff line change
@@ -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&lt;script&gt;alert(1)&lt;/script&gt;"; // Before AntiSamy 1.7.4
378-
String expected = "W&lt;xmp&lt;script&gt;alert(1)&lt;/script&gt;"; // AntiSamy 1.7.4 (and later?)
382+
// String expected = "W&lt;xmp&lt;script&gt;alert(1)&lt;/script&gt;"; // 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)&gt;
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&lt;input/onfocus=alert(1)&gt;"; // Before AntiSamy 1.7.4
408-
String expected = "k&lt;input&lt;&lt;/&gt;input/onfocus=alert(1)&gt;"; // AntiSamy 1.7.4 (and later?)
417+
// String expected = "k&lt;input&lt;&lt;/&gt;input/onfocus=alert(1)&gt;"; // AntiSamy 1.7.4
418+
String expected = "kinput/onfocus=alert(1)&gt;"; // 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

Comments
 (0)