<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.5880" name=GENERATOR></HEAD>
<BODY>
<DIV>
<DIV><SPAN class=790075923-23022010><FONT face=Arial size=2>poolGrow in 
xml.parse.cpp has the following block of code:</FONT></SPAN></DIV>
<DIV><SPAN class=790075923-23022010><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=790075923-23022010>
<DIV><SPAN class=790075923-23022010><FONT face=Arial size=2>&nbsp; if 
(pool-&gt;blocks &amp;&amp; pool-&gt;start == pool-&gt;blocks-&gt;s) 
{<BR>&nbsp;&nbsp;&nbsp; int blockSize = (int)(pool-&gt;end - 
pool-&gt;start)*2;<BR>&nbsp;&nbsp;&nbsp; pool-&gt;blocks = (BLOCK 
*)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
pool-&gt;mem-&gt;realloc_fcn(pool-&gt;blocks,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
(offsetof(BLOCK, 
s)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
+ blockSize * sizeof(XML_Char)));<BR>&nbsp;&nbsp;&nbsp; if (pool-&gt;blocks == 
NULL)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return XML_FALSE;<BR>&nbsp;&nbsp;&nbsp; 
pool-&gt;blocks-&gt;size = blockSize;<BR>&nbsp;&nbsp;&nbsp; pool-&gt;ptr = 
pool-&gt;blocks-&gt;s + (pool-&gt;ptr - pool-&gt;start);<BR>&nbsp;&nbsp;&nbsp; 
pool-&gt;start = pool-&gt;blocks-&gt;s;<BR>&nbsp;&nbsp;&nbsp; pool-&gt;end = 
pool-&gt;start + blockSize;<BR>&nbsp; }<BR></FONT></SPAN></DIV>
<DIV><SPAN class=790075923-23022010><FONT face=Arial size=2>It looks like this 
will cause a memory leak if realloc_fcn returns NULL because pool-&gt;blocks 
will be overwritten but the old memory area to which it pointed won't be 
freed.</FONT></SPAN></DIV>
<DIV><SPAN class=790075923-23022010><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=790075923-23022010><FONT face=Arial size=2>The 
other&nbsp;places where reallocation is done in this file (via the REALLOC 
macro) don't have this bug because they correctly store the result in a 
temporary variable.</FONT></SPAN></DIV>
<DIV><SPAN class=790075923-23022010><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=790075923-23022010><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=790075923-23022010><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=790075923-23022010><SPAN class=184213719-24022010><FONT 
face=Arial size=2>This bug allows a serious DOS attack on a server that accepts 
XML-based requests if a request is seen of the following 
form:</FONT></SPAN></SPAN></DIV>
<DIV><SPAN class=790075923-23022010><SPAN class=184213719-24022010><FONT 
face=Arial size=2><FONT face="Times New Roman" size=3>&lt;!DOCTYPE foo 
[<BR>&lt;!ENTITY a "1234567890" &gt;<BR>&lt;!ENTITY b 
"&amp;a;&amp;a;&amp;a;&amp;a;&amp;a;&amp;a;&amp;a;&amp;a;" &gt;<BR>&lt;!ENTITY c 
"&amp;b;&amp;b;&amp;b;&amp;b;&amp;b;&amp;b;&amp;b;&amp;b;" &gt;<BR>&lt;!ENTITY d 
"&amp;c;&amp;c;&amp;c;&amp;c;&amp;c;&amp;c;&amp;c;&amp;c;" &gt;<BR>&lt;!ENTITY e 
"&amp;d;&amp;d;&amp;d;&amp;d;&amp;d;&amp;d;&amp;d;&amp;d;" &gt;<BR>&lt;!ENTITY f 
"&amp;e;&amp;e;&amp;e;&amp;e;&amp;e;&amp;e;&amp;e;&amp;e;" &gt;<BR>&lt;!ENTITY g 
"&amp;f;&amp;f;&amp;f;&amp;f;&amp;f;&amp;f;&amp;f;&amp;f;" &gt;<BR>&lt;!ENTITY h 
"&amp;g;&amp;g;&amp;g;&amp;g;&amp;g;&amp;g;&amp;g;&amp;g;" &gt;<BR>&lt;!ENTITY i 
"&amp;h;&amp;h;&amp;h;&amp;h;&amp;h;&amp;h;&amp;h;&amp;h;" &gt;<BR>&lt;!ENTITY j 
"&amp;i;&amp;i;&amp;i;&amp;i;&amp;i;&amp;i;&amp;i;&amp;i;" &gt;<BR>&lt;!ENTITY k 
"&amp;j;&amp;j;&amp;j;&amp;j;&amp;j;&amp;j;&amp;j;&amp;j;" &gt;<BR>&lt;!ENTITY l 
"&amp;k;&amp;k;&amp;k;&amp;k;&amp;k;&amp;k;&amp;k;&amp;k;" &gt;<BR>&lt;!ENTITY m 
"&amp;l;&amp;l;&amp;l;&amp;l;&amp;l;&amp;l;&amp;l;&amp;l;" &gt;<BR>&lt;!ENTITY n 
"&amp;m;&amp;m;&amp;m;&amp;m;&amp;m;&amp;m;&amp;m;&amp;m;" 
&gt;<BR>]&gt;<BR>&lt;foo 
bar="&amp;n;"/&gt;</FONT><BR></FONT></SPAN></SPAN></DIV>
<DIV><SPAN class=790075923-23022010><SPAN class=184213719-24022010><FONT 
face=Arial size=2>When the attribute is expanded, the realloc (assuming that it 
bounds the size of the request) will fail, leaking the buffer from before the 
realloc.</FONT></SPAN></SPAN></DIV>
<DIV><SPAN class=790075923-23022010><SPAN class=184213719-24022010><FONT 
face=Arial size=2></FONT></SPAN></SPAN>&nbsp;</DIV>
<DIV><SPAN class=790075923-23022010><SPAN class=184213719-24022010><FONT 
face=Arial size=2></FONT></SPAN></SPAN>&nbsp;</DIV>
<DIV><SPAN class=790075923-23022010><SPAN class=184213719-24022010><FONT 
face=Arial size=2>This bug was also present in older versions (e.g. 
1.95.8)</DIV></FONT></SPAN></SPAN></SPAN></DIV></DIV></BODY></HTML>