Fixed: Prevent Host Header Injection (CVE-2019-12425)

(OFBIZ-11583)

Conflicts handled by hand
  framework/security/config/security.properties
  framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java
This commit is contained in:
Jacques Le Roux
2020-04-05 11:40:48 +02:00
parent 84e102a6a1
commit 793628bb15
3 changed files with 28 additions and 1 deletions
@@ -598,6 +598,19 @@ public final class UtilMisc {
return LocaleHolder.availableLocaleList;
}
/** List of domains or IP addresses to be checked to prevent Host Header Injection,
* no spaces after commas,no wildcard, can be extended of course...
* @return List of domains or IP addresses to be checked to prevent Host Header Injection,
*/
public static List<String> getHostHeadersAllowed() {
String hostHeadersAllowedString = UtilProperties.getPropertyValue("security", "host-headers-allowed", "localhost");
List<String> hostHeadersAllowed = null;
if (UtilValidate.isNotEmpty(hostHeadersAllowedString)) {
hostHeadersAllowed = StringUtil.split(hostHeadersAllowedString, ",");
}
return Collections.unmodifiableList(hostHeadersAllowed);
}
/** @deprecated use Thread.sleep() */
@Deprecated
public static void staticWait(long timeout) throws InterruptedException {