Active
Project:
Drupal core
Version:
main
Component:
system.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
5 Dec 2013 at 11:14 UTC
Updated:
20 May 2025 at 04:08 UTC
Jump to comment: Most recent
When checking if the files and temporary files directory are fully protected against arbitrary code execution it is only considered whether or not the string "Drupal_Security_Do_Not_Remove_See_SA_2013_003" is included in an .htaccess file, this is not actually checking that arbitrary code execution is prevented.
For example I have the following in my Nginx config that achieves the same goal:
# Prevent PHP execution in files directory
location ~ ^/sites/.*/files/.*\.(php|php5)$ {
deny all;
}
But this is not recognised by system.install, so I still get error messages appearing on my status report.
rm -f sites/default/files/.htaccess
chmod -w sites/default/files
Suggested resolution is to actually attempt to execute some code rather than simply rely on a string in a file.
Comments
Comment #1
mustanggb commentedComment #2
Andrew Udvare commentedConfirming here. nginx typical install, security measures like the one mentioned are in place (in my install, only very specific pages ending in .php get to execute).
We should not have to put what is a useless file for us (or files) in our sites just to make this warning go away.
Comment #3
mustanggb commentedComment #4
seanrThis is still an issue seven years later. It's readily visible on sites hosted on Pantheon, and while functionally meaningless, it is annoying and invites potential questions from clients requiring difficult technical explanations. Can we not simply check to make sure we're on an Apache server before running this check?
Comment #5
chris matthews commentedI posed this question myself to Pantheon support today and received the below response:
Comment #10
mstrelan commentedUpdated the issue summary with the template and steps to reproduce. Note this issue is about updating the status report to detect the protection, rather than having Drupal provide protection for other servers.
Comment #11
mstrelan commentedI'm not sure about the proposed resolution. It could work for public files directory but since private and temp are usually outside of the web root I don't think we can't really test them.