Lucene search

K
seebugRootSSV:3422
HistoryJun 14, 2008 - 12:00 a.m.

OpenOffice rtl_allocateMemory()函数堆溢出漏洞

2008-06-1400:00:00
Root
www.seebug.org
14

0.087 Low

EPSS

Percentile

93.9%

BUGTRAQ ID: 29622
CVE(CAN) ID: CVE-2008-2152

OpenOffice是个整合性的软件,包含了许多文字处理、表格、公式等办公工具。

OpenOffice的rtl_allocateMemory()函数没有执行整数溢出检查便以8字节为边界环绕分配请求,以下是sal/rtl/source/alloc_global.c中的漏洞代码:

191 void *
192 SAL_CALL rtl_allocateMemory (sal_Size n)
193 {
194 void * p = 0;
195 if (n > 0)
196 {
197 char * addr;
198 sal_Size size = RTL_MEMORY_ALIGN(n + RTL_MEMALIGN, RTL_MEMALIGN);
199
200 int index = (size - 1) >> RTL_MEMALIGN_SHIFT;
201 OSL_ASSERT(RTL_MEMALIGN >= sizeof(sal_Size));
202
203 try_alloc:
204 if (index < RTL_MEMORY_CACHED_LIMIT >> RTL_MEMALIGN_SHIFT)
205 addr = (char*)rtl_cache_alloc(g_alloc_table[index]);
206 else
207 addr = (char*)rtl_arena_alloc (gp_alloc_arena, &size);
208

在198行,如果n > UINT_MAX - RTL_MEMALIGN的话n + RTL_MEMALIGN计算就可能溢出,导致在try_alloc分配了不充分的缓冲区,然后将这个缓冲区返回给了调用函数。由于调用函数所认为缓冲区大小比实际大小大得多,因此可能触发堆溢出。

OpenOffice 2.0 - 2.4
厂商补丁:

RedHat

RedHat已经为此发布了一个安全公告(RHSA-2008:0537-01)以及相应补丁:
RHSA-2008:0537-01:Important: openoffice.org security update
链接:<a href=“https://www.redhat.com/support/errata/RHSA-2008-0537.html” target=“_blank”>https://www.redhat.com/support/errata/RHSA-2008-0537.html</a>

Sun

Sun已经为此发布了一个安全公告(Sun-Alert-237944)以及相应补丁:
Sun-Alert-237944:A Security Vulnerability in StarOffice/StarSuite 8 may allow file manipulation and Arbitrary Code execution
链接:<a href=“http://sunsolve.sun.com/search/printfriendly.do?assetkey=1-66-237944-1” target=“_blank”>http://sunsolve.sun.com/search/printfriendly.do?assetkey=1-66-237944-1</a>

OpenOffice

目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载:

<a href=“http://www.openoffice.org/” target=“_blank”>http://www.openoffice.org/</a>