Closed Bug 413373 Opened 17 years ago Closed 17 years ago

Crash [@nsGIFDecoder2::DoLzw] when loading GIF file

Categories

(Core :: Graphics: ImageLib, defect, P2)

x86
Windows XP
defect

Tracking

()

VERIFIED FIXED
mozilla1.9beta3

People

(Reporter: pvnick, Assigned: alfredkayser)

References

Details

(Keywords: crash)

Crash Data

Attachments

(3 files)

Attached image Testcase
The attached GIF file crashes the browser in a way that doesn't look exploitable. I hope no-one needs a reduced version, because I wouldn't know how to produce that.
Attached file Stacktrace
Also, this doesn't seem to crash branch.
Blocks: fuzz-JSFF
Can't reproduce the crash on Linux/64bit/trunk. I get WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005: file mozilla/modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp, line 244
confirming with a 1 day old SM trunk and FF3.0b2 on win32
Keywords: crash
Traced it down to a specific malformed LZW stream issue. In essence in the input stream there is an illegal code that is outside the valid range. Note, Opera can read the image, but all other image tools (that I have) refuse to load it. The fix is simple: before using 'code' as index in 'suffix' make sure it is within range of 'suffix'. If not, the image has to be considered 'illegal'.
Assignee: nobody → alfredkayser
Status: NEW → ASSIGNED
Attachment #298451 - Flags: superreview?(tor)
Attachment #298451 - Flags: review?(pavlov)
Attachment #298451 - Flags: superreview?(tor) → superreview+
Keywords: checkin-needed
Attachment #298451 - Flags: review?(pavlov) → review+
Flags: blocking1.9?
Attachment #298451 - Flags: approval1.9?
Need approval first since this isn't a blocker.
Keywords: checkin-needed
Comment on attachment 298451 [details] [diff] [review] Patch to detect malformed LZW encoding a=beltzner for 1.9
Attachment #298451 - Flags: approval1.9? → approval1.9+
Keywords: checkin-needed
Flags: blocking1.9? → blocking1.9+
Priority: -- → P2
Checking in modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp; /cvsroot/mozilla/modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp,v <-- nsGIFDecoder2.cpp new revision: 1.93; previous revision: 1.92 done
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9 M11
Flags: wanted1.8.1.x-
verified fixed using Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9b4pre) Gecko/2008020819 Minefield/3.0b4pre and the testcase from this bug - no crash on this testcase -> Verified fixed
Status: RESOLVED → VERIFIED
Crash Signature: [@nsGIFDecoder2::DoLzw]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: