-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Check for trailing content when parsing JSON #5048
Check for trailing content when parsing JSON #5048
Conversation
Currently, based on #4537, since it fixes also code being added there. |
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.
LGTM with one question
core/src/test/java/org/apache/iceberg/TestSnapshotRefParser.java
Outdated
Show resolved
Hide resolved
314e6fb
to
3661c85
Compare
3661c85
to
3e684b7
Compare
Before the change, various JSON parsing routines would ignore content after a `}` matching to the opening `{` is found. This commit changes the common parsing pattern to use a newly introduced utility method which checks for trailing payload and fails if any is found.
3e684b7
to
b40c777
Compare
I think I don't know how to fix the iceberg-mr classpath to include jackson databind, with the right version. |
@findepi, what problem is this fixing? Did you see this in practice with a corrupt file? |
@rdblue thank for spending time and reviewing my PR.
I haven't. i also don't see currently that this could be exploited for security reasons
we incorrectly accept an incorrect input which ought to be rejected |
we have a bug in the library where we accept invalid JSON payloads (files) just because we stop parsing at some point. |
@danielcweeks do you have opinion about this PR? |
Before the change, various JSON parsing routines would ignore content
after a
}
matching to the opening{
is found. This commit changesthe common parsing pattern to use a newly introduced utility method
which checks for trailing payload and fails if any is found.
Follows #4537 (comment)