-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
backport CVE-2023-6378 #747
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,20 +20,22 @@ | |
*/ | ||
public class HardenedObjectInputStream extends ObjectInputStream { | ||
|
||
final List<String> whitelistedClassNames; | ||
final static String[] JAVA_PACKAGES = new String[] { "java.lang", "java.util" }; | ||
final private List<String> whitelistedClassNames; | ||
final private static String[] JAVA_PACKAGES = new String[] { "java.lang", "java.util" }; | ||
final private static int DEPTH_LIMIT = 16; | ||
final private static int ARRAY_LIMIT = 10000; | ||
Comment on lines
+25
to
+26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Just for the record, although the PR has been already closed. No I had no merge conflict for them. The fix of this CVE has been first announced for https://logback.qos.ch/news.html#1.3.12 Which is also reflected by the GitHub Advisory board accordingly: So that I only cherry-picked the green commits below (from But apparently the fix had even much more to it than just cherry-picking as we see in bb09515. |
||
|
||
public HardenedObjectInputStream(InputStream in, String[] whilelist) throws IOException { | ||
public HardenedObjectInputStream(InputStream in, String[] whitelist) throws IOException { | ||
super(in); | ||
|
||
this.whitelistedClassNames = new ArrayList<String>(); | ||
if (whilelist != null) { | ||
for (int i = 0; i < whilelist.length; i++) { | ||
this.whitelistedClassNames.add(whilelist[i]); | ||
if (whitelist != null) { | ||
for (int i = 0; i < whitelist.length; i++) { | ||
this.whitelistedClassNames.add(whitelist[i]); | ||
} | ||
} | ||
} | ||
|
||
|
||
public HardenedObjectInputStream(InputStream in, List<String> whitelist) throws IOException { | ||
super(in); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these are currently unused, you're missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see my answer above.