Closed Bug 1368276 Opened 9 years ago Closed 9 years ago

Potential integer overflow in BootAnimation.cpp with large PNG image

Categories

(Firefox OS Graveyard :: General, enhancement)

All
Gonk (Firefox OS)
enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: glennrp+bmo, Assigned: glennrp+bmo)

Details

Attachments

(1 file, 1 obsolete file)

CVE-2016-5735 describes a potential integer overflow in pngquant, when it attempts to allocate a buffer for the entire image. The PNG format limits width and height to 2^31-1, and the number of bytes per pixel can be as large as 8. The product of width*height*bytespp can exceed 2^64, leading to integer overflow, even on 64-bit platforms. While the CVE was about a particular libpng applicaton, all libpng applications that attempt to allocate an image buffer are susceptible to this vulnerability, which is disclosed in the pngquant patch and in the forthcoming libpng-1.6.30 release. Our BootAnimation.cpp suffers from this potential overflow. We should apply the same fix to BootAnimation.cpp as used in pngquant and in the libpng distribution.
Attached patch v00-1368276-bootanimation (obsolete) — Splinter Review
Assignee: nobody → glennrp+bmo
Removed "return" statement that cannot be reached after png_error().
Attachment #8872090 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Observe that the recommended check is equivalent to what we already do in image/decoders/nsPNGDecoder.cpp at line 780.
Please submit a tryserver run.
Flags: needinfo?(ryanvm)
There's no point in running this through Try. FxOS is dead and we don't even have CI for it anymore. I'm inclined to WONTFIX this and open it up - what are your thoughts, Paul?
Flags: needinfo?(ryanvm) → needinfo?(ptheriault)
Opened up once affected Firefox branches are updated with the new libpng version, of course.
There's no dependence upon libpng versions.
I'm fine with WONTFIX, given comment #6
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
Yep, I think that's appropriate. I'm not sure what timeframe comment 7 is referring to, so I'll leave this closed for now.
Flags: needinfo?(ptheriault)
comment #7 is, I suppose, referring to libpng-1.6.30 which has fixes for this vulnerability in several applications distributed with libpng but nothing in libpng proper, because libpng itself is not vulnerable. I don't know when libpng-1.6.30 will be out because there are no pressing reasons for a quick release.
Yeah, I just don't want to see us accidentally 0-day others by making this bug public too early. Let us know when we're good to do so :)
(In reply to Ryan VanderMeulen [:RyanVM] from comment #12) > Yeah, I just don't want to see us accidentally 0-day others by making this > bug public too early. Let us know when we're good to do so :) The vulnerability was publicly exposed in the pnqquant git repository nearly a year ago, and in the libpng-1.6.30beta series, the libpng mailing list, and CVE-2016-5735 recently. If you'd rather wait until libpng-1.6.30 is released, OK, but I do not see a need for that.
Group: b2g-core-security
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: