openoffice.org: Invalid range checking in DOC header parsing leading to possible heap overflow
Bug #15461 reported by
Debian Bug Importer
This bug report is a duplicate of:
Bug #15434: CAN-2005-0941: "OpenOffice DOC document Heap Overflow".
Edit
Remove
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
openoffice.org (Debian) |
Fix Released
|
Unknown
|
|||
openoffice.org (Ubuntu) |
Invalid
|
High
|
Matthias Klose |
Bug Description
Automatically imported from Debian bug report #304469 http://
CVE References
Changed in openoffice.org: | |
status: | Unknown → Fix Released |
To post a comment you must log in.
Message-Id: <email address hidden>
Date: Wed, 13 Apr 2005 14:08:39 +0200
From: Moritz Muehlenhoff <email address hidden>
To: Debian Bug Tracking System <email address hidden>
Subject: openoffice.org: Invalid range checking in DOC header parsing leading to
possible heap overflow
Package: openoffice.org
Version: 1.1.3-8
Severity: grave
Tags: security
Justification: user security hole
Lee Xioajun <email address hidden> reported an issue with invalid input
checks in DOC header parsing, which can possibly be exploited with remote
code execution. I'm including his advisory verbose, as I could not find a
WWW reference for it. The relevant issue #s seems to be 46276 and 46388.
It's supposed to be fixed upstream, but I couldn't find it in the plethora
of CVS modules and subprojects.
Cheers,
Moritz
OpenOffice DOC document Heap Overflow
[Security Advisory]
Advisory: [AD_LAB- 05001] OpenOffice DOC document Heap Overflow
Class: Design Error
DATE:30/3/2005
CVEID:CAN-2005-0941
Vulnerable:
<=OpenOffice OpenOffice 1.1.4
-OpenOffice OpenOffice 2.0dev
Unvulnerable: e.org
Unknow
Vendor:
www.openoffic
I.DESCRIPTION:
-------------
OpenOffice.org is an office productivity suite, including word
processing, spreadsheets, presentations, drawings, data charting,
formula editing, and file conversion facilities.
The vulnerability is caused due to a error within the .Doc document header
processing.This can be exploited to cause a heap-based buffer overflow.
II.DETAILS: m::Load( ) function,
----------
There is a vulnerability in StgCompObjStrea
When reading DOC document information of format,memory is allocated by DOC provide length.
DOC provided a 32 bits integer,and will use the low 16 bits of this number to allocate memory,
but when reading doc information,still use the 32 bits number as length,this maybe cause heap
overflow, and when free happened ,will cause write pointer,maybe cause arbitrary code excute .
BOOL StgCompObjStrea m::Load( ) xtEncoding( ) ); rmat( *this ); GENERALERROR );
{
memset( &aClsId, 0, sizeof( ClsId ) );
nCbFormat = 0;
aUserName.Erase();
if( GetError() != SVSTREAM_OK )
return FALSE;
Seek( 8L );
INT32 nMarker = 0;
*this >> nMarker;
if( nMarker == -1L )
{
*this >> aClsId;
INT32 nLen1 = 0;
*this >> nLen1; // we can control this 32 bits int
sal_Char* p = new sal_Char[ (USHORT) nLen1 ]; //use low 16 bits value to allocate memory
if( Read( p, nLen1 ) == (ULONG) nLen1 ) //still use 32 bits int as length,if failed,
// will goto free step,maybe cause write pointer.
{
aUserName = String( p, gsl_getSystemTe
....
nCbFormat = ReadClipboardFo
}
else
SetError( SVSTREAM_
delete [] p; //free step,heap overflow cause write pointer.
}
return BOOL( GetError() == SVSTREAM_OK );
}
example:
if we provide 0x10000018 to nLen1,will allocate 0x18 length memory,
Read( p, nLen1 ) still use 0x10000018 as length,then, read will fail,
but readed length is bigger than allocated memory,and overwrite the next chunk.
when goto delete [] p;,write pointer happened. we had triggered this problem successful.
StartOffice maybe affected too. did not test.
III.CREDIT:
-------...