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:44:43 +02:00
parent a28316b70d
commit 123f30eb6b
2 changed files with 13 additions and 1 deletions
@@ -833,6 +833,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