[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: SECURITY HOLE in MySQL module in PHP



Hello!

On Thu, 7 Feb 2002, Halil Demirezen wrote:

> I come accross such a thing before,
>
> In one of the directory a file has got permissions for only www-data
> but no other users can get access to that file. but writing a single php
> script you can see what that file has and you can easily see the contents
> of any directory on which a normal user even doesn't have "ls -all" access.
>
> I think fixing this is not easy. to me, it sounds as if it is a dilemma.
> You let a www-data to access that file for processing some jobs. and you
> want it not to be access by an ordinary user. The user then becomes able
> to access it using the www-data's privileges and php script.

Safe-mode in php is intended to solve this problem.  This is additional
security level.  PHP doing extra checks before give you chance to
access file.  It checks that file you trining to access is owned by you
(by script's owner) and if not - php deny access to file.  So, php script
owned by user X can not access files owned by Y, even Y's files have read access
to "others".  This is very usefull feature for hosting providers, because
you can prevent accessing files from foreign virtual-hosts by your users.

For example in situation:
www.site1.com - owned by user X
www.site2.com - owned by user Y
and both of them hosted on one www-server and uses PHP.

Best regards,
Dmitry N. Hramtsov




Reply to: