<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>Advogato blog for argp</title>
    <link>http://www.advogato.org/person/argp/</link>
    <description>Advogato blog for argp</description>
    <language>en-us</language>
    <generator>mod_virgule</generator>
    <pubDate>Thu, 18 Mar 2010 14:51:11 GMT</pubDate>
    <item>
      <pubDate>Sun, 21 Feb 2010 17:53:22 GMT</pubDate>
      <title>21 Feb 2010</title>
      <link>http://www.advogato.org/person/argp/diary.html?start=36</link>
      <guid>http://www.advogato.org/person/argp/diary.html?start=36</guid>
      <description>&lt;p&gt;
&lt;b&gt;&lt;a href="http://argp.gr/blog/" &gt;argp.gr/blog&lt;/a&gt;&lt;/b&gt;
&lt;p&gt;
I have moved my blog to &lt;a href="http://argp.gr/blog/" &gt;http://argp.gr/blog/&lt;/a&gt;.
Please update your RSS reader's entry since I will no longer be directly
updating my Advogato diary.  The new feed is &lt;a href="http://argp.gr/blog/feed/" &gt;here&lt;/a&gt;.
</description>
    </item>
    <item>
      <pubDate>Sun, 7 Feb 2010 17:48:04 GMT</pubDate>
      <title>7 Feb 2010</title>
      <link>http://www.advogato.org/person/argp/diary.html?start=35</link>
      <guid>http://www.advogato.org/person/argp/diary.html?start=35</guid>
      <description>&lt;p&gt;
&lt;b&gt;exploit for CVE-2010-0453&lt;/b&gt;
&lt;p&gt;
While playing today with kmdb on OpenSolaris I wrote a denial of
service (kernel panic) PoC exploit for the UCODE_GET_VERSION ioctl
NULL pointer dereference vulnerability.  The vulnerability was
discovered by Tobias Klein who always publishes very detailed
advisories:
&lt;p&gt;
&lt;a href="http://www.trapkit.de/advisories/TKADV2010-001.txt" &gt;
http://www.trapkit.de/advisories/TKADV2010-001.txt&lt;/a&gt;
&lt;p&gt;
You can get my exploit from:
&lt;p&gt;
&lt;a href="http://census-labs.com/media/cve-2010-0453.c" &gt;
http://census-labs.com/media/cve-2010-0453.c&lt;/a&gt;
</description>
    </item>
    <item>
      <pubDate>Wed, 6 Jan 2010 15:52:02 GMT</pubDate>
      <title>6 Jan 2010</title>
      <link>http://www.advogato.org/person/argp/diary.html?start=34</link>
      <guid>http://www.advogato.org/person/argp/diary.html?start=34</guid>
      <description>&lt;p&gt;
&lt;b&gt;first 2010 0day&lt;/b&gt;
&lt;p&gt;
md5: e8d5dd9d6cdf8602f12c8baef53f6550&lt;br&gt;
sha1: 1322d45eed25260a0d5f85284011e1b205328807&lt;br&gt;
sha256: eb4f95ec1b62d57e022c6945bdcb3f747f94f3ad7ddedc4bfde7dee23d4362ef&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Thu, 24 Dec 2009 15:04:46 GMT</pubDate>
      <title>24 Dec 2009</title>
      <link>http://www.advogato.org/person/argp/diary.html?start=33</link>
      <guid>http://www.advogato.org/person/argp/diary.html?start=33</guid>
      <description>&lt;p&gt;
&lt;b&gt;xmas 2009 0day&lt;/b&gt;
&lt;p&gt;
md5: a145ed9d7e1c33124daab40447cc5b56&lt;br&gt;
sha1: c888985f209c26243206f8864783500b0c9353bb&lt;br&gt;
sha256: 27cbcd01cf0e1b6a2ba82d4c0209a791957a3c1c29c131b0208f77981a1a81aa&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Mon, 14 Dec 2009 11:19:19 GMT</pubDate>
      <title>Monkey HTTPd improper input validation vulnerability</title>
      <link>http://www.advogato.org/person/argp/diary.html?start=32</link>
      <guid>http://www.census-labs.com/news/2009/12/14/monkey-httpd/</guid>
      <description>&lt;table&gt;
&lt;tr&gt;&lt;td&gt;census ID:&lt;/td&gt;&lt;td&gt;census-2009-0004&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Affected Products:&lt;/td&gt;&lt;td&gt;Monkey web server versions  &amp;le; 0.9.2.&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt;&lt;td&gt;Class:&lt;/td&gt;&lt;td&gt;Improper Input Validation (&lt;a href="http://cwe.mitre.org/data/definitions/20.html" &gt;CWE-20&lt;/a&gt;), Incorrect Calculation (&lt;a href="http://cwe.mitre.org/data/definitions/682.html" &gt;CWE-682&lt;/a&gt;)&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt;&lt;td&gt;Remote:&lt;/td&gt;&lt;td&gt;Yes&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Discovered by:&lt;/td&gt;&lt;td&gt;Patroklos Argyroudis&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;
We have discovered a remotely exploitable &amp;#8220;improper input validation&amp;#8221; vulnerability in the Monkey web server that allows an attacker to perform denial of service attacks by repeatedly crashing worker threads that process HTTP requests.
&lt;/p&gt;

&lt;!--more--&gt;

&lt;h3&gt;Details&lt;/h3&gt;

&lt;p&gt;
&lt;a href="http://www.monkey-project.com/" &gt;Monkey&lt;/a&gt; is a fast, efficient, small and easy to configure HTTP/1.1 compliant web server. It has been designed to be scalable with low memory and CPU consumption. More information about its features can be found &lt;a href="http://www.monkey-project.com/about" &gt;here&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
Monkey (up to and including version 0.9.2) employs an insufficient input validation method for handling HTTP requests with invalid connection headers. Specifically, the vulnerability is in the calculation for the end of the request body buffer related to newline characters in function &lt;tt&gt;Request_Find_Variable()&lt;/tt&gt; in the file &lt;tt&gt;src/request.c&lt;/tt&gt;:
&lt;/p&gt;

&lt;pre&gt;&lt;code class="cpp"&gt;364: char *Request_Find_Variable(char *request_body,  char *string)
365: {
366:   int pos_init_var=0, pos_end_var=0;
367:   char *var_value = 0;
368:
369:   /* Existe *string en request_body ??? */        
370:   if (strstr2(request_body, string) == NULL)
371:       return NULL;
372:
373:   pos_init_var = str_search(request_body, string, strlen(string));
374:   pos_end_var = str_search(request_body+pos_init_var, "\n", 1) &amp;mdash; 1;
375:
376:   if(pos_init_var&lt;=0 || pos_end_var&lt;=0){
377:       return  NULL;   
378:   }
379:
380:   pos_init_var += strlen(string) + 1;
381:   pos_end_var = (unsigned int) (pos_init_var  + pos_end_var)
                                &amp;mdash; (strlen(string) +1);
382:
383:   var_value = m_copy_string(request_body, pos_init_var, pos_end_var);
384:
385:   return (char *) var_value;
386: }
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
With a specially crafted request body the &lt;tt&gt;pos_init_var&lt;/tt&gt; integer can take the value &lt;tt&gt;0x1c&lt;/tt&gt; (&lt;tt&gt;28&lt;/tt&gt; in decimal) and the
&lt;tt&gt;pos_end_var&lt;/tt&gt; integer can take the value &lt;tt&gt;0x1a&lt;/tt&gt; (&lt;tt&gt;26&lt;/tt&gt; in decimal). Then in the &lt;tt&gt;m_copy_string()&lt;/tt&gt; function, the calculation for the unsigned integer &lt;tt&gt;size&lt;/tt&gt; in line 428 (file &lt;tt&gt;src/utils.c&lt;/tt&gt;) leads to a signedness bug and &lt;tt&gt;m_copy_string()&lt;/tt&gt; returns NULL (line 438, file &lt;tt&gt;src/utils.c&lt;/tt&gt;):
&lt;/p&gt;

&lt;pre&gt;&lt;code class="cpp"&gt;423: char *m_copy_string(const char *string, int pos_init, int pos_end)
424: {
425:   unsigned int size, bytes;
426:   char *buffer=0;
427:
428:   size = (unsigned int) (pos_end &amp;mdash; pos_init ) + 1;
429:   if(size&lt;=2) size=4;
430:
431:   buffer = M_malloc(size);
432:
433:   if(!buffer){
434:       return NULL;
435:   }
436:
437:   if(pos_end&gt;strlen(string) || (pos_init &gt; pos_end)){
438:       return NULL;
439:   }
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
This causes &lt;tt&gt;Request_Find_Variable()&lt;/tt&gt; to return NULL (line 344, file &lt;tt&gt;src/request.c&lt;/tt&gt;) and this to be used in the &lt;tt&gt;strstr2()&lt;/tt&gt; call at line 345 of file &lt;tt&gt;src/request.c&lt;/tt&gt;:
&lt;/p&gt;

&lt;pre&gt;&lt;code class="cpp"&gt;344:   sr-&gt;connection = Request_Find_Variable(request_body, RH_CONNECTION);
345:   if((strstr2(sr-&gt;connection,"Keep-Alive"))!=NULL){
346:       sr-&gt;keep_alive=VAR_ON;
347:   }
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
This vulnerability can allow an attacker to perform denial of service attacks by repeatedly crashing Monkey worker threads that process HTTP requests. We have developed &lt;a href="http://census-labs.com/media/monkeyex.txt" &gt;a proof-of-concept exploit&lt;/a&gt; to demonstrate the vulnerability.
&lt;/p&gt;

&lt;p&gt;
The maintainer of Monkey has been contacted and a new version of the web server (0.9.3) has been &lt;a href="http://www.monkey-project.com/downloads" &gt;released&lt;/a&gt; that addresses
this issue. All affected parties are advised to upgrade to the latest version available.
&lt;/p&gt;
</description>
    </item>
    <item>
      <pubDate>Thu, 3 Dec 2009 09:12:29 GMT</pubDate>
      <title>Hellenic Air Force Academy free/open source event</title>
      <link>http://www.advogato.org/person/argp/diary.html?start=31</link>
      <guid>http://www.census-labs.com/news/2009/12/03/hellenic-air-force-academy/</guid>
      <description>&lt;p&gt;&#xD;
&lt;a href="http://census-labs.com/" &gt;census&lt;/a&gt; participated in&#xD;
the free/open source&#xD;
event held last month (Friday 23rd of October) at the &lt;a href="http://www.haf.gr/el/career/academies/si/" &gt;Hellenic&#xD;
Air Force Academy (&amp;Sigma;&amp;chi;&amp;omicron;&amp;lambda;&amp;#942; &amp;Iota;&amp;kappa;&amp;#940;&amp;rho;&amp;omega;&amp;nu;)&lt;/a&gt;.&#xD;
&#xD;
&#xD;
&lt;p&gt; &lt;p&gt;&#xD;
&lt;a href="http://www.haf.gr/el/career/academies/si/" &gt;&#xD;
&lt;img src="http://census-labs.com/media/si.png"&gt;&#xD;
&lt;/a&gt;&#xD;
&#xD;
&#xD;
&lt;p&gt; &lt;p&gt;&#xD;
Our talk presented an overview of the available free/open&#xD;
source software that can be used to build complete security&#xD;
solutions for public offices and infrastructure.&#xD;
Furthermore, we analysed recorded cyberwarfare incidents and&#xD;
how the open source model can aid in establishing robust&#xD;
defenses. The slides from our presentation are available &lt;a href="http://census-labs.com/media/ellak-sec.pdf" &gt;here&lt;/a&gt;&#xD;
(in Greek).&#xD;
&#xD;
&#xD;
&lt;p&gt; &lt;p&gt;&#xD;
We would like to cordially thank Professor Antonios&#xD;
Andreatos for inviting us to the event and for his&#xD;
organisational efforts.&#xD;
&#xD;
</description>
    </item>
    <item>
      <pubDate>Wed, 2 Dec 2009 17:11:10 GMT</pubDate>
      <title>CoreHTTP web server off-by-one buffer overflow vulnerability</title>
      <link>http://www.advogato.org/person/argp/diary.html?start=30</link>
      <guid>http://www.census-labs.com/news/2009/12/02/corehttp-web-server/</guid>
      <description>&lt;table&gt;
&lt;tr&gt;&lt;td&gt;census ID:&lt;/td&gt;&lt;td&gt;census-2009-0003&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;CVE ID:&lt;/td&gt;&lt;td&gt;&lt;a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-3586" &gt;CVE-2009-3586&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt;&lt;td&gt;Affected Products:&lt;/td&gt;&lt;td&gt;CoreHTTP web server versions  &amp;le; 0.5.3.1.&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt;&lt;td&gt;Class:&lt;/td&gt;&lt;td&gt;Improper Input Validation (&lt;a href="http://cwe.mitre.org/data/definitions/20.html" &gt;CWE-20&lt;/a&gt;), Failure to Constrain Operations within the Bounds of a Memory Buffer (&lt;a href="http://cwe.mitre.org/data/definitions/119.html" &gt;CWE-119&lt;/a&gt;)&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt;&lt;td&gt;Remote:&lt;/td&gt;&lt;td&gt;Yes&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Discovered by:&lt;/td&gt;&lt;td&gt;Patroklos Argyroudis&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;
We have discovered a remotely exploitable &amp;#8220;improper input validation&amp;#8221; vulnerability in the CoreHTTP web server that leads to an off-by-one stack buffer overflow. The vulnerability can lead to denial of service attacks against the web server and potentially to the remote execution of arbitrary code with the privileges of the user running the server.
&lt;/p&gt;

&lt;!--more--&gt;

&lt;h3&gt;Details&lt;/h3&gt;

&lt;p&gt;
&lt;a href="http://corehttp.sourceforge.net/" &gt;CoreHTTP&lt;/a&gt; is a minimalist web server focusing on speed and size. More information about its features can be found
&lt;a href="http://corehttp.sourceforge.net/man.html" &gt;here&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
CoreHTTP (up to and including version 0.5.3.1) employs an insufficient input validation method for handling HTTP requests with invalid method names and URIs. Specifically, the vulnerability is an off-by-one buffer overflow in the &lt;tt&gt;sscanf()&lt;/tt&gt; call at file &lt;tt&gt;src/http.c&lt;/tt&gt; line numbers 45 and 46:
&lt;/p&gt;

&lt;pre&gt;&lt;code class="cpp"&gt;45:    sscanf(parentsprock-&gt;buffer,
46:        "%" PATHSIZE_S "[A-Za-z] %" PATHSIZE_S "s%*[ \t\n]", req, url);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
The buffers &lt;tt&gt;req&lt;/tt&gt; and &lt;tt&gt;url&lt;/tt&gt; are declared to be of size 256 bytes (&lt;tt&gt;PATHSIZE&lt;/tt&gt;) and the &lt;tt&gt;sscanf()&lt;/tt&gt; call writes 256 bytes (&lt;tt&gt;PATHSIZE_S&lt;/tt&gt;) to these buffers without NULL terminating them.
&lt;/p&gt;

&lt;p&gt;
Note that this is not vulnerability
&lt;a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-4060" &gt;CVE-2007-4060&lt;/a&gt; in which the same &lt;tt&gt;sscanf()&lt;/tt&gt; call contained no bounds check at all.
&lt;/p&gt;

&lt;p&gt;
This vulnerability can lead to denial of service attacks against the CoreHTTP web server and potentially to the remote execution of arbitrary code with the privileges of the user running the server. We have developed &lt;a href="http://census-labs.com/media/corex.txt" &gt;a proof-of-concept exploit&lt;/a&gt; to demonstrate the vulnerability.
&lt;/p&gt;

&lt;p&gt;
To address the problem we propose the following unofficial patch (download it from &lt;a href="http://census-labs.com/media/corehttp-0.5.3.1-patch.txt" &gt;here&lt;/a&gt;), since CoreHTTP&amp;#8217;s author has not released an official fix yet:
&lt;/p&gt;

&lt;pre&gt;&lt;code class="cpp"&gt;--- corehttp/src/common.h.orig  2009-12-01 09:29:18.000000000 +0200
+++ corehttp/src/common.h       2009-12-01 09:31:47.000000000 +0200
@@ -36,7 +36,7 @@
 #define BUFSIZE                2048
 #define BUFSIZE_S      "2048"
 #define PATHSIZE       256
-#define PATHSIZE_S     "256"
+#define PATHSIZE_S     "255"
 #define        SETSIZE         16

 #ifndef GLOBALS_DEFINED
&lt;/code&gt;&lt;/pre&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 1 Dec 2009 21:12:42 GMT</pubDate>
      <title>Linux kernel SUNRPC off-by-two buffer overflow</title>
      <link>http://www.advogato.org/person/argp/diary.html?start=29</link>
      <guid>http://www.census-labs.com/news/2009/12/01/linux-kernel-sunrpc/</guid>
      <description>&lt;table&gt;
&lt;tr&gt;&lt;td&gt;census ID:&lt;/td&gt;&lt;td&gt;census-2009-0005&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Affected Products:&lt;/td&gt;&lt;td&gt;Linux kernel versions from 2.6.32 to 2.6.32-rc7.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Class:&lt;/td&gt;&lt;td&gt;Off-by-two stack buffer overflow.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Discovered by:&lt;/td&gt;&lt;td&gt;Patroklos Argyroudis&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;
We have found an off-by-two stack buffer overflow in the Linux kernel SUNRPC implementation. Linux kernel versions from 2.6.32 to 2.6.32-rc7 are affected.
&lt;/p&gt;

&lt;!--more--&gt;

&lt;h3&gt;Details&lt;/h3&gt;

&lt;p&gt;
There is an off-by-two stack buffer overflow in function &lt;tt&gt;rpc_uaddr2sockaddr()&lt;/tt&gt; of file &lt;tt&gt;net/sunrpc/addr.c&lt;/tt&gt; in the Linux kernel SUNRPC implementation. It was introduced in commit &lt;a href="http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a02d692611348f11ee1bc37431a883c3ff2de23e" &gt;a02d692611348f11ee1bc37431a883c3ff2de23e&lt;/a&gt;.
&lt;/p&gt;

&lt;p&gt;
The function &lt;tt&gt;rpc_uaddr2sockaddr()&lt;/tt&gt; that is used to convert a universal address to a socket address takes as an argument the &lt;tt&gt;size_t&lt;/tt&gt; variable &lt;tt&gt;uaddr_len&lt;/tt&gt; (the length of the universal address string). The stack buffer &lt;tt&gt;buf&lt;/tt&gt; is declared in
line 315 to be of size &lt;tt&gt;RPCBIND_MAXUADDRLEN&lt;/tt&gt;. If the passed argument &lt;tt&gt;uaddr_len&lt;/tt&gt; is equal to &lt;tt&gt;RPCBIND_MAXUADDRLEN&lt;/tt&gt; then the condition of line 319 is  false and then at lines 324 and 325 there are two out-of-bounds assignments:
&lt;/p&gt;

&lt;pre&gt;&lt;code class="cpp"&gt;312: size_t rpc_uaddr2sockaddr(const char *uaddr, const size_t uaddr_len,
313:                           struct sockaddr *sap, const size_t salen)
314: {
315:        char *c, buf[RPCBIND_MAXUADDRLEN];
            ...
319:        if (uaddr_len &gt; sizeof(buf))
320:            return 0;
            ...
324:        buf[uaddr_len] = '\n';
325:        buf[uaddr_len + 1] = '\0';
            ...
363: }
364: EXPORT_SYMBOL_GPL(rpc_uaddr2sockaddr);

&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;
Since the function &lt;tt&gt;rpc_uaddr2sockaddr()&lt;/tt&gt; is declared as an &lt;tt&gt;EXPORT_SYMBOL_GPL&lt;/tt&gt; function it can be used by kernel modules and potentially be reachable by user input. The bug was
&lt;a href="http://bugzilla.kernel.org/show_bug.cgi?id=14546" &gt;reported&lt;/a&gt; and fixed in &lt;a href="http://www.kernel.org/pub/linux/kernel/v2.6/testing/ChangeLog-2.6.32-rc8" &gt;2.6.32-rc8&lt;/a&gt; (commit &lt;a href="http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1e360a60b24ad8f8685af66fa6de10ce46693a4b" &gt;1e360a60b24ad8f8685af66fa6de10ce46693a4b&lt;/a&gt;).
&lt;/p&gt;
</description>
    </item>
    <item>
      <pubDate>Wed, 26 Aug 2009 20:00:57 GMT</pubDate>
      <title>26 Aug 2009</title>
      <link>http://www.advogato.org/person/argp/diary.html?start=28</link>
      <guid>http://www.advogato.org/person/argp/diary.html?start=28</guid>
      <description>&lt;p&gt;&#xD;
&lt;b&gt;flickr is the new bugtraq&lt;/b&gt;&#xD;
&lt;p&gt;&#xD;
I decided to start disclosing bugs on&#xD;
&lt;a href="http://www.flickr.com/photos/argp/3842801482/" &gt;flickr&lt;/a&gt;.&#xD;
</description>
    </item>
    <item>
      <pubDate>Fri, 21 Aug 2009 13:14:40 GMT</pubDate>
      <title>ld-linuxv.so.1 rootkit</title>
      <link>http://www.advogato.org/person/argp/diary.html?start=27</link>
      <guid>http://www.census-labs.com/news/2009/08/21/ld-linuxvso1-rootkit/</guid>
      <description>Yesterday I helped my friend &lt;a href="http://www.void.gr/kargig/" target="blank" &gt;kargig&lt;/a&gt; to analyse a rootkit he has recovered from a compromised Linux system. You can find the complete write-up at his
&lt;a href="http://www.void.gr/kargig/blog/2009/08/21/theres-a-rootkit-in-the-closet/" target="blank" &gt;blog&lt;/a&gt;.</description>
    </item>
  </channel>
</rss>
