You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Bruno P. Kinoshita (JIRA)" <ji...@apache.org> on 2017/08/16 01:30:00 UTC
[jira] [Commented] (IMAGING-203) JPEG segment size not validated
[ https://issues.apache.org/jira/browse/IMAGING-203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16128186#comment-16128186 ]
Bruno P. Kinoshita commented on IMAGING-203:
--------------------------------------------
Had a look at the issue description, and patch, and both look good. I'm +1 for merging it, but before doing it myself I will read the existing code and tests, as I am not completely familiar with it yet.
Thank you for providing a patch, example input and, a very detailed description in the issue. That is extremely helpful.
That said, very interesting the kelinci fuzzer. I'm creating a [list of fuzzers|https://github.com/kinow/kinoshita.eti.br/issues/46] in order to compare them, and decide which ones I could use later for Java and Python projects. Will definitely look into kelinci too. Thanks!
Bruno
> JPEG segment size not validated
> -------------------------------
>
> Key: IMAGING-203
> URL: https://issues.apache.org/jira/browse/IMAGING-203
> Project: Commons Imaging
> Issue Type: Bug
> Components: Format: JPEG
> Reporter: Rody Kersten
> Attachments: NegSegmentSize.JPG, NegSegmentSize.patch
>
>
> Using my AFL-based fuzzer for Java, Kelinci (https://github.com/isstac/kelinci) I found that a NegativeArraySizeException may be throw when attempting to read an invalid JPEG image.
> Each JPEG segment starts with a two-byte unsigned integer specifying the segment size. Segments are parsed by org.apache.commons.imaging.formats.jpeg.JpegUtils.traverseJFIF(). As the specified size includes these two bytes, the method subtracts 2 from the size before it is used. It then attempts to allocate a buffer for the segment, which fails if the specified size is 0 or 1. The method should throw an ImageReadException instead.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)