Current time: 04-23-2014, 07:15 AM Hello There, Guest! (LoginRegister)


Post Reply 
Installer Suggests Insane CHMOD
10-20-2011, 01:29 PM
Post: #1
Installer Suggests Insane CHMOD
Why on earth does the installer/check-script suggest to chmod 777 anything? - this is inherently insecure! The proper solution would be chmod 775, at least IMHO. Giving "anybody" write-access is bad!
Just google for '"chmod 777" "considered harmful"' - you'll find stuff like this email on lists.e-smith.org.
It's been ages since I've had any ftp-only webspace to manage, but the ftp-user is usually the one running the webserver too .. at least on any webhoster worth their salt. I'd much prefer adding a caveat-notice or answering the occasional newbie question to suggesting this catch-all, considering it's catch-22 ;-P
Find all posts by this user
Quote this message in a reply
10-20-2011, 01:40 PM
Post: #2
RE: Installer Suggests Insane CHMOD
Some webservers have weird configurations, which I believe was the reason for suggesting a 0777 chmod.

If I recall correctly, Matt Rowgowski (Head of support) has requested this change already.
Visit this user's website Find all posts by this user
Quote this message in a reply
10-20-2011, 01:43 PM (This post was last modified: 10-20-2011 01:45 PM by frostschutz.)
Post: #3
RE: Installer Suggests Insane CHMOD
This user has been denied support. This user has been denied support.
It says 777 because it's not really possible to reliably determine the minimum chmod setting that will work on any given host, other than trial and error.

If someone can hack your site because you chmodded something 777, then it's the webserver that was insecure. 775 is just as bad in this case as it gives world-readable rights and if people can read your files they can read your database passwords, and if they can read that you are hacked either way.

Security depends 99% on how the server is set up and 1% on the chmod settings you choose within your shared hosting environment. The 1% still deserves some attention of course, in that you should't make files/directories writable without reason.

Google SEO | Gravatar | Hooks | HTMLPurifier | Overview | Patches | PluginLibrary @ GitHub/frostschutz
Find all posts by this user
Quote this message in a reply
10-23-2011, 11:25 AM
Post: #4
RE: Installer Suggests Insane CHMOD
frostschutz, that is why I mentioned the ftp-only webspace thingie; because I was expecting this to be the reason. As I said, it's not what I'd call "sane" - since so many people will blindly do what it says, without even knowing of the potential risks. At least it doesn't keep clamouring for this actual setting as soon as it has determined the directory is writeable for itself ;-P
I can't help but see that legendary "boy at the dyke" when you say that one vector of attack is more serious than another .. a lot of little holes can leak as much as a big one - and back to the story: if you manage to sneak something into a little hole, you might make a big hole that wasn't there before.
Find all posts by this user
Quote this message in a reply
10-23-2011, 10:29 PM (This post was last modified: 10-23-2011 10:30 PM by Tom K..)
Post: #5
RE: Installer Suggests Insane CHMOD
As already said the problem is that we can't be sure of server setups. If we put it to a more secure CHMOD value, there is a significant chance that it wont work on a lot of setups. That generates lots of support threads, which can often mask real issues and security flaws. It's a lesser of two evils. Smile there really is no efficient way around it.

Quote:Golf and alcohol don't mix, that's why I don't drink and drive!
Video Tutorials: Installing MyBB | Upgrading MyBB
Visit this user's website Find all posts by this user
Quote this message in a reply
10-29-2011, 12:10 PM
Post: #6
RE: Installer Suggests Insane CHMOD
Okay, thought as much - but just couldn't restrain myself from asking. At least now "chmod 777"-searches (wishful thinking) should contain this little bit of background-information. Wink
Feel free to close the thread.
Find all posts by this user
Quote this message in a reply
02-06-2012, 10:55 AM
Post: #7
RE: Installer Suggests Insane CHMOD
Sorry to bring this thread back up, but...

...as a more security conscious admin, how do I best go about determining the safest (read: most restrictive) chmod settings throughout my MyBB installation that will still work under my conditions?

Is there a tutorial on this somewhere?

I know how to use my ftp client of course, and how to change the settings for each file or folder - but how do I figure out what settings to use?

The answer that server setup is much more important, although true, is not good enough for me, I'm afraid (no offense).

Cheers,

Matt
Find all posts by this user
Quote this message in a reply
02-06-2012, 10:58 AM
Post: #8
RE: Installer Suggests Insane CHMOD
Please see: http://mattrogowski.co.uk/?p=314
Visit this user's website Find all posts by this user
Quote this message in a reply
02-06-2012, 12:39 PM
Post: #9
RE: Installer Suggests Insane CHMOD
This user has been denied support. This user has been denied support.
(02-06-2012 10:55 AM)Mariku Wrote:  how do I best go about determining the safest (read: most restrictive) chmod settings throughout my MyBB installation that will still work under my conditions?

read up on chmod / file permissions on wikipedia and understand it (best option)

or use trial and error, going from the most restrictive chmod to the less restrictive ones

for read-only files 4 (read), read-write files 6 (write+read), read-only folders 5 (exec+read), read-write folders 7 (exec+write+read).

then you start with owner only, if that's not enough you add group, and if that's not enough you have to add world, or change the user/group ownership of the file (if possible).

so for

read only files it's 400 (owner read), 440 (owner+group read), 444 (owner+group+world read),

read-write files it's 600 (owner read-write), 660 (owner+group read-write), 666 (owner+group+world read-write),

read-only folders 500 (owner exec read), 550 (owner+group exec read), 555 (owner+group+world exec read),

read-write folders 700 (owner exec read write), 770, 777

pick the first one that works and you have the most restrictive chmod for your setup

Google SEO | Gravatar | Hooks | HTMLPurifier | Overview | Patches | PluginLibrary @ GitHub/frostschutz
Find all posts by this user
Quote this message in a reply
02-07-2012, 12:49 AM
Post: #10
RE: Installer Suggests Insane CHMOD
Thanks both of you, excellent pointers.

Is there an overview somewhere that lists which of the MyBB files require what permissions to function properly? That would be helpful information for someone who does not know the inner workings of MyBB in detail.

Will definitely get deeper into CHMOD, no doubt.

Cheers,

Matt
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | MyBB | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication