Improved: Improve ObjectInputStream class

(OFBIZ-10837)

Fixes CVE-2019-0189

The white list was still not complete as reported by Rohit at OFBIZ-10573
This adds FlexibleStringExpander

It seems the warning in SafeObjectInputStream::resolveClass is not enough. 
Anyway I'll not change it.

Thanks: Rohit Koushal

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1855287 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacques Le Roux
2019-03-12 08:29:37 +00:00
parent 0ae26b0f88
commit 02157fa5b0
@@ -142,8 +142,9 @@ public final class UtilObject {
try (ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
SafeObjectInputStream wois = new SafeObjectInputStream(bis,
Thread.currentThread().getContextClassLoader(),
java.util.Arrays.asList("byte\\[\\]", "Number", "Long", "foo", "SerializationInjector", "java.util.HashMap", "Boolean", "Number", "Integer"));
) { // byte[] used in EntityCrypto::doDecrypt, all others used in UtilObjectTests::testGetObject
java.util.Arrays.asList("byte\\[\\]", "Number", "Long", "foo", "SerializationInjector",
"java.util.HashMap", "Boolean", "Number", "Integer", "FlexibleStringExpander"));) {
// byte[] used in EntityCrypto::doDecrypt, all others used in UtilObjectTests::testGetObject
return wois.readObject();
}
}