Security and Cryptography
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationSecurity and Cryptography

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 19th, 2000, 04:38 PM
coop coop is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Location: Los Angeles, CA, USA
Posts: 3 coop User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
My question is really about how much to expect in terms of security from a commercial web host. I've found a host (who shall remain nameless for the time being) with great prices, good features, but:

I've found what I consider to be some serious security holes in it. All HTML/PHP files on the host have to be world readable for the web server to serve them. This means that things like .htaccess/.htpasswd files have to be world readable, PHP scripts - including the passwords in them to access MySQL tables, etc. are all world readble.

The directory permissions are usually set to world exectuable, but not world readable to prevent other users on the system from at least reading the names in the directory. However, anyone can visit my site, determine filenames from the URL, then cat those files with the full pathname.


Is this kind of security problem common, should I just put up with it, or start looking for another host?


------------------
--Coop/Better Mouse Trap

Reply With Quote
  #2  
Old September 20th, 2000, 06:26 PM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
In fact, it's how insecure most of them are.
You should check for a host that supports SuEXEC or cgiwrap, otherwise, all files must be WORLD readable (-rw-r--r--) including the most insecure PHP script that often use clear-text password within the script to connect to MySQL. Anyone on the same server can simply steal all the contents of other members including passwords.

With SuEXEC or cgiwrap, ther permission of a script can be as low as -rwx------ (700) and a file can be -rw------- (600).

Reply With Quote
  #3  
Old September 20th, 2000, 06:42 PM
coop coop is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Location: Los Angeles, CA, USA
Posts: 3 coop User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I'm assuming that suexec or cgiwrap would set the UID's when running CGI scripts. This seems to be working correctly - if I wrote code in PERL and run it as CGI, it gets executed with the proper UID, and I can access and manipulate private files.

But if I use imbedded PHP code, I believe it's being executed as an Apache Module (good for performance) which operates as nobody. Is there any way for the PHP module to be configured to execute the .php pages as the user that owns them?

At this time, I'm not storying highly sensitive data (no credit cards), so perhaps I'll just bite the bullet and take the risk. I can at least make the database passwords independant of the shell and control panel passwords to all they could get to is my tables URL


------------------
--Coop/Better Mouse Trap

Reply With Quote
  #4  
Old September 20th, 2000, 07:20 PM
freebsd
Guest
Dev Shed Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
>>Is there any way for the PHP module to be configured to execute the .php pages as the user that owns them?

I don't know much about PHP so I can't give you the correct answer but I guess the answer is probably NO. Therefore, PHP coders out there should always remember not to put clear-text username and password within their PHP scripts and thinking nobody can read their codes. Of course, PHP can be installed as CGI but the performance is not as good as an apache module. Don't forget, whatever PHP can do, Perl always can. With SuEXEC or cgiwrap enabled, everyone on the same server can't read others' file with 700 permission.

Reply With Quote
  #5  
Old September 20th, 2000, 07:34 PM
coop coop is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2000
Location: Los Angeles, CA, USA
Posts: 3 coop User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>I don't know much about PHP so I can't give you the correct answer but I guess the answer is probably NO. Therefore, PHP coders out there should always remember not to put clear-text username and password within their PHP scripts and thinking nobody can read their codes. [/quote]

Problem is of course that there's no other way to store the password that isn't also accessible to all users if your PHP code is running as nobody URL

<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Don't forget, whatever PHP can do, Perl always can.[/quote]

I'll avoid getting into a religious debate on which language is better URL, but for me it's about programmer timer - I can code what I want faster in PHP in this case.

<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>With SuEXEC or cgiwrap enabled, everyone on the same server can't read others' file with 700 permission.[/quote]

I'll probably use PERL for anything that I need security for, and stick to PHP for the non sensitive tools. Thanks for the insight!

------------------
--Coop/Better Mouse Trap

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationSecurity and Cryptography > Security of web hosting services


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT