fix: confusing semantics for ValidatingObjectInputStream#859
Draft
raboof wants to merge 1 commit into
Draft
Conversation
Before Commons IO 2.21.0: * Rejecting an interface had no effect * Rejecting a class would reject objects of all subclasses as well * Accepting an interface had no effect * Accepting a class would accept objects only if all superclasses were accepted as well After Commons IO 2.21.0: * Rejecting an interface had no effect on regular objects, but would reject proxy classes implementing that interface * Rejecting a class would reject objects of all subclasses as well * Accepting an interface had no effect on regular objects, but would accept proxy classes implementing that interface * Accepting a class would accept objects only if all superclasses were accepted as well That seems rather inconsistent. The logic change in this PR makes things slightly more consistent, but is a backwards-incompatible change (since it means applications using an allowist but not including the interfaces in it would stop accepting previously-accepted objects). It seems generally odd that allowlisting a class will not actually accept it without additionally accepting its superclasses (and implemented interfaces). Perhaps ValidatingObjectInputStream should either not take into account interfaces/superclasses at all, or do so in a more sophisticated fashion. Before making decisions we should also investigate how JVM11's ObjectInputFilterConfig behaves. That may inform what would make sense for us, and it would be good to document the differences. Co-Authored-By: Gary Gregory <garydgregory@gmail.com>
Member
|
Hello @raboof |
Member
Author
|
Well yes it's 'draft' for a reason - this PR is mainly here to start the public conversation on what this should behave like, it's not meant as a finished product yet. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before Commons IO 2.21.0:
After Commons IO 2.21.0:
That seems rather inconsistent.
The logic change in this PR makes things slightly more consistent, but is a backwards-incompatible change (since it means applications using an allowist but not including the interfaces in it would stop accepting previously-accepted objects).
It seems generally odd that allowlisting a class will not actually accept it without additionally accepting its superclasses (and implemented interfaces).
Perhaps ValidatingObjectInputStream should either not take into account interfaces/superclasses at all, or do so in a more sophisticated fashion.
Before making decisions we should also investigate how JVM11's ObjectInputFilterConfig behaves. That may inform what would make sense for us, and it would be good to document the differences.
Thanks for your contribution to Apache Commons! Your help is appreciated!
Before you push a pull request, review this list:
mvn; that'smvnon the command line by itself.