Problem/Motivation
Over in #2599326: Autocomplete function fails when index.html exists - After upgrading to Drupal 7.39 and chaos tools 1.8 there was a commit (#2551236) which attempted to deal with autocomplete not working on servers which weren't configured to automatically recognize index.php; however this change has now broken autocomplete for server configurations which ensure Drupal only receives clean URLs (i.e. requests prefixed with index.php are blocked).
A popular config that behaves this way is perusio's Nginx config for Drupal.
It would of course be possible to update the server config to not block these requests; however this is not the desired behaviour for many system admins, be it for security concerns, information leakage, unclean log files/Google Analytics data, or some other reason that I haven't contemplated thus far.
Also I'm putting this as a feature request rather than a bug report (regression) because David_Rothstein indicated that although blocking index.php has always worked through the life of D7 until now this technically isn't a supported way of doing it.
Proposed resolution
Either:
1) Update the 7.39 security fix so that this prefixing is not necessary (for some reason regular ajax requests don't need to be prefixed so in theory it should be possible somehow).
or
2) Make this behaviour optional by way of allowing a site admin to toggle it on or off.
Regarding (1) it would appear that no-one with the skills and knowledge (security team) has the time or motivation to do this, so (2) would seem to be a logical compromise.
Remaining tasks
- Write patch
- Review and test
- Update documentation
User interface changes
None
API changes
None
Data model changes
None
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | autocomplete-security-optional-2749007-9.patch | 2.37 KB | pacproduct |
| #7 | autocomplete-security-optional-2749007-7.patch | 2.36 KB | pacproduct |
| #2 | autocomplete-security-optional-2599326-80.patch | 2.35 KB | mustanggb |
Comments
Comment #2
mustanggb commentedRe-uploading pounard's patch from #2599326-80: Autocomplete function fails when index.html exists - After upgrading to Drupal 7.39 and chaos tools 1.8 , although I can already see it needs work due to spelling and code formatting.
Comment #3
mustanggb commentedAnd of course I said it, but forgot the change the status.
Comment #4
pounardThank you for opening the issue, as I stated in the original issue, this security fix actually breaks lots of sites, where we don't want to expose index.php and fully disable and disallow clean URL.
Comment #5
pounardComment #6
jweowu commentedComment #7
pacproduct commentedRe-rolling the patch with minor fixes: variable name + else identation.
Comment #9
pacproduct commentedPatch recreated by strictly following https://www.drupal.org/node/3060/git-instructions/7.x/nonmaintainer
Comment #10
mustanggb commentedThanks!
Comment #12
socialnicheguru commentedthank you for this.
I am using Varnish.
none of the autocomplete functionality would work.
this patch and the accompanying addition to settings.php has solved the problem
Comment #13
David_Rothstein commentedIf we're really going to allow people to undo a security feature by setting a variable, this needs some clear documentation of the specific security risks involved.
And we also need to be clear about why we're providing that option. I'm still not 100% clear on it myself, and the issue summary here seems to be intertwining a couple unrelated things. To summarize how I see it:
example.com/?q=some/pathfrom coming to Drupal) then that's a bit of a different story and your problem dates back to the original security release itself. My question would still be similar as above: why not redirect rather than block? (see also #2554203: Security fix in Drupal 7.39 may cause inefficient autocomplete when used with Global Redirect) You probably lose part of the security protection if you redirect (just like if you block), but it's more of a secondary security protection anyway, and then you don't have the problem with autocomplete plus will avoid other potential problems as well.I can see more of an argument for the patch in this issue based on people in this situation, but it still sounds like a highly unusual configuration and it would be preferable not to complicate the core code for that. If you really need to block those ?q= requests entirely, any reason not to deal with the autocomplete problem via custom/contrib code too (it should be possible to use hook_element_info_alter() to add another process function that runs after form_process_autocomplete() and switches the URL then)?
Comment #14
David_Rothstein commentedComment #15
joseph.olstadBumping to 7.70. This didn't make it into 7.60.