FasterXML / jackson-dataformats-binary

Uber-project for standard Jackson binary format backends: avro, cbor, ion, protobuf, smile
Apache License 2.0
310 stars 133 forks source link

Another uncaught exception in CBORParser._nextChunkedByte2 (by ossfuzzer) #273

Closed cowtowncoder closed 3 years ago

cowtowncoder commented 3 years ago

(note: similar to #272 reported by ossfuzz as 32912, see https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32912)

Looks like there is a problem in handling of chunked text, wherein truncated multi-byte UTF-8 code point at the end of chunk is not detected, leading to overrun (and potential ArrayIndexOutOfBoundsException).

Note that the problem is truncated UTF-8 character and not handling of adjacent chunks: as per CBOR specification, a single UTF-8 unit is NOT allowed to be split across chunks but has to align.