aboutsummaryrefslogtreecommitdiffstats
path: root/common-app-api/src
diff options
context:
space:
mode:
authoraribeiro <anderson.ribeiro@est.tech>2021-02-15 17:24:11 +0000
committerChristophe Closset <christophe.closset@intl.att.com>2021-03-16 13:27:37 +0000
commit7010ea90e14305837a30764db8a5e4bc1338e378 (patch)
tree31a674fad95261e123e1cd2348f24c11f51373c4 /common-app-api/src
parent77680c6f9d99adcf5c6a97380043f1d86b0d46fa (diff)
Fix Security Vulnerabilities
Issue-ID: SDC-3500 Signed-off-by: aribeiro <anderson.ribeiro@est.tech> Change-Id: I3fa2ed2bc3a170d8256fbc91c98bbfbaf5c0a403
Diffstat (limited to 'common-app-api/src')
-rw-r--r--common-app-api/src/main/java/org/openecomp/sdc/common/util/ValidationUtils.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/common-app-api/src/main/java/org/openecomp/sdc/common/util/ValidationUtils.java b/common-app-api/src/main/java/org/openecomp/sdc/common/util/ValidationUtils.java
index 375f041e81..1a9cb26a0f 100644
--- a/common-app-api/src/main/java/org/openecomp/sdc/common/util/ValidationUtils.java
+++ b/common-app-api/src/main/java/org/openecomp/sdc/common/util/ValidationUtils.java
@@ -585,4 +585,15 @@ public class ValidationUtils {
public static boolean validateForwardingPathNamePattern(String forwardingPathName) {
return FORWARDING_PATH_NAME_PATTERN.matcher(forwardingPathName).matches();
}
+
+ public static String sanitizeInputString(String input) {
+ if (StringUtils.isNotEmpty(input)) {
+ input = ValidationUtils.removeNoneUtf8Chars(input);
+ input = ValidationUtils.removeHtmlTags(input);
+ input = ValidationUtils.normaliseWhitespace(input);
+ input = ValidationUtils.stripOctets(input);
+ }
+ return input;
+ }
+
}