<?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>110467</bug_id>
          
          <creation_ts>2005-10-25 13:26 0000</creation_ts>
          <short_desc>gnome-extra/libgda syslog format string attack</short_desc>
          <delta_ts>2006-03-24 06:08:06 0000</delta_ts>
          
          
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Security</product>
          <component>Vulnerabilities</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <status_whiteboard>B2? [glsa] jaervosz</status_whiteboard>
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>jaervosz@gentoo.org</reporter>
          <assigned_to>security@gentoo.org</assigned_to>
          <cc>gnome@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2005-10-25 13:26:45 0000</bug_when>
            <thetext>From Steve Kemp: 
 
libgda2 format string attack 
---------------------------- 
 
  The gda2 library contains two format string bugs, both involving the 
 use of the syslog function. 
 
  The relevent code is contained in the file: 
 
      libgda2-1.2.1/libgda/gda-log.c 
 
  The two functions gda_log_error and gda_log_message both contain 
 this code: 
 
      syslog (LOG_USER | LOG_INFO, msg); 
 
 
Exploitation 
------------ 
 
  The logging functions are called throughout the code and are 
 often passed user controllable input.  For example: 
 
gda-xml-database.c: 
 gda_log_error (_(&quot;Invalid XML database file &apos;%s&apos;&quot;), uri); 
 
  or 
 
gda-select.c: 
 gda_log_error (_(&quot;Could not parse SQL string &apos;%s&apos;&quot;), sel-&gt;priv-&gt;sql); 
 
 
  Whilst it is not likely that privileges could be gained by the 
 libary alone there are several routes for exploitation via other 
 applications which link to the code. 
 
  The most obvious is the &quot;gnumeric-plugins-extra&quot; package which 
 links to and uses the code. 
 
  
 
Fix 
--- 
 
  The following patch fixes this: 
 
--- gda-log.c-orig      2005-09-06 13:49:52.792070192 +0100 
+++ gda-log.c   2005-09-06 13:50:25.049166368 +0100 
@@ -111,7 +111,7 @@ 
 #ifdef LIBGDA_WIN32 
        g_log (&quot;Gda&quot;, G_LOG_LEVEL_INFO, &quot;%s&quot;, msg); 
 #else 
-       syslog (LOG_USER | LOG_INFO, msg); 
+       syslog (LOG_USER | LOG_INFO, &quot;%s&quot;, msg); 
 #endif 
        g_free (msg); 
 } 
@@ -144,7 +144,7 @@ 
 #ifdef LIBGDA_WIN32 
        g_log (&quot;Gda&quot;, G_LOG_LEVEL_ERROR, &quot;%s&quot;, msg); 
 #else 
-       syslog (LOG_USER | LOG_ERR, msg); 
+       syslog (LOG_USER | LOG_ERR, &quot;%s&quot;, msg); 
 #endif 
        g_free (msg); 
 } 
 
Steve</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2005-10-25 22:23:25 0000</bug_when>
            <thetext>Gnome please provide an updated ebuild. </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>leonardop@gentoo.org</who>
            <bug_when>2005-10-26 11:37:13 0000</bug_when>
            <thetext>I&apos;ve committed libgda-1.2.2-r1.ebuild, which includes a patch for this.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2005-10-26 12:23:54 0000</bug_when>
            <thetext>Thx Leonardo, arches please test and mark stable. </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ranger@gentoo.org</who>
            <bug_when>2005-10-26 18:59:15 0000</bug_when>
            <thetext>Marked ppc64 stable. Thanks.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gustavoz@gentoo.org</who>
            <bug_when>2005-10-27 07:20:09 0000</bug_when>
            <thetext>sparc stable.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>blubb@gentoo.org</who>
            <bug_when>2005-10-28 08:28:15 0000</bug_when>
            <thetext>1.2.2-r1 fails on amd64 with the following sandbox error:

ACCESS DENIED  unlink:    /usr/lib64/libgdasql.so.3.0.0
/bin/install: cannot remove `/usr/lib64/libgdasql.so.3.0.0&apos;: Permission denied
make[2]: *** [install-libLTLIBRARIES] Error 1
make[2]: Leaving directory
`/var/tmp/portage/libgda-1.2.2-r1/work/libgda-1.2.2/libsql&apos;
make[1]: *** [install-am] Error 2
make[1]: Leaving directory
`/var/tmp/portage/libgda-1.2.2-r1/work/libgda-1.2.2/libsql&apos;
make: *** [install-recursive] Error 1

!!! ERROR: gnome-extra/libgda-1.2.2-r1 failed.
!!! Function einstall, Line 524, Exitcode 2
!!! einstall failed

1.2.2 works fine though

 # cat /var/log/sandbox/sandbox-gnome-extra_-_libgda-1.2.2-r1-17475.log
unlink:    /usr/lib64/libgdasql.so.3.0.0
 #</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>leonardop@gentoo.org</who>
            <bug_when>2005-10-28 09:10:22 0000</bug_when>
            <thetext>Simon,
I can&apos;t reproduce the problem on pitr, but could you verify if adding
USE_DESTDIR=&quot;1&quot; to the ebuild resolves it?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>blubb@gentoo.org</who>
            <bug_when>2005-10-28 09:38:22 0000</bug_when>
            <thetext>yup, works fine with USE_DESTDIR=1</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>leonardop@gentoo.org</who>
            <bug_when>2005-10-28 11:27:02 0000</bug_when>
            <thetext>Thanks, the fix has been committed to the ebuild now.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ferdy@gentoo.org</who>
            <bug_when>2005-10-28 13:52:17 0000</bug_when>
            <thetext>stable on alpha

Cheers,
Ferdy</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>halcy0n@gentoo.org</who>
            <bug_when>2005-10-28 18:23:26 0000</bug_when>
            <thetext>Stable on x86</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>hansmi@gentoo.org</who>
            <bug_when>2005-10-29 08:41:03 0000</bug_when>
            <thetext>Stable on ppc.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>blubb@gentoo.org</who>
            <bug_when>2005-10-30 02:46:03 0000</bug_when>
            <thetext>amd64 stable</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2005-11-02 09:02:19 0000</bug_when>
            <thetext>GLSA 200511-01
For some unknown reason hppa and ia64 were forgotten along the way. Perhaps the
recent stable-ing of an older version...
hppa and ia64 should mark stable to benefit from GLSA.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>hansmi@gentoo.org</who>
            <bug_when>2005-11-02 10:20:02 0000</bug_when>
            <thetext>Straigth to stable on hppa.</thetext>
          </long_desc>
      
    </bug>

</bugzilla>