<?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>104986</bug_id>
          
          <creation_ts>2005-09-06 02:38 0000</creation_ts>
          <short_desc>app-backup/bacula &lt;= 1.34.4 multiple vulnerabilities</short_desc>
          <delta_ts>2005-10-19 10:44:37 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>C3 [noglsa] jaervosz</status_whiteboard>
          
          <priority>P2</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>zataz@zataz.net</reporter>
          <assigned_to>security@gentoo.org</assigned_to>
          <cc>app-backup@gentoo.org</cc>
    
    <cc>fserb@gentoo.org</cc>
    
    <cc>hadfield@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>zataz@zataz.net</who>
            <bug_when>2005-09-06 02:38:28 0000</bug_when>
            <thetext>Hello,

* Take a look on : autoconf/randpass

This file is used by configure and autoconf/configure.in
to generate random password.

11 tmp=/tmp/p.tmp.$$
12 cp autoconf/randpass.bc $tmp
13 ps | sum | tr -d &apos;:[:alpha:] &apos; | sed &apos;s/^/k=/&apos; &gt;&gt;$tmp
14 date | tr -d &apos;:[:alpha:] &apos; | sed &apos;s/^/k=k*/&apos; &gt;&gt;$tmp
15 ls -l /tmp | sum | tr -d &apos;:[:alpha:] &apos; | sed &apos;s/^/k=k*/&apos; &gt;&gt;$tmp
16 echo &quot;j=s(k); for (i = 0; i &lt; $PWL; i++) r()&quot; &gt;&gt;$tmp
17 echo &quot;quit&quot; &gt;&gt;$tmp
18 bc $tmp | awk -f autoconf/randpass.awk
19 rm $tmp

They are 2 troubles, symlink attack (race condition) and password revelation to
unstruted user (race condition).


* Take a look at : rescue/linux/getdiskinfo

Create bootstrap information files -- prelude to creating a Bacula Rescue Disk

192 cat &gt;mount_drives &lt;&lt;END_OF_DATA
193 #!/bin/sh
194 #
195 #  Mount disk drives  -- created by getdiskinfo
196 #
197 END_OF_DATA
198 sed -n &apos;s/\(^.*\)\ on\ \(.*\)\ type.*$/mkdir -p \/mnt\/disk\2/p&apos;
$di/mount.ext2.bsi &gt;&gt;mount_drives
199 sed -n &apos;s/\(^.*\)\ on\ \(.*\)\ type.*$/mkdir -p \/mnt\/disk\2/p&apos;
$di/mount.ext3.bsi &gt;&gt;mount_drives
200 echo &quot;#&quot; &gt;&gt;mount_drives
201 sed -n &apos;s/\(^.*\)\ on\ \(.*\)\ type.*$/mount \1 \/mnt\/disk\2/p&apos;
$di/mount.ext2.bsi &gt;/tmp/1$$
202 sed -n &apos;s/\(^.*\)\ on\ \(.*\)\ type.*$/mount \1 \/mnt\/disk\2/p&apos;
$di/mount.ext3.bsi &gt;&gt;/tmp/1$$
203 # sort so that root is mounted first
204 sort -k 3 &lt;/tmp/1$$ &gt;&gt;mount_drives
205 rm -f /tmp/1$$
206 
207 chmod 755 mount_drives
208 
209 # copy sfdisk so we will have it
210 cp -f /sbin/sfdisk .
211 echo &quot;Done building scripts.&quot;
212 echo &quot; &quot;
213 echo &quot;You might want to do a:&quot;
214 echo &quot; &quot;
215 echo &quot;chown -R uuuu:gggg *&quot;
216 echo &quot; &quot;
217 echo &quot;where uuuu is your userid and gggg is your group&quot;
218 echo &quot;so that you can access all the files as non-root&quot;
219 echo &quot; &quot;

They are two troubles, symlink attack (race condition) and possible execution
off executing arbitrary commands with users privileges (race condition)


* Take a look at : scripts/mtx-changer.in

Bacula interface to mtx autoloader

117    loaded)
118       ${MTX} -f $ctl status &gt;/tmp/mtx.$$
119       rtn=$?
120       cat /tmp/mtx.$$ | grep &quot;^Data Transfer Element $drive:Full&quot; | awk
&quot;{print \$7}&quot;
121       cat /tmp/mtx.$$ | grep &quot;^Data Transfer Element $drive:Empty&quot; | awk
&quot;{print 0}&quot;
122       rm -f /tmp/mtx.$$
123       exit $rtn
124       ;;

symlink attack (race condition) possible


* Also we got this variable in a lot off script :

working_directory  = &quot;/tmp&quot;;

Upstream should check the usage off this variable.

Regards.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>taviso@gentoo.org</who>
            <bug_when>2005-09-13 04:06:01 0000</bug_when>
            <thetext>(In reply to comment #0)
&gt; Hello,
&gt; 
&gt; * Take a look on : autoconf/randpass
&gt; 
...

This would only be exploitable on systems that dont have an openssl command, so 
not many systems would be effected, nevertheless, it could potentially be an 
issue. Suggest adding a dependency on openssl.

&gt; * Take a look at : rescue/linux/getdiskinfo

This file does not appear to be installed, and therefore is invalid.
 
&gt; 
&gt; * Take a look at : scripts/mtx-changer.in

Yes, I dont see why a temporary file is needed here, this could be done in a 
single pipeline.

&gt; 
&gt; * Also we got this variable in a lot off script :
&gt; 
&gt; working_directory  = &quot;/tmp&quot;;
&gt; 
&gt; Upstream should check the usage off this variable.
&gt; 

Perhaps, I&apos;ll leave that to security team/maintainers to decide.

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>zataz@zataz.net</who>
            <bug_when>2005-09-13 04:23:15 0000</bug_when>
            <thetext>&gt;&gt; Hello,
&gt;&gt; 
&gt;&gt; * Take a look on : autoconf/randpass
&gt;&gt; 
...

&gt; This would only be exploitable on systems that dont have an openssl command, so 
&gt; not many systems would be effected, nevertheless, it could potentially be an 
&gt; issue. Suggest adding a dependency on openssl.

...

Why openssl ?

...

Regards</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>taviso@gentoo.org</who>
            <bug_when>2005-09-13 04:45:55 0000</bug_when>
            <thetext>because it&apos;s only used if openssl isnt available.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2005-09-17 05:42:59 0000</bug_when>
            <thetext>eric: where do we stand here ? upstream warned ? </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>zataz@zataz.net</who>
            <bug_when>2005-09-19 01:46:28 0000</bug_when>
            <thetext>Hello,

Reported into bacula bug system.

http://bugs.bacula.org/bug_view_advanced_page.php?bug_id=0000422

Regards.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2005-09-20 07:00:31 0000</bug_when>
            <thetext>Now public.

Version 1.37.39 is out and fixes the issue.
Maintainers: please bump.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2005-09-23 13:29:22 0000</bug_when>
            <thetext>CCing herd as maintainers don&apos;t answer...</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>hunter.cook@tranquility.net</who>
            <bug_when>2005-10-03 17:51:33 0000</bug_when>
            <thetext>Is this a major issue? I just installed bacula and was about to configure it to
backup a pretty important server over the public Internet....is that a bad idea
with this version? I just installed 1.34.4 because that&apos;s what&apos;s marked stable
right now, and I hadn&apos;t seen this yet.

Also, how is bacula-1.36.3-r1 in comparison? Is it stable? I see the reference
to 1.37.39 above...seems like we&apos;re a bit behind. Are there other
vulnerabilities that 1.36.3 still has problems with?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2005-10-04 00:50:05 0000</bug_when>
            <thetext>These are both local attacks, meaning the attacker needs to get access to the
system (and be free to execute code on it). So if you don&apos;t have local users on
the platform you use Bacula on, that&apos;s not such a bug deal.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2005-10-06 08:12:44 0000</bug_when>
            <thetext>app-backup please bump. </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dragonheart@gentoo.org</who>
            <bug_when>2005-10-06 14:05:19 0000</bug_when>
            <thetext>bacula-1.36.3-r2 added that fixes the vulnerability.  
 
Romang thankyou add please check. 
 
FYI: 1.37* is the unstable beta version  </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2005-10-06 14:09:54 0000</bug_when>
            <thetext>Nothing in CVS yet. </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2005-10-06 14:15:30 0000</bug_when>
            <thetext>Ok, it is in now. Arches please test and mark stable. </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>hansmi@gentoo.org</who>
            <bug_when>2005-10-07 11:06:49 0000</bug_when>
            <thetext>Stable on ppc and hppa.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>halcy0n@gentoo.org</who>
            <bug_when>2005-10-08 22:23:00 0000</bug_when>
            <thetext>x86 done</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2005-10-11 08:30:04 0000</bug_when>
            <thetext>Still misses sparc keyword...</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gustavoz@gentoo.org</who>
            <bug_when>2005-10-11 10:58:24 0000</bug_when>
            <thetext>sparc stable.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2005-10-12 00:42:04 0000</bug_when>
            <thetext>Ready for GLSA vote, I vote NO since I can&apos;t think of a supported arch where
openssl is not in system.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2005-10-12 01:00:52 0000</bug_when>
            <thetext>Voting NO and closing without GLSA. 
 
Romang thanks for reporting. </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dragonheart@gentoo.org</who>
            <bug_when>2005-10-13 14:17:36 0000</bug_when>
            <thetext>The password attack on tmp files is one of the situtations. 
 
The second one based on scripts/mtx-changer.in does exist on all platforms. 
The exploit to use the vulnerability occurs on configurations where there the 
tape backup unit requires manual tape switching. 
 
The exploitable times are between tape changes. I&apos;m not sure if this is a 
sufficiently common configuration for a glsa or not. I&apos;m not sure if users are 
often given access on machines where a tape-backup may be connected that may 
be an effective countermeasure. 
 
A few seconds for your consideration people. </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2005-10-14 00:26:46 0000</bug_when>
            <thetext>Thx for the details. I agree the second scenario is more likely and tends to be
run as root, so now I tend to vote yes :)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2005-10-14 00:32:32 0000</bug_when>
            <thetext>Small YES vote from me too. </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>taviso@gentoo.org</who>
            <bug_when>2005-10-15 01:56:12 0000</bug_when>
            <thetext>i would vote NO, seems a rare configuration. Also, cannot control output, so 
mainly useful for sabotage. </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2005-10-19 01:13:10 0000</bug_when>
            <thetext>Let&apos;s get this done, please cast your vote.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dragonheart@gentoo.org</who>
            <bug_when>2005-10-19 01:45:06 0000</bug_when>
            <thetext>If I&apos;m allowed to vote I&apos;ll say no based on Tavis&apos;s comments. </thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2005-10-19 10:44:37 0000</bug_when>
            <thetext>Reverting to NO vote and closing with NO GLSA. Feel free to reopen if you 
disagree. </thetext>
          </long_desc>
      
    </bug>

</bugzilla>