<?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>199751</bug_id>
          <alias>CVE-2007-6061</alias>
          <creation_ts>2007-11-20 10:25 0000</creation_ts>
          <short_desc>media-sound/audacity &lt; 1.3.4-r1: temporary file vulnerablilty (CVE-2007-6061)</short_desc>
          <delta_ts>2008-03-03 00:11:41 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <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>
          <bug_file_loc>http://thread.gmane.org/gmane.comp.audio.audacity.devel/18175</bug_file_loc>
          <status_whiteboard>B3 [glsa]</status_whiteboard>
          
          <priority>P2</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>griph+gentoo@dd.chalmers.se</reporter>
          <assigned_to>security@gentoo.org</assigned_to>
          <cc>ismail@namtrac.org</cc>
    
    <cc>proaudio@gentoo.org</cc>
    
    <cc>richard@audacityteam.org</cc>
    
    <cc>tester@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>griph+gentoo@dd.chalmers.se</who>
            <bug_when>2007-11-20 10:25:37 0000</bug_when>
            <thetext>If audacity is started with an already existing /tmp/audacity1.2-$LOGNAME, with
another owner than the current uid audacity will deadlock upon stopping a
recording.

Reproducible: Always

Steps to Reproduce:
1. create the directory /tmp/audacity1.2-$LOGNAME using some different user, and
change ownership of that directory
2. start audacity
3. hit the record button
4. hit stop

Actual Results:  
Audacity will stop redrawing. (can be terminated by SIGINT}

Expected Results:  
The recording should be completed, and possible to play back.

I&apos;ve not checked for related vulnerabilities (symlink attacks / data injection)


# emerge --info
Portage 2.1.3.19 (default-linux/x86/2006.1/desktop, gcc-4.1.2, glibc-2.6.1-r0, 2.6.20.7 i686)
=================================================================
System uname: 2.6.20.7 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz
Timestamp of tree: Sun, 18 Nov 2007 20:30:02 +0000
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p17
dev-java/java-config: 1.3.7, 2.1.2-r1
dev-lang/python:     2.3.5-r3, 2.4.4-r6
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.9-r2
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61-r1
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils:  2.18-r1
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.22-r2
ACCEPT_KEYWORDS=&quot;x86&quot;
CBUILD=&quot;i686-pc-linux-gnu&quot;
CFLAGS=&quot;-march=pentium4 -O2 -pipe&quot;
CHOST=&quot;i686-pc-linux-gnu&quot;
CONFIG_PROTECT=&quot;/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config&quot;
CONFIG_PROTECT_MASK=&quot;/etc/env.d /etc/env.d/java/ /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d&quot;
CXXFLAGS=&quot;-march=pentium4 -O2 -pipe&quot;
DISTDIR=&quot;/usr/portage/distfiles&quot;
FEATURES=&quot;ccache distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch&quot;
GENTOO_MIRRORS=&quot;http://mirror.gentoo.no/ http://ds.thn.htu.se/linux/gentoo&quot;
LANG=&quot;sv_SE&quot;
LC_ALL=&quot;sv_SE&quot;
LINGUAS=&quot;sv_SE sv en_GB en_US us en&quot;
MAKEOPTS=&quot;-j3&quot;
PKGDIR=&quot;/usr/portage/packages&quot;
PORTAGE_RSYNC_OPTS=&quot;--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*&quot;
PORTAGE_TMPDIR=&quot;/var/tmp&quot;
PORTDIR=&quot;/usr/portage&quot;
PORTDIR_OVERLAY=&quot;/usr/local/portage&quot;
SYNC=&quot;rsync://rsync.gentoo.org/gentoo-portage&quot;
USE=&quot;X acpi alsa apache2 bash/completion bitmap-fonts bzip2 cairo cdr cli cracklib crypt dbus divx4linux dri dvb dvd dvdr dvdread eds emacs encode esd fam firefox fortran gdbm gif gpm gtk hal iconv imagemagick isdnlog ithreads java javascript jpeg lcms mad midi mmx mng mp3 mpeg mudflap ncurses nls nptl nptlonly ogg opengl openmp pam pcre perl php plotutils png ppds pppd python qt3 qt4 quicktime readline reflection sdl session sockets socks5 spell spl sse sse2 ssl svg tcpd tetex theora tiff truetype truetype-fonts type1-fonts unicode usb userlocales v4l v4l2 vcd videos vorbis win32codecs wmf x86 xface xine xml xml2 xorg xosd xsl xv xvid zlib&quot; ALSA_CARDS=&quot;ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci&quot; ALSA_PCM_PLUGINS=&quot;adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol&quot; ELIBC=&quot;glibc&quot; INPUT_DEVICES=&quot;evdev keyboard mouse&quot; KERNEL=&quot;linux&quot; LCD_DEVICES=&quot;bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text&quot; LINGUAS=&quot;sv_SE sv en_GB en_US us en&quot; USERLAND=&quot;GNU&quot; VIDEO_CARDS=&quot;fglrx radeon vga vesa&quot;
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>griph+gentoo@dd.chalmers.se</who>
            <bug_when>2007-11-20 11:28:54 0000</bug_when>
            <thetext>I&apos;ve done some tests and the bug is also a symlink vulnerablilty that can be used to empty a directory structure of the user of all non hidden files.

Steps to Reproduce: &lt;attacking $LOGNAME, emptying $DIR_TO_EMPTY&gt;
1. mkdir /tmp/audacity1.2-$LOGNAME
2. chmod 0777 /tmp/audacity1.2-$LOGNAME
3. ln -s $DIR_TO_EMPTY /tmp/audacity1.2-$LOGNAME/project
4. as $LOGNAME: start and exit audacity
5. watch the progress as audacity cleans up &quot;temporary files&quot;

Audacity will recursively (following symlinks, but ignoring hidden files) remove any file or folder matching /tmp/audacity1.2-$LOGNAME/project* on exit.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rbu@gentoo.org</who>
            <bug_when>2007-11-20 15:17:14 0000</bug_when>
            <thetext>Proaudio herd, please advise.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>aballier@gentoo.org</who>
            <bug_when>2007-11-20 15:28:08 0000</bug_when>
            <thetext>(In reply to comment #2)
&gt; Proaudio herd, please advise.
&gt; 

usual question: has this been reported upstream ? If yes, could you please point me where ?
If no, what would be the solution ? I&apos;d suggest using ~/.audacity/tmp or something like that for temporary files rather than /tmp; but perhaps security experts have better proposals ;)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>griph+gentoo@dd.chalmers.se</who>
            <bug_when>2007-11-20 18:14:58 0000</bug_when>
            <thetext>(In reply to comment #3)
&gt; usual question: has this been reported upstream ?
the issue in the description has been reported upstream, but not acknowledged. The particular exploit in comment #1 has not been reported.
&gt; If yes, could you please point me where ?
http://sourceforge.net/mailarchive/forum.php?thread_name=Pine.LNX.4.63.0711162007530.24246%40t-4009-01.studat.chalmers.se&amp;forum_name=audacity-users
http://sourceforge.net/mailarchive/forum.php?thread_name=d08.220e2918.3472d3de%40aol.com&amp;forum_name=audacity-users

&gt; If no, what would be the solution ? I&apos;d suggest using ~/.audacity/tmp or
&gt; something like that for temporary files rather than /tmp; but perhaps security
&gt; experts have better proposals ;)

I&apos;m not a security expert, but I would suggest adding checks to see that the directory is created with the right permissions, and is no symlink, Currently audacity asks the user to input another directory if no directory could be created and none existed (i.e it was a file) that should be extended to happen also when the directory doesn&apos;t have the right permissions (0700).

Users with network file systems for their home directories would not want their temporary files in there.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rbu@gentoo.org</who>
            <bug_when>2007-11-25 15:27:40 0000</bug_when>
            <thetext>CVE-2007-6061 was assigned to this issue.

Has there been any movement upstream yet?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>richard@audacityteam.org</who>
            <bug_when>2007-11-30 22:32:06 0000</bug_when>
            <thetext>(In reply to comment #5)
&gt; CVE-2007-6061 was assigned to this issue.
&gt; 
&gt; Has there been any movement upstream yet?

No, because most of the developers aren&apos;t on audacity-users, so it never made it to anyone likely to patch it. The snag trying to implement the suggested solution is that there isn&apos;t a wx function for the job, so it means writing more platform-specific code to do the permissions check. It&apos;s doable, but won&apos;t get itself tackled without a bug report reaching developers.

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ismail@namtrac.org</who>
            <bug_when>2007-12-03 09:45:17 0000</bug_when>
            <thetext>Sent a message to audacity-devel mailing list with a reference to this bug.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>aballier@gentoo.org</who>
            <bug_when>2008-01-22 12:59:42 0000</bug_when>
            <thetext>Ping, do you have more information that I&apos;ve not been able to grab ?
The thread on -devel ml seems to have ended in the middle of december without any implementation; debian patched audacity yesterday to use the home directory as temp dir.

Again, what should we do here ?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>py@gentoo.org</who>
            <bug_when>2008-01-22 13:20:05 0000</bug_when>
            <thetext>If upstream doesn&apos;t react, using Debian&apos;s patch is probably the best way to go.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ismail@namtrac.org</who>
            <bug_when>2008-01-22 14:19:33 0000</bug_when>
            <thetext>Created an attachment (id=141581)
Patch applied byu 

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ismail@namtrac.org</who>
            <bug_when>2008-01-22 14:20:20 0000</bug_when>
            <thetext>Ok hit enter too fast, attached patch applied by Debian and now Pardus too. It puts temporary files in user&apos;s home directory.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>nion@debian.org</who>
            <bug_when>2008-01-23 00:43:59 0000</bug_when>
            <thetext>(In reply to comment #11)
&gt; Ok hit enter too fast, attached patch applied by Debian and now Pardus too. It
&gt; puts temporary files in user&apos;s home directory.

There is one / too much in front of %s in the copied patch. This is not really important and should work to but home will already contain the leading slash.
cheers
nion
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>nion@debian.org</who>
            <bug_when>2008-01-23 00:45:03 0000</bug_when>
            <thetext>oh and do you guys have a method to notify the user about that change? Otherwise you should modify the code to modify the user configuration file otherwise people who already installed audacity stay vulnerable.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2008-01-23 09:00:58 0000</bug_when>
            <thetext>Proaudio please advise.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>aballier@gentoo.org</who>
            <bug_when>2008-01-26 10:42:16 0000</bug_when>
            <thetext>Thanks Ismail for the patch, and thanks Nico for the info about it being kept in preferences. I&apos;ve modified a bit the patch to also discard the temp. directory from preferences if it is in /tmp because I dont trust users to take care about this, esp. I dont trust any user of a system to read the warning in the ebuild and/or the glsa.

So, here is the plan: 1.3.4-r1 fixes this. This one is a target for stable; it depends optionally on media-libs/vamp-plugin-sdk which I added some time ago and received no bug report so far, so it&apos;s good to go. It would be cool if media-plugins/vamp-aubio-plugins and media-plugins/vamp-libxtract-plugins could go stable aswell, this is not a strict requirement here but if you only have the sdk you&apos;ll only have the example plugins shipped with it.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rbu@gentoo.org</who>
            <bug_when>2008-01-29 03:27:27 0000</bug_when>
            <thetext>Arches, please test and mark stable:
=media-sound/audacity-1.3.4-r1

=media-libs/vamp-plugin-sdk-1.1b-r1
=media-plugins/vamp-aubio-plugins-0.3.2b               (at your discretion)
=media-plugins/vamp-libxtract-plugins-0.4.2.20071019   (at your discretion)

Target keywords : &quot;amd64 ppc ppc64 sparc x86&quot;</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>corsair@gentoo.org</who>
            <bug_when>2008-01-29 08:49:42 0000</bug_when>
            <thetext>ppc64 stable

I needed to mark these stable, too:

media-sound/lash-0.5.4
media-libs/aubio-0.3.2
media-libs/libsoundtouch-1.3.1-r1
media-libs/libxtract-0.4.7</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>fauli@gentoo.org</who>
            <bug_when>2008-01-29 11:57:52 0000</bug_when>
            <thetext>x86 stable</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>armin76@gentoo.org</who>
            <bug_when>2008-01-30 17:45:10 0000</bug_when>
            <thetext>sparc stable</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dertobi123@gentoo.org</who>
            <bug_when>2008-01-31 20:48:18 0000</bug_when>
            <thetext>ppc stable</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>tester@gentoo.org</who>
            <bug_when>2008-02-11 00:12:19 0000</bug_when>
            <thetext>media-libs/aubio wasnt multilib-strict, so I fixed it, but I guess we will have to wait a bit more before stabilizing it, the rest is stable on amd64.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>aballier@gentoo.org</who>
            <bug_when>2008-02-11 14:29:27 0000</bug_when>
            <thetext>(In reply to comment #21)
&gt; media-libs/aubio wasnt multilib-strict, so I fixed it, but I guess we will have
&gt; to wait a bit more before stabilizing it, the rest is stable on amd64.

which version I&apos;m gonna remove. This is bug #187826 and I dont want to workaround python bugs in my packages. If you want this fixed, you&apos;d better fix your stable python.

Especially since:
- the ebuild adds obvious warnings due to variables not being quoted
- it calls eautomake when it should call eautoreconf
- last but not least: may I suggest you running &quot; python -c &apos;import aubio.median&apos;&quot; as root with your 0.3.2-r1 version ? then unmerge aubio and have a look at /usr/lib64/python2.4/site-packages/aubio/... stray files.. thanks but no thanks, I dont want this.


Ho and as an example:
# python -V
Python 2.4.4
# python -c &quot;from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix=&apos;$PYTHON_PREFIX&apos;)&quot;
lib/python2.4/site-packages

# python -V
Python 2.5.1
# python  -c &quot;from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix=&apos;$PYTHON_PREFIX&apos;)&quot;
lib64/python2.5/site-packages


and yes, this is the path that is being used...


For others, sorry for the noise.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>tester@gentoo.org</who>
            <bug_when>2008-02-11 15:36:22 0000</bug_when>
            <thetext>(In reply to comment #22)
&gt; which version I&apos;m gonna remove. This is bug #187826 and I dont want to
&gt; workaround python bugs in my packages. If you want this fixed, you&apos;d better fix your stable python.

I commented on bug #187826, I&apos;m still convinced that my patch here is right (its upstream now too). And I&apos;m not convinced at all that the default behavior of python (in our 2.4 ebuild) is wrong and that the patch to 2.5 is right.

&gt; Especially since:
&gt; - the ebuild adds obvious warnings due to variables not being quoted

Fixed

&gt; - it calls eautomake when it should call eautoreconf

Only the makefile.am is modifed, I forced automake 1.8 and its fine now

&gt; - last but not least: may I suggest you running &quot; python -c &apos;import
&gt; aubio.median&apos;&quot; as root with your 0.3.2-r1 version ? then unmerge aubio and have
&gt; a look at /usr/lib64/python2.4/site-packages/aubio/... stray files.. thanks but
&gt; no thanks, I dont want this.


This seems like some kind of problem with automake-1.10, forcing 1.8 fixes this (or maybe with the python.m4 we install?).</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>aballier@gentoo.org</who>
            <bug_when>2008-02-11 20:00:04 0000</bug_when>
            <thetext>(In reply to comment #23)
&gt; I commented on bug #187826, I&apos;m still convinced that my patch here is right
&gt; (its upstream now too). And I&apos;m not convinced at all that the default behavior
&gt; of python (in our 2.4 ebuild) is wrong and that the patch to 2.5 is right.

Hmmm you convinced me, automake&apos;s info page and python&apos;s help about this seem to go in that direction.



&gt; &gt; Especially since:
&gt; &gt; - the ebuild adds obvious warnings due to variables not being quoted
&gt; 
&gt; Fixed


Thanks

&gt; This seems like some kind of problem with automake-1.10, forcing 1.8 fixes this
&gt; (or maybe with the python.m4 we install?).

This is annoying, but well, you&apos;re right using 1.8 fixed this too. The problem doesn&apos;t seem to be in python.m4 as the diff is rather small and will probably need further investigation. (Or perhaps it is now needed to manually run python_mod_optimize/cleanup ?)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rbu@gentoo.org</who>
            <bug_when>2008-02-20 00:55:32 0000</bug_when>
            <thetext>request filed</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>pva@gentoo.org</who>
            <bug_when>2008-02-23 18:22:47 0000</bug_when>
            <thetext>Fixed in release snapshot.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rbu@gentoo.org</who>
            <bug_when>2008-03-03 00:11:41 0000</bug_when>
            <thetext>GLSA 200803-03</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>141581</attachid>
            <date>2008-01-22 14:19 0000</date>
            <desc>Patch applied byu </desc>
            <filename>CVE-2007-6061.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIHNyYy9BdWRhY2l0eUFwcC5jcHAKKysrIHNyYy9BdWRhY2l0eUFwcC5jcHAKQEAgLTM5MSw3
ICszOTEsNyBAQAogICAgLy8gKiBUaGUgdXNlcidzIC5hdWRhY2l0eS1maWxlcyBkaXJlY3Rvcnkg
aW4gdGhlaXIgaG9tZSBkaXJlY3RvcnkKICAgIC8vICogVGhlICJzaGFyZSIgYW5kICJzaGFyZS9k
b2MiIGRpcmVjdG9yaWVzIGluIHRoZWlyIGluc3RhbGwgcGF0aAogICAgI2lmZGVmIF9fV1hHVEtf
XwotICAgZGVmYXVsdFRlbXBEaXIuUHJpbnRmKCIvdG1wL2F1ZGFjaXR5MS4yLSVzIiwgd3hHZXRV
c2VySWQoKS5jX3N0cigpKTsKKyAgIGRlZmF1bHRUZW1wRGlyLlByaW50ZigiLyVzLy5hdWRhY2l0
eTEuMi0lcyIsIGhvbWUuY19zdHIoKSwgd3hHZXRVc2VySWQoKS5jX3N0cigpKTsKICAgIHd4U3Ry
aW5nIHBhdGhWYXIgPSB3eEdldGVudigiQVVEQUNJVFlfUEFUSCIpOwogICAgaWYgKHBhdGhWYXIg
IT0gIiIpCiAgICAgICBBZGRNdWx0aVBhdGhzVG9QYXRoTGlzdChwYXRoVmFyLCBhdWRhY2l0eVBh
dGhMaXN0KTsK
</data>        

          </attachment>
    </bug>

</bugzilla>