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

(OFBIZ-11583)
This commit is contained in:
Jacques Le Roux
2020-04-05 11:35:33 +02:00
parent 9fa3dbe1ea
commit 5530e23738
3 changed files with 27 additions and 1 deletions
@@ -615,6 +615,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 {