File tree Expand file tree Collapse file tree
logback-core/src/main/java/ch/qos/logback/core/net Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -113,6 +113,23 @@ protected Class<?> resolveClass(ObjectStreamClass anObjectStreamClass) throws IO
113113 return super .resolveClass (anObjectStreamClass );
114114 }
115115
116+ /**
117+ * There is no reason to have proxy classes in logback deserialization, so we just
118+ * throw an exception here to prevent any potential bypasses that could be achieved
119+ * through proxy classes.
120+ *
121+ * @param interfaces the list of interface names that were
122+ * deserialized in the proxy class descriptor
123+ * @return
124+ * @throws IOException
125+ * @throws ClassNotFoundException
126+ * @since 1.5.34
127+ */
128+ @ Override
129+ protected Class <?> resolveProxyClass (String [] interfaces ) throws IOException , ClassNotFoundException {
130+ throw new InvalidClassException ("Unauthorized deserialization attempt " , Arrays .toString (interfaces ));
131+ }
132+
116133 private boolean isWhitelisted (String incomingClassName ) {
117134 for (String javaClass : JAVA_CLASSES ) {
118135 if (incomingClassName .equals (javaClass ))
You can’t perform that action at this time.
0 commit comments