File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
framework/base/src/main/java/org/apache/ofbiz/base/util Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -62,9 +62,18 @@ public SafeObjectInputStream(InputStream in) throws IOException {
6262
6363 @ Override
6464 protected Class <?> resolveClass (ObjectStreamClass classDesc ) throws IOException , ClassNotFoundException {
65- if (!whitelistPattern .matcher (classDesc .getName ()).find ()) {
65+ String className = classDesc .getName ();
66+ // BlackList exploits; eg: don't allow RMI here
67+ if (className .contains ("java.rmi.server" )) {
68+ Debug .logWarning ("***Incompatible class***: "
69+ + classDesc .getName ()
70+ + ". java.rmi.server classes are not allowed for security reason" ,
71+ "SafeObjectInputStream" );
72+ return null ;
73+ }
74+ if (!whitelistPattern .matcher (className ).find ()) {
6675 // DiskFileItem, FileItemHeadersImpl are not serializable.
67- if (classDesc . getName () .contains ("org.apache.commons.fileupload" )) {
76+ if (className .contains ("org.apache.commons.fileupload" )) {
6877 return null ;
6978 }
7079 Debug .logWarning ("***Incompatible class***: "
You can’t perform that action at this time.
0 commit comments