<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Buffer Overflow in Apache 1.3.xx fixed on Bugtraq - the evils of strncpy and strncat!</title><link>http://blogs.msdn.com/michael_howard/archive/2004/10/29/249713.aspx</link><description>This just came in my inbox from Bugtraq, a buffer overrun processing Apache 1.3.x .htpasswd files. " local buffer overflow in htpasswd for apache 1.3.31 not fixed in .33? " at http://www.securityfocus.com/archive/1/379842/2004-10-26/2004-11-01/0 What</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Buffer Overflow in Apache 1.3.xx fixed on Bugtraq?</title><link>http://blogs.msdn.com/michael_howard/archive/2004/10/29/249713.aspx#249731</link><pubDate>Fri, 29 Oct 2004 19:54:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:249731</guid><dc:creator>Senkwe</dc:creator><description>Wow :-). Anyway I don't think that was an official fix though, just one guy &amp;quot;patching&amp;quot; his own source. I'm pretty sure this fix wouldn't have made it into the release version.</description></item><item><title>re: Buffer Overflow in Apache 1.3.xx fixed on Bugtraq - the evils of strncpy and strncat!</title><link>http://blogs.msdn.com/michael_howard/archive/2004/10/29/249713.aspx#249732</link><pubDate>Fri, 29 Oct 2004 19:58:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:249732</guid><dc:creator>Michael Howard</dc:creator><description>You are absolutely correct - this is not an Apache Group fix, and I updated the text to reflect this.</description></item><item><title>re: Buffer Overflow in Apache 1.3.xx fixed on Bugtraq - the evils of strncpy and strncat!</title><link>http://blogs.msdn.com/michael_howard/archive/2004/10/29/249713.aspx#249749</link><pubDate>Fri, 29 Oct 2004 20:35:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:249749</guid><dc:creator>Mike Dimmick</dc:creator><description>It almost looks as though that user has blindly searched for strcpy in the sources and replaced with strncpy - missing the point that strcpy *can* be safe *if-and-only-if* you've already checked the length of the string you're going to copy and you're sure it will fit. The line just above the diff context reads:&lt;br&gt;&lt;br&gt;if ((strlen(user) + 1 + strlen(cpw)) &amp;gt; (rlen - 1)) {&lt;br&gt;&lt;br&gt;where record and rlen are arguments to the function.&lt;br&gt;&lt;br&gt;Mind you, if you've done that, you might as well call memcpy - since you already know the length, there's no need to check for the null terminator, requiring only a counted copy.&lt;br&gt;&lt;br&gt;This reinforces my general feeling about open source. If this is the quality of the 'many eyes' looking at the code, how can you say that the quality will be in any way improved over commercial development - or even equal it? This user knows just enough to be dangerous.&lt;br&gt;&lt;br&gt;Even more ironic is that this code appears to be part of a user tool (also named htpasswd) for generating .htpasswd files. It could generate erroneous files, but is unlikely to be risky unless it's configured to be setuid on a UNIX system, in which case a local user could elevate their privileges. That's specifically advised against in a comment at the top of the source file.</description></item><item><title>re: Buffer Overflow in Apache 1.3.xx fixed on Bugtraq - the evils of strncpy and strncat!</title><link>http://blogs.msdn.com/michael_howard/archive/2004/10/29/249713.aspx#249772</link><pubDate>Fri, 29 Oct 2004 21:25:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:249772</guid><dc:creator>-</dc:creator><description>Someone should forbid standard C text-parsing functions. Time has demonstrated that people fall on them again and again - no matter if it's open or comercial code. C is not a bad language (&amp;quot;too simple&amp;quot; yes, &amp;quot;bad&amp;quot; no) but it seems it's _hard_ to find good C programmers (well, it's difficult to find good programmers no matter what language, that's why someone should write functions that encourage &amp;quot;good code&amp;quot;, not like strcpy which only encourages bad code)</description></item><item><title>re: Buffer Overflow in Apache 1.3.xx fixed on Bugtraq - the evils of strncpy and strncat!</title><link>http://blogs.msdn.com/michael_howard/archive/2004/10/29/249713.aspx#249785</link><pubDate>Fri, 29 Oct 2004 21:52:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:249785</guid><dc:creator>SRD</dc:creator><description>I presume the first strncpy is used because record is defined to be of size MAX_STRING_LEN. If that is the case then &lt;br&gt;strcat(record, &amp;quot;:&amp;quot;) can also be a buffer overflow (if the string length of &amp;quot;user&amp;quot; is MAX_STRING_LEN or more). Of course, if record was defined as MAX_STRING_LEN + 1 you would be fine. But I share your hatred of these function. I personally prefer using STL and using the append method myself.</description></item><item><title>re: Buffer Overflow in Apache 1.3.xx fixed on Bugtraq - the evils of strncpy and strncat!</title><link>http://blogs.msdn.com/michael_howard/archive/2004/10/29/249713.aspx#249931</link><pubDate>Sat, 30 Oct 2004 09:05:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:249931</guid><dc:creator>Saurabh Jain</dc:creator><description>Well, that's why VS 2005 CRT has secure versions of these functions. Checkout strncat_s at &lt;a target="_new" href="http://msdn2.microsoft.com/library/w6w3kbaf.aspx"&gt;http://msdn2.microsoft.com/library/w6w3kbaf.aspx&lt;/a&gt;. </description></item><item><title>re: Buffer Overflow in Apache 1.3.xx fixed on Bugtraq - the evils of strncpy and strncat!</title><link>http://blogs.msdn.com/michael_howard/archive/2004/10/29/249713.aspx#250031</link><pubDate>Sat, 30 Oct 2004 17:26:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:250031</guid><dc:creator>Smeg</dc:creator><description>Maybe its not the developer that was wrong, maybe it was his documents explaining it badly?  If you want a serious buggy spec, read WAP. I bet I can crash ANY wap gateway within SECONDS ANYTIME ANYPLACE.  IF you want proof, set up me a WAP GATEWAY and watch me crash it within microseconds.  Want to know how?  Hehehe.  EVERY WAP GATEWAY IS VULNERABLE, why? BECAUSE THE SPECS ARE SO BADLY DESIGNED and WRITTEN.</description></item><item><title>re: Buffer Overflow in Apache 1.3.xx fixed on Bugtraq - the evils of strncpy and strncat!</title><link>http://blogs.msdn.com/michael_howard/archive/2004/10/29/249713.aspx#250032</link><pubDate>Sat, 30 Oct 2004 17:25:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:250032</guid><dc:creator>Smeg</dc:creator><description>I can back up what I say.  Not only gateways, devices too.</description></item><item><title>re: Buffer Overflow in Apache 1.3.xx fixed on Bugtraq - the evils of strncpy and strncat!</title><link>http://blogs.msdn.com/michael_howard/archive/2004/10/29/249713.aspx#250033</link><pubDate>Sat, 30 Oct 2004 17:27:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:250033</guid><dc:creator>Smeg</dc:creator><description>Bad documentation means bad implementation.  WAP is a prime example of this (not to mention old MSDN docs :D)</description></item><item><title>re: Buffer Overflow in Apache 1.3.xx fixed on Bugtraq - the evils of strncpy and strncat!</title><link>http://blogs.msdn.com/michael_howard/archive/2004/10/29/249713.aspx#250435</link><pubDate>Mon, 01 Nov 2004 08:46:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:250435</guid><dc:creator>厚重之刀</dc:creator><description>It's very hard to void some bugs.</description></item><item><title>re: Buffer Overflow in Apache 1.3.xx fixed on Bugtraq - the evils of strncpy and strncat!</title><link>http://blogs.msdn.com/michael_howard/archive/2004/10/29/249713.aspx#250480</link><pubDate>Mon, 01 Nov 2004 10:28:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:250480</guid><dc:creator>Jack Mayhoff</dc:creator><description>2 words, Static analysis</description></item><item><title>re: Buffer Overflow in Apache 1.3.xx fixed on Bugtraq - the evils of strncpy and strncat!</title><link>http://blogs.msdn.com/michael_howard/archive/2004/10/29/249713.aspx#250559</link><pubDate>Mon, 01 Nov 2004 15:03:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:250559</guid><dc:creator>anonymous</dc:creator><description>you loath it or you loathe it? :-)&lt;br&gt;&lt;br&gt;Nice article.</description></item><item><title>re: Buffer Overflow in Apache 1.3.xx fixed on Bugtraq - the evils of strncpy and strncat!</title><link>http://blogs.msdn.com/michael_howard/archive/2004/10/29/249713.aspx#250620</link><pubDate>Mon, 01 Nov 2004 16:55:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:250620</guid><dc:creator>Michael Howard</dc:creator><description>That's too funny, I have to be totally honest, i *DID NOT KNOW* there were two variants. And to be accurate, I LOATHE them :)&lt;br&gt;&lt;br&gt;You learn something everyday ;)</description></item><item><title>re: Buffer Overflow in Apache 1.3.xx fixed on Bugtraq - the evils of strncpy and strncat!</title><link>http://blogs.msdn.com/michael_howard/archive/2004/10/29/249713.aspx#250621</link><pubDate>Mon, 01 Nov 2004 16:56:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:250621</guid><dc:creator>Michael Howard</dc:creator><description>&amp;gt;&amp;gt;2 words, Static analysis &lt;br&gt;One word, Education. </description></item><item><title>re: Buffer Overflow in Apache 1.3.xx fixed on Bugtraq - the evils of strncpy and strncat!</title><link>http://blogs.msdn.com/michael_howard/archive/2004/10/29/249713.aspx#250698</link><pubDate>Mon, 01 Nov 2004 19:43:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:250698</guid><dc:creator>Jack Mayhoff</dc:creator><description>Ahh because yanky doodle education is the best in the world, who would have thunk it, how much did yours cost?</description></item><item><title>re: Buffer Overflow in Apache 1.3.xx fixed on Bugtraq - the evils of strncpy and strncat!</title><link>http://blogs.msdn.com/michael_howard/archive/2004/10/29/249713.aspx#250715</link><pubDate>Mon, 01 Nov 2004 19:53:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:250715</guid><dc:creator>Michael Howard</dc:creator><description>Right now, few schools teaching secure design and coding, so the slack must be picked up by industry. Simple as that, really.</description></item><item><title>re: Buffer Overflow in Apache 1.3.xx fixed on Bugtraq - the evils of strncpy and strncat!</title><link>http://blogs.msdn.com/michael_howard/archive/2004/10/29/249713.aspx#250729</link><pubDate>Mon, 01 Nov 2004 20:02:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:250729</guid><dc:creator>Michael Howard</dc:creator><description> &amp;gt;&amp;gt;2 words, Static analysis&lt;br&gt;One word, Education.&lt;br&gt;&lt;br&gt;&lt;br&gt;Education shouldnt be capitalised after a comma. So much for education on you.</description></item><item><title>Industry needs to do more</title><link>http://blogs.msdn.com/michael_howard/archive/2004/10/29/249713.aspx#251443</link><pubDate>Wed, 03 Nov 2004 06:08:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:251443</guid><dc:creator>James</dc:creator><description>&amp;gt; Right now, few schools teaching secure design and coding, so the slack must be picked up by industry.&lt;br&gt;&lt;br&gt;Simple, sure, but experience has shown the industry is NOT doing a good enough job. The same types of bugs/exploits/problems show up over, and over, and over...&lt;br&gt;</description></item><item><title>re: Buffer Overflow in Apache 1.3.xx fixed on Bugtraq - the evils of strncpy and strncat!</title><link>http://blogs.msdn.com/michael_howard/archive/2004/10/29/249713.aspx#269276</link><pubDate>Wed, 24 Nov 2004 15:58:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:269276</guid><dc:creator>Essive</dc:creator><description>The art of programming has definitely declined in the last 10 years.  Sloppy coding practices are now the norm - due to too many self-proclaimed programmers from the .com era and vastly inexperienced offshore developers.&lt;br&gt;&lt;br&gt;When we lived in the C/C++ era the experience, tools and practices were reaching a very mature level by the early to mid-90s.</description></item><item><title>Windows Vista Security – A Bigger Picture</title><link>http://blogs.msdn.com/michael_howard/archive/2004/10/29/249713.aspx#628211</link><pubDate>Mon, 12 Jun 2006 17:44:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:628211</guid><dc:creator>Michael Howard's Web Log</dc:creator><description>A couple of people have asked about the relationship between /GS, SAL and ASLR in Windows Vista. Here’s...</description></item><item><title>Defense In Depth: The Bigger Picture of Windows Vista Security</title><link>http://blogs.msdn.com/michael_howard/archive/2004/10/29/249713.aspx#632602</link><pubDate>Thu, 15 Jun 2006 21:38:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:632602</guid><dc:creator>Robert McLaws: FunWithCoding.NET - Windows Vista Edition</dc:creator><description>Microsoft Security Expert Michael Howard provides a very technical explanation of the security strategies...</description></item><item><title> Michael Howard s Web Log Buffer Overflow in Apache 1 3 xx fixed on | Paid Surveys</title><link>http://blogs.msdn.com/michael_howard/archive/2004/10/29/249713.aspx#9656699</link><pubDate>Fri, 29 May 2009 22:48:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9656699</guid><dc:creator> Michael Howard s Web Log Buffer Overflow in Apache 1 3 xx fixed on | Paid Surveys</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://paidsurveyshub.info/story.php?title=michael-howard-s-web-log-buffer-overflow-in-apache-1-3-xx-fixed-on"&gt;http://paidsurveyshub.info/story.php?title=michael-howard-s-web-log-buffer-overflow-in-apache-1-3-xx-fixed-on&lt;/a&gt;&lt;/p&gt;
</description></item></channel></rss>