<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>66543</bug_id>
          
          <creation_ts>2004-10-06 09:42 0000</creation_ts>
          <short_desc>www-servers/cherokee: Local Format String Vulnerability</short_desc>
          <delta_ts>2004-10-07 09:33:53 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Security</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          <bug_file_loc>http://www.securityfocus.com/archive/1/360802</bug_file_loc>
          <status_whiteboard>B? [glsa?] koon</status_whiteboard>
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>ruth@gentoo.org</reporter>
          <assigned_to>security@gentoo.org</assigned_to>
          

      

      
          <long_desc isprivate="0">
            <who>ruth@gentoo.org</who>
            <bug_when>2004-10-06 09:42:13 0000</bug_when>
            <thetext>hi again,
this one is old... ;-)

-------------------------------------------------
No System Group - Advisory #3 - 17/04/04
-------------------------------------------------
Program:  Cherokee Web Server
Homepage:  http://www.0x50.org
Vulnerable Versions: Cherokee 0.4.16 and prior
Risk: Low / Medium
Impact: Local Format String Vulnerability
-------------------------------------------------


- DESCRIPTION
-------------------------------------------------
Cherokee is a tiny, very fast, lightweight Web
server. It is implemented entirely in C, and has
no dependencies beyond a standard C library. It
is embeddable, extensible with plug-ins, and supports
on-the-fly configuration by reading files or strings.

More informations at: http://www.0x50.org


- DETAILS
-------------------------------------------------
Cherokee Web Server is affected by a format string
bug in the PRINT_ERROR() function to 66 lines of 
common.c code:

--- common.c ---
55: void 
56: PRINT_ERROR (const char *format, ...)
57: {
58:         va_list arg_list;
59:         CHEROKEE_TEMP(tmp, 2048);  
60:         
61:         va_start(arg_list, format);
62:         vsnprintf (tmp, tmp_size, format, arg_list);
63:         va_end(arg_list);
64:    
65:         fprintf (stderr, &quot;%s&quot;, tmp);
66:         syslog (LOG_ERR, tmp); // The bug
67: }    
--- common.c ---

We can show some parts of the stack memory by using a format string loke
this:

coki@servidor:~$ cherokee -C AAAA%08x
Can&apos;t read the configuration file: &apos;AAAA%08x&apos;
coki@servidor:~$ tail -n 1 /var/log/syslog
Apr 17 15:03:25 servidor cherokee: Can&apos;t read the configuration file: &apos;AAAA0804b780&apos;
coki@servidor:~$ 

---eof---

btw: the syslog looks like this:
Oct  6 18:23:21 leela lt-cherokee: Can&apos;t read the configuration file: &apos;/usr/loca
l/etc/cherokee/cherokee.conf&apos;
Oct  6 18:23:34 leela lt-cherokee: Can&apos;t read the configuration file: &apos;0x804b81c
 0xbffff754 0x276e6143 0x65722074 0x74206461&apos;

uh, memory addresses...

patch is attached (from the advisory, looks good)

--- common.c ---
55: void 
56: PRINT_ERROR (const char *format, ...)
57: {
58:         va_list arg_list;
59:         CHEROKEE_TEMP(tmp, 2048);  
60:         
61:         va_start(arg_list, format);
62:         vsnprintf (tmp, tmp_size, format, arg_list);
63:         va_end(arg_list);
64:    
&lt;&lt;&lt;         fprintf (stderr, &quot;%s&quot;, tmp);
&gt;&gt;&gt;         syslog (LOG_ERR, &quot;%s&quot;, tmp); /* oki ;-) */
67: }    
--- common.c ---

i think, a version bump would be sufficient for this (0.4.17 already in portage)...
nevertheless, it affects a server package, so it needs attention...

best regards,
florian [rootshell]</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2004-10-06 10:59:34 0000</bug_when>
            <thetext>x86, please mark www-servers/cherokee-0.4.17 stable.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>tester@gentoo.org</who>
            <bug_when>2004-10-06 11:30:12 0000</bug_when>
            <thetext>stable on x86... </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2004-10-07 01:50:02 0000</bug_when>
            <thetext>Drafting this one</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2004-10-07 02:53:34 0000</bug_when>
            <thetext>Hmm I was confused by this one, thought it was remotely exploitable.

It&apos;s just local information leak of stack addresses, right ? If I understand this correctly, it cannot be exploited by itself. Should be fixed (and has been) but not generate GLSA.

Security, please confirm.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>krispykringle@gentoo.org</who>
            <bug_when>2004-10-07 09:22:32 0000</bug_when>
            <thetext>Koon, looks correct. Local memory address disclosure. Scary! </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>klieber@gentoo.org</who>
            <bug_when>2004-10-07 09:32:40 0000</bug_when>
            <thetext>ok, if it&apos;s not remotely exploitable, then I don&apos;t think we need a GLSA on this one.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2004-10-07 09:33:53 0000</bug_when>
            <thetext>Bug closing dance</thetext>
          </long_desc>
      
    </bug>

</bugzilla>