Bug 183677 - CVE-2006-0747 Freetype integer underflow
CVE-2006-0747 Freetype integer underflow
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: freetype (Show other bugs)
5
All Linux
medium Severity medium
: ---
: ---
Assigned To: Behdad Esfahbod
Brock Organ
source=redhat,reported=20060302,embar...
: Security
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-03-02 14:20 EST by Josh Bressers
Modified: 2008-03-10 21:01 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-03-10 21:01:29 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
testcase (4.18 KB, application/octet-stream)
2006-03-02 14:21 EST, Josh Bressers
no flags Details

  None (edit)
Description Josh Bressers 2006-03-02 14:20:14 EST
Freetype integer underflow

While fuzzing some pdf files a few weeks back, I ended up finding an
integer underflow in freetype2.  Upstream did commit some fixes, so
this issue is somewhat public.

1.ttf will generate this error.

Patches:
http://cvs.savannah.gnu.org/viewcvs/freetype/freetype2/src/pshinter/pshglob.c?r1=1.30&r2=1.31&makepatch=1&diff_format=h
http://cvs.savannah.gnu.org/viewcvs/freetype/freetype2/src/cff/cffload.c?r1=1.73&r2=1.74&makepatch=1&diff_format=h
http://cvs.savannah.gnu.org/viewcvs/freetype/freetype2/src/type1/t1load.c?r1=1.104&r2=1.105&makepatch=1&diff_format=h

The problem is the number of blue values needs to be even.  If a font
file claims it's odd, freetype2 doesn't handle it well.


The crash is seen in src/pshinter/pshglob.c:psh_blues_set_zones_0()

What was basically happening is since read_count is an unsigned
integer, and is decremented by 2, it is possible to cause an integer
underflow by ensuring the value of read_count is an odd number.  Once
read_count underflows, the loop starts dumping garbage onto the heap.
Normally I wouldn't think this is exploitable as it should crash
before anything exciting can happen, most graphical applications are
multi-threaded, so this does worry me.  At the very least this issue
is a denial of service bug.

The 2.ttf file in the testcase will also trigger a NULL pointer
dereference, which I'm not considering a secuirty issue.  The patch is
here:

http://cvs.savannah.gnu.org/viewcvs/freetype/freetype2/src/base/ftutil.c?r1=1.17&r2=1.18&makepatch=1&diff_format=h
Comment 1 Josh Bressers 2006-03-02 14:21:41 EST
Created attachment 125556 [details]
testcase
Comment 2 Josh Bressers 2006-05-15 14:01:09 EDT
Lifting embargo
Comment 3 Josh Bressers 2006-05-15 14:01:48 EDT
This issue also affects FC4

Note You need to log in before you can comment on or make changes to this bug.