Skip to content

Commit 4c4ea2f

Browse files
committed
SAS-1673
- removed vulnerable dependency from CC
1 parent ee238a2 commit 4c4ea2f

259 files changed

Lines changed: 1831 additions & 2024 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Agent Builder Starter App.mpr

0 Bytes
Binary file not shown.

javasource/communitycommons/StringUtils.java

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
import org.apache.commons.io.IOUtils;
3939
import org.apache.commons.io.input.BOMInputStream;
4040
import org.apache.commons.text.StringEscapeUtils;
41-
import org.owasp.html.PolicyFactory;
42-
import org.owasp.html.Sanitizers;
4341
import system.proxies.FileDocument;
4442

4543
public class StringUtils {
@@ -53,16 +51,6 @@ public class StringUtils {
5351
static final String SPECIAL = stringRange('!', '/');
5452
private static final String ALPHANUMERIC = UPPERCASE_ALPHA + LOWERCASE_ALPHA + DIGITS;
5553

56-
static final Map<String, PolicyFactory> SANITIZER_POLICIES =
57-
Map.ofEntries(
58-
new SimpleEntry<>(BLOCKS.name(), Sanitizers.BLOCKS),
59-
new SimpleEntry<>(FORMATTING.name(), Sanitizers.FORMATTING),
60-
new SimpleEntry<>(IMAGES.name(), Sanitizers.IMAGES),
61-
new SimpleEntry<>(LINKS.name(), Sanitizers.LINKS),
62-
new SimpleEntry<>(STYLES.name(), Sanitizers.STYLES),
63-
new SimpleEntry<>(TABLES.name(), Sanitizers.TABLES)
64-
);
65-
6654
public static final String HASH_ALGORITHM = "SHA-256";
6755

6856
public static String hash(String value) throws NoSuchAlgorithmException, DigestException {
@@ -484,25 +472,6 @@ public static String removeEnd(String str, String toRemove) {
484472
return org.apache.commons.lang3.StringUtils.removeEnd(str, toRemove);
485473
}
486474

487-
public static String sanitizeHTML(String html, List<SanitizerPolicy> policyParams) {
488-
PolicyFactory policyFactory = null;
489-
490-
for (SanitizerPolicy param : policyParams) {
491-
PolicyFactory policyFactoryForParam = SANITIZER_POLICIES.get(param.name());
492-
policyFactory = (policyFactory == null) ? policyFactoryForParam : policyFactory.and(policyFactoryForParam);
493-
}
494-
495-
if (policyFactory == null) {
496-
throw new IllegalArgumentException("Sanitizer policy not found.");
497-
}
498-
499-
return sanitizeHTML(html, policyFactory);
500-
}
501-
502-
public static String sanitizeHTML(String html, PolicyFactory policyFactory) {
503-
return policyFactory.sanitize(html);
504-
}
505-
506475
public static String stringSimplify(String value) {
507476
String normalized = Normalizer.normalize(value, Normalizer.Form.NFD);
508477
return normalized.replaceAll("\\p{M}", ""); // removes all characters in Unicode Mark category

javasource/communitycommons/actions/XSSSanitize.java

Lines changed: 0 additions & 104 deletions
This file was deleted.

mprcontents/30/05/30055109-5f26-4f10-a9a9-b1776f8bbbb1.mxunit renamed to mprcontents/00/ca/00ca7fdf-988d-4bbc-afd2-f180143d031c.mxunit

1.22 KB
Binary file not shown.
587 Bytes
Binary file not shown.
1.5 KB
Binary file not shown.
-466 Bytes
Binary file not shown.

mprcontents/34/29/3429e57c-ef79-4ee5-b9c9-b89f66a4b479.mxunit renamed to mprcontents/05/4b/054b76cc-6f77-4ef2-a97d-ad369e578dd5.mxunit

2.44 KB
Binary file not shown.
80 Bytes
Binary file not shown.
-1.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)