[<prev] [next>] [day] [month] [year] [list]
Message-ID: <3EF30454.2040100@starzetz.de>
Date: Fri, 20 Jun 2003 14:55:48 +0200
From: Paul Starzetz <paul@...rzetz.de>
To: bugtraq@...urityfocus.com, vendor-sec <vendor-sec@....de>
Subject: Linux /proc sensitive information disclosure
Hello,
attached a simple prrof of concept for the /proc filesystem disclosing
sensitive information.
I noticed that opening an entry from /proc/self/ and keeping the file
open while executing a setuid binary prevents the opened proc entry from
changing the ownership from the initial user to the set-uid value.
However I'm not very sure about the impact of this bug (feature), the
attached code just reads the environment (which is per default mode 400).
The technique can not be applied to /proc/self/mem because the permision
checks are made dynamically (the child must be ptraced etc.).
This is a sample output of the PoC:
paul@...e:~/dev/expl> ./procex
parent executing setuid
PING 127.0.0.1 (127.0.0.1) from 127.0.0.1 : 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.066 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.061 ms
child reads parent's proc:
PWD=/home/paul/..........
Content of /proc/32353
ls: /proc/32353/cwd: Permission denied
ls: /proc/32353/root: Permission denied
ls: /proc/32353/exe: Permission denied
-r--r--r-- 1 root root 0 Jun 20 14:47 cmdline
lrwxrwxrwx 1 root root 0 Jun 20 14:47 cwd
-r-------- 1 paul users 0 Jun 20 14:47 environ [*]
lrwxrwxrwx 1 root root 0 Jun 20 14:47 exe
[...]
-r--r--r-- 1 root root 0 Jun 20 14:47 status
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.060 ms
--- 127.0.0.1 ping statistics ---
3 packets transmitted, 3 received, 0% loss, time 1998ms
rtt min/avg/max/mdev = 0.060/0.062/0.066/0.007 ms
[*] as you can see here the ownership didn't change...
/ih
View attachment "procex-poc.c" of type "text/plain" (1422 bytes)
Powered by blists - more mailing lists