[Webkit-unassigned] [Bug 112099] New: GIF decoder can read off end of buffer

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 11 20:07:14 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=112099

           Summary: GIF decoder can read off end of buffer
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Images
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: pkasting at google.com
                CC: hclam at google.com


Noticed while reviewing various GIF decoder patches.  hclam -- want to fix this while you're touching this stuff?

The bug is that the GIFNetscapeExtensionBlock state of the parser reads the block length from the image file, but then the GIFConsumeNetscapeExtension assumes the block length is at least the 3 that the spec requires.  Therefore, an image can specify "1" or "2" here and then end after that many more bytes, and the parser will happily read another two or one bytes off the end of the buffer.

I believe the correct fix is that the GIFNetscapeExtensionBlock state should call GETN(std::max(3, *currentComponent), GIFConsumeNetscapeExtension);.  A comment explaining this wouldn't be amiss.

I suspect Gecko has the same problem.

The Chrome security guys looked at this and declared it not a security bug, since there seems to be no way to use this OOB read to malicious effect (since it just controls the image loop count).

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list