Skip to content

ReaderBaseJsonParser._verifyRootSpace() can cause buffer boundary failure #834

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

Closed
cowtowncoder opened this issue Oct 29, 2022 · 1 comment
Milestone

Comments

@cowtowncoder
Copy link
Member

(note: found by OSS-Fuzzer: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=52688)

Looks like there is a very rare condition on which _verifyRootspace() of ReaderBasedJsonParser (and possibly other backends) can cause a number String override. This requires:

  1. Root-level (integer) number read
  2. Input buffer ends with \r character
  3. There is enough content to be read to overwrite end of input buffer where number is fully contained

if so we can observe an "interesting" parse failure.

This is rather complicated to reproduce and test but I was able to do so for reader-based reader.

@cowtowncoder
Copy link
Member Author

NOTE: looks like byte-backed source is not affected since this relies on shared input buffer handling which is only available for char-backed sources.

@cowtowncoder cowtowncoder added this to the 2.14.0 milestone Oct 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant