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

(OFBIZ-11583)
This commit is contained in:
Jacques Le Roux
2020-04-04 19:32:02 +02:00
parent ba548f626e
commit e0f0d5271a
3 changed files with 26 additions and 0 deletions
@@ -604,6 +604,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 {