summaryrefslogtreecommitdiff
path: root/informationals/teso-i0026.txt
diff options
context:
space:
mode:
Diffstat (limited to 'informationals/teso-i0026.txt')
-rw-r--r--informationals/teso-i0026.txt54
1 files changed, 54 insertions, 0 deletions
diff --git a/informationals/teso-i0026.txt b/informationals/teso-i0026.txt
new file mode 100644
index 0000000..f2178ac
--- /dev/null
+++ b/informationals/teso-i0026.txt
@@ -0,0 +1,54 @@
10026 2000/05/30 file existance check through suid binaries
2
3==== TESO Informational =======================================================
4This piece of information is to be kept confidential.
5===============================================================================
6
7Description ..........: file existance check through suid binaries
8Date .................: 2000/05/30 22:00
9Author ...............: scut
10Publicity level ......: most likely known
11Affected .............: some suid binaries
12Type of entity .......: program behaviour
13Type of discovery ....: useful information
14Severity/Importance ..: low
15Found by .............: scut
16
17===============================================================================
18
19Some suid binaries take filenames as arguments. Some of them even do something
20with the files they take as arguments. And some will even tell you somehow what
21happened when they do something.
22
23This natural behaviour may manifast itself in a small error which could be
24security relevant glitch which allows to check for file existance, although
25normally your permission would forbid that.
26
27As an example, here is the behaviour of the latest IRIX 6.5 netstat binary,
28which happens to have setgid sys permissions. The directory "/tmp/rootonly"
29is only accessible to the root user and users in the sys group, so normal
30users don't have permission to access it, but netstat has.
31Netstat uses the stat() function to check for file existance.
32
33hyperion 24% ls -lsa /tmp/rootonly/
34Cannot access directory /tmp/rootonly/: Permission denied
35total 0
36hyperion 25% ls -lsa /tmp/rootonly/foobar
37Cannot access /tmp/rootonly/foobar: Permission denied
38hyperion 26% /usr/etc/netstat 1 /tmp/rootonly/foo
39netstat: cannot open /tmp/rootonly/foo: No such file or directory
40hyperion 27% /usr/etc/netstat 1 /tmp/rootonly/foobar
41 input (ec0) output input (Total) output
42 packets errs packets errs colls packets errs packets errs colls
43 14980 0 10661 0 45 15353 0 11034 0 45
44hyperion 28%
45
46The same can be applied to directories, which can be stat'ed too. There
47is a trick to decide whether a found name is a directory or not.
48Let's say you discovered that there is something stat'able called "foo".
49Just append a "/." to it and check for "foo/.". If it is a file this
50won't work, if it is a directory, stat() will happen as if you didn't
51appended the string.
52
53===============================================================================
54