LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 02-08-2014, 07:32 PM   #1
Corpus-Khu
LQ Newbie
 
Registered: Oct 2011
Posts: 19

Rep: Reputation: Disabled
Low worry permissions inquiry


I do not believe my scripts should execute when I call them from the browser if apache's www-data does not have permission..

1. The scripts are php
2. Owner is root
3. Owner is the only one with write + execute permissions
4. the scripts still run when called from a browser outside
the local network.
5. Standard apache2 and php install on debian wheezy

Is it possible that apache is starting under the root user account?

To diagnose such a situation, where so I start? Can I monitor what user accesses a file? what tools can help me trouble shoot.

Is it at all possible that apache opens the file reads and parses it ignoring the execute permissions? Seeing as a php file can make changes to it's neighbors I do not feel secure with this even though it does not have permission to make changes. To disable a script in a web accessable directory would it be appropriate to deny read permissions.
 
Old 02-08-2014, 07:36 PM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,264
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
PHP scripts do not require execute permission to be parsed by the web server.

In general, if you don't want people with access to the URL to see something, DON'T put it in the web server accessible tree!
 
Old 02-08-2014, 07:48 PM   #3
Corpus-Khu
LQ Newbie
 
Registered: Oct 2011
Posts: 19

Original Poster
Rep: Reputation: Disabled
Thank you, after all consideration I do feel secure with this.

I however did consider the possibilty of signing all my php scripts and implimenting a way in apache to verify this signature so if by chance a rogue script finds it's way into my webdirectory my file verification module would also have to be compromised to allow it to be parsed. Thats all, this solves my paranoi --
 
Old 02-10-2014, 01:57 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
You could put all scripts on a read-only mount ...
 
Old 02-10-2014, 06:35 PM   #5
Corpus-Khu
LQ Newbie
 
Registered: Oct 2011
Posts: 19

Original Poster
Rep: Reputation: Disabled
I like that idea, I would like to add: One could give www-data quota restrictions in case some corruption some how happens on the loopmounted image you have enough space to recover.

Is it some how possible instead of having to remount every time you make changes , and instead mount the image twice where: one is mounted in a seperate system with write permissions, I do not think it would cause any race conditions or access issues as one is read only. I would be willing to guess that errors on mounting an image twice would emerge in the process, if one mount is read only though I would erge that they only be warnings.
 
  


Reply



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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: CompuLab Utilite: A Tiny, Low-Power, Low-Cost, ARM Linux Desktop LXer Syndicated Linux News 0 02-03-2014 03:21 PM
Newbie Low Money Low Ram Laptop User Frankman3 Linux - Newbie 8 07-11-2013 07:00 PM
Ideas for a low cost, low power, low noise web server/torrent box alecjtaylor Linux - Hardware 13 01-10-2012 05:26 AM
make a command in bash with low priority ( low server load) m_abdelfattah Linux - Newbie 1 07-25-2009 09:29 AM
TAR errors - to worry or not to worry?? dudeha Linux - General 2 12-31-2002 03:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 06:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration