[jira] [Updated] (IMAGING-203) JPEG segment size not validated

2017-12-29 Thread Bruno P. Kinoshita (JIRA)

 [ 
https://issues.apache.org/jira/browse/IMAGING-203?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bruno P. Kinoshita updated IMAGING-203:
---
Fix Version/s: 1.0

> 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
>Assignee: Bruno P. Kinoshita
> Fix For: 1.0
>
> 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)


[jira] [Updated] (IMAGING-203) JPEG segment size not validated

2017-08-15 Thread Bruno P. Kinoshita (JIRA)

 [ 
https://issues.apache.org/jira/browse/IMAGING-203?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bruno P. Kinoshita updated IMAGING-203:
---
Assignee: Bruno P. Kinoshita

> 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
>Assignee: Bruno P. Kinoshita
> 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)


[jira] [Updated] (IMAGING-203) JPEG segment size not validated

2017-08-15 Thread Rody Kersten (JIRA)

 [ 
https://issues.apache.org/jira/browse/IMAGING-203?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rody Kersten updated IMAGING-203:
-
Attachment: NegSegmentSize.JPG

Input file that triggers the exception. Found with Kelinci 
(https://github.com/isstac/kelinci).

> 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)


[jira] [Updated] (IMAGING-203) JPEG segment size not validated

2017-08-15 Thread Rody Kersten (JIRA)

 [ 
https://issues.apache.org/jira/browse/IMAGING-203?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rody Kersten updated IMAGING-203:
-
Attachment: NegSegmentSize.patch

Patch to fix the problem. Includes a unit test.

> 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.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)