Uploaded image for project: 'Commons Imaging'
  1. Commons Imaging
  2. IMAGING-222

JPEG segment size not validated

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • None
    • 1.0-alpha1
    • Format: JPEG
    • None

    Description

      Using my AFL-based fuzzer for Java. I found that a NegativeArraySizeException may be throw when attempting to read an invalid JPEG image.

      public void traverseJFIF(final ByteSource byteSource, final Visitor visitor)
                  throws ImageReadException,
                  IOException {
              try (InputStream is = byteSource.getInputStream()) {
                  readAndVerifyBytes(is, JpegConstants.SOI,
                          "Not a Valid JPEG File: doesn't begin with 0xffd8");
      .....
      

      I think you should add the handle NegativeArraySizeException exception

      Attachments

        1. NegSegment.jpg
          0.0 kB
          Le Huu Quang Linh

        Activity

          People

            kinow Bruno P. Kinoshita
            linhlhq Le Huu Quang Linh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: