Problem/Motivation
We provide a .htaccess file in the config active directory, but not the staging directory
Proposed resolution
Dynamically add: .htaccess to config staging
Much like .htaccess is added to config active now.
Remaining tasks
Actually code it.
User interface changes
None.
API changes
None.
Original report by hass
// Text of original report here.
(for legacy issues whose initial post was not the issue summary)
As an outcome of #1914018: hook_requirements() for un-protected configuration directories I found that web.config is not protecting the folders sites\default\files\config_*.
We may also need to review the match filters of .htaccess in the root folder of Drupal if we need to do something there or not.
Comments
Comment #1
chx commentedComment #2
gddWe should not be globally blocking .yml from the root, because there are lots of uses for it in other areas of core and contrib that are unrelated to CMI and may legitimately need to be left available. There is already one in the root of the active directory which is Deny from all so that is covered. We should however add one for the staging directory, that is a legitimate task.
Comment #3
chx commentedComment #4
swentel commentedThere you go
Comment #5
gddThere is actually already an issue for the web.config at #1543392: Add a web.config to the several directories similar to the .htaccess file. So lets just take care of the staging .htaccess in this issue and leave web.config in the other one.
Comment #5.0
gddUpdated issue summary.
Comment #6
chx commentedPurr-fect.
Comment #7
hass commentedThis issue was opened because everyone is able to enter the public config url to the config_* folder and can read all .yml files and there is no .htaccess protection at all.
This is not a feature. I'm not sure how #4 should protect against this type of attacks. I will switch #1543392: Add a web.config to the several directories similar to the .htaccess file into a critical bug.
Comment #8
hass commentedPlease don't highjack my case.
Comment #9
swentel commentedYou now just hijacked it yourself, keep it like it is, this works perfect with .htaccess, web.configs can be solved in the other one.
Comment #10
chx commentedPer #5.
hass, we told you several times that "everyone is able to enter the public config url to the config_*" is false because you can't know the *. It's saying "anyone can create the session cookie for uid 1". Right. In fact, they are the same strength hash wise. And, similarly any code has access to the session id and could reveal it much like it could print the path to the active config dir. Do not get overexcited over this and stop opening uncounted numbers of criticals over it. Yes, we get the concerns, they are being patched, calm down.
Comment #11
catchCommitted/pushed to 8.x, thanks!
Comment #12
hass commentedComment #13.0
(not verified) commentedUpdated issue summary.