Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 151359

Summary: www-apache/mod_tcl: HTTP Server mod_tcl set_var Format String Vulnerability (CVE-2006-4154)
Product: Gentoo Security Reporter: Aarni Honka <aarni.honka>
Component: VulnerabilitiesAssignee: Gentoo Security <security>
Status: RESOLVED FIXED    
Severity: major CC: apache-bugs
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://labs.idefense.com/intelligence/vulnerabilities/display.php?id=421
Whiteboard: B1 [glsa] Falco
Package list:
Runtime testing required: ---

Description Aarni Honka 2006-10-14 09:46:27 UTC
Apache HTTP Server mod_tcl set_var Format String Vulnerability

I. BACKGROUND

The mod_tcl module for the Apache httpd v2.x is a scripting module that
allows a TCL developer to create server side script pages in TCL. It is
available as a contrib package for several distributions. For more
information, see http://tcl.apache.org/.

II. DESCRIPTION

Remote exploitation of a format string vulnerability in the mod_tcl
module for the Apache httpd v2.x could allow attackers to execute
arbitrary code in the context of the httpd.

Due to programmer error, user supplied data is passed as the format
string specifier to several calls to an internally defined variable
argument function. The function 'set_var' is declared as follows:

  mod_tcl.h:117:void set_var(Tcl_Interp *interp, char *var1, 
                             char *var2, const char *fmt, ...);

Several insecure calls to this function are made through out the code,
as seen below:

  tcl_cmds.c:437:         set_var(interp, nm_var, (char*) key, 
                                  (char*) val);
  tcl_cmds.c:2231:                set_var(interp, nm_env, env[i], 
                                          sptr + 1);
  tcl_core.c:650:                         set_var(interp, namespc, 
                                                  vl[i].var2, 
                                                  vl[i].var3);

III. ANALYSIS

Successful exploitation allows remote attackers to gain local access to
the vulnerable system in the context of the affected httpd. To exploit
this vulnerability, the attacker must know the location of at least one
tcl server script that is configured to use this module for processing.

IV. DETECTION

iDefense has confirmed the existence of this vulnerability in version
1.0 of mod_tcl for Apache 2.x.

V. WORKAROUND

iDefense is currently unaware of any workarounds for this issue.

VI. VENDOR RESPONSE

The Apache mod_tcl team have addressed this vulnerability with mod_tcl
version 1.0.1. It is available from http://tcl.apache.org/mod_tcl/

VII. CVE INFORMATION

The Common Vulnerabilities and Exposures (CVE) project has assigned the
name CVE-2006-4154 to this issue. This is a candidate for inclusion in
the CVE list (http://cve.mitre.org), which standardizes names for
security problems.

VIII. DISCLOSURE TIMELINE

08/16/2006 Initial vendor notification
10/11/2006 Initial vendor response
10/13/2006 Coordinated public disclosure
Comment 1 Raphael Marichez (Falco) (RETIRED) gentoo-dev 2006-10-16 07:09:34 UTC
Hey Aarni; do you want to help us ? come on on #gentoo-security :)


+ http://secunia.com/advisories/22458/

i rate it as B1/major :

*1 because of remote code exec
B* because Apache is widely used (=> A*) but the default configuration is not vulnerable (!mod_tcl)
It is (hopefully) the same if we consider only the mod_tcl package (B*)


Apache team, Secunia tells to upgrade to the 1.0.1 version. Could you have a look please and bump?
Comment 2 Michael Stewart (vericgar) (RETIRED) gentoo-dev 2006-10-16 20:33:15 UTC
This package is annoying, nothing like having to play release manager for upstream as they don't roll tarballs. Anyways, doing a svn co and rolling my own tarball is simple enough, and so now we are waiting for the mirrors to propogate.

www-apache/mod_tcl-1.0.1 is now in CVS.
Comment 3 Matthias Geerdsen (RETIRED) gentoo-dev 2006-10-17 06:00:27 UTC
arches, pls test and mark stable if possible
Comment 4 Markus Meier gentoo-dev 2006-10-17 11:30:38 UTC
1. emerges fine on x86
2. passes collision test
(didn't do any further tests.)

emerge --info
Portage 2.1.1 (default-linux/x86/2006.1/desktop, gcc-4.1.1, glibc-2.4-r3, 2.6.17.13 i686)
=================================================================
System uname: 2.6.17.13 i686 AMD Athlon(TM) XP1800+
Gentoo Base System version 1.12.5
Last Sync: Tue, 17 Oct 2006 16:50:01 +0000
ccache version 2.3 [enabled]
app-admin/eselect-compiler: [Not Present]
dev-java/java-config: 1.3.7, 2.0.30
dev-lang/python:     2.3.5-r3, 2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.3
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.13-r4
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r1
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -march=i686 -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--nospinner"
FEATURES="autoconfig ccache collision-protect distlocks fixpackages metadata-transfer parallel-fetch sandbox sfperms strict test userfetch userpriv usersandbox"
GENTOO_MIRRORS="http://mirror.switch.ch/mirror/gentoo/ http://gentoo.inode.at/"
LANG="en_GB.utf8"
LINGUAS="en de en_GB"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/normal"
SYNC="rsync://192.168.2.1/gentoo-portage"
USE="x86 3dnow 3dnowext X a52 aac acpi alsa apache2 bash-completion berkdb bitmap-fonts bzip2 cairo cdr cli cracklib crypt css cups dbus divx4linux dlloader dri dts dvd dvdr dvdread elibc_glibc emboss exif fam ffmpeg firefox font-server fortran gdbm gif gnome gphoto2 gpm gstreamer gtk gtk2 gtkhtml hal input_devices_keyboard input_devices_mouse ipv6 isdnlog java jpeg kde kernel_linux ldap libclamav libg++ linguas_de linguas_en linguas_en_GB logitech-mouse mad mikmod mmx mmxext mono mozcalendar mozdevelop mozsvg mp3 mpeg ncurses network nls nptl nptlonly nvidia oav ogg opengl oss pam pcre perl png ppds pppd python qt qt3 qt4 quicktime readline reflection samba sdl seamonkey session spell spl ssl tcltk tcpd test tetex tiff truetype truetype-fonts type1-fonts udev unicode usb userland_GNU vcd video_cards_none video_cards_nv vorbis win32codecs xine xinerama xml xorg xorg-x11 xprint xv xvg xvid zlib"
Unset:  CTARGET, INSTALL_MASK, LC_ALL, LDFLAGS, MAKEOPTS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 5 Joshua Jackson (RETIRED) gentoo-dev 2006-10-19 21:48:59 UTC
It requires a bit of configuration, but on x86 I get a hello world from this sites example configuration 

http://tcl.apache.org/mod_tcl/
Comment 6 Christian Faulhammer (RETIRED) gentoo-dev 2006-10-19 22:46:50 UTC
Remove x86 from cc
Comment 7 Tobias Scherbaum (RETIRED) gentoo-dev 2006-10-20 23:32:05 UTC
ppc stable, this one's ready for glsa.
Comment 8 Raphael Marichez (Falco) (RETIRED) gentoo-dev 2006-10-26 15:13:41 UTC
mmm, old GLSA 200610-12