Fixed: Found a new XXE (XML External Entity Injection) vulnerability in EntityImport (OFBIZ-12304)

The XXE vulnerability can read arbitrary files on the server.

Thanks: thiscodecc for reporting this security issue (post-auth)
This commit is contained in:
Jacques Le Roux
2021-09-13 08:42:43 +02:00
parent 9b5c721c2a
commit d4297a1c29
2 changed files with 13 additions and 1 deletions
@@ -768,6 +768,18 @@ public final class UtilValidate {
return s.indexOf("://") != -1;
}
/**
* urlInString returns true if the string contains :// and not "component://"
* @param s String to validate
* @return true if s contains :// and not "component://"
*/
public static boolean urlInString(String s) {
if (isEmpty(s) || s.contains("component://")) {
return false;
}
return s.indexOf("://") != -1;
}
/**
* isValidUrl returns true if the string is a valid URL (using Commons UrlValidator)
* @param s String to validate