installed drupal, a few times.
Now am trying to secure it more with 'security review' but am stuck with the following 2 errors.

-PHP files in the Drupal files directory can be executed.
-Some files and directories in your install are writable by the server.

I have already (after backup of the directory)
directory's are 755
files 644
.htaccess 444
settings.php 444

Also tried 555 for files and folders 444.

Still keep getting the warnings, is secure review maby not compete compatible with 7.25 ?
its hosting space from strato, lucky with ssh access.

You can ignore the warnings. But really dont like that whole idea.

Comments

jaypan’s picture

Does it not tell you which files it's referring to?


Contact me to contract me for D7 -> D10/11 migrations.
Or anything really. I'm friendly, and open to work or conversation.
FreeFly’s picture

Yes its telloing me wich files.
Its saying all files have wrong perms. changed it for now back to 755 / 664 and the settings.php back,

/misc
/sites
/modules
/themes

only thing i see is in /sites/all/modules/security_review stores the file_write_test. files
But again i can change the perms for the directory 444 555 it keeps writeing inside there.

So tried 555 on the directory's that keeps security_review from writeing the file.
Going to test a bit with 550 and 440 to.

But last night things where fine for security_review
only the whole drupal where screwed bacause the way to tight permissions.

FreeFly’s picture

Weird. useing 440 on files and 755 on directory's
with 555 on directory's am getting the help page when im clicking details for security review.

SLowly things start to get mangled again. lucky i now have a backup directory

jaypan’s picture

Permissions should be as follows:

Folders:
sites/default - 644
every other folder - 755

Files:
sites/default/settings.php - 444
every other file - 644

You also should have no .php files in your sites/default/files folder (or any other files folder if you are using multisite).


Contact me to contract me for D7 -> D10/11 migrations.
Or anything really. I'm friendly, and open to work or conversation.
FreeFly’s picture

Did the above settings. result is am getting the installation screen back.
Tried the same settings on my virtual machine with own installed linux. same result the installation screen.

sites/default - 644 is not allowed to have 644. but need to be 755.
not finetuned it but with 644 you get the installation screen.

Ok, i have now one error left. on my Virtual machine.
on the webhosting i have 2 errors left.
"PHP files in the Drupal files directory can be executed."

FreeFly’s picture

Because its working better on my own linux server in virtualbox.
Besides the "PHP files in the Drupal files directory can be executed."
Am not sure if security review can reas the .htacces correct in /default/files

jaypan’s picture

Pre-installation the sites/default folder needs to be 755. Drupal will change this to 644 during installation.


Contact me to contract me for D7 -> D10/11 migrations.
Or anything really. I'm friendly, and open to work or conversation.
vm’s picture

Perms may be environmentally dependent to some degree as a Drupal installation uses 555 on default folder/s in my installations.

FreeFly’s picture

If i change the sites/default manual to 644 it start to display the installation screen. Until i changed it back to 755 then i get the administrator screen back. also my linux VM showes it green and secure then. only the problem with .htaccess or something like that in files shows error.

FreeFly’s picture

Ok. looks like the directory permissions are right, i need to keep a directory list in file for later.
Its a bit different from what all drupal sites say.
Now i have only the little error left. "PHP files in the Drupal files directory can be executed."
And i think thats maby error in security_review, because the .htaccess file looks fine.
Probleem you need the execute on places or drupal site break terrible

Executable PHP in files directory

The Drupal files directory is for user-uploaded files and by default provides some protection against a malicious user executing arbitrary PHP code against your site.

Read more about the risk of PHP code execution on Drupal.org.

Security Review was able to execute a PHP file written to your files directory.

The .htaccess file exists but does not contain the correct content. It is possible it's been maliciously altered.
Upbeat’s picture

I am on a shared hosting system and I get the same errors on security review. Directories are set to 755, files to 644, settings.php, index.php and all .htaccess files (per SA-CORE-2013-003) are set to 444.

A patch shown in the issues of Security_Review fixed the error about executable PHP files.

Did your errors go away or are you ignoring them? Are you also on a shared host?

Upbeat’s picture

I changed all directories to 555 except for sites/default/files which I had to set to 755 to make it work. Don't ask me why but it works.