The nginx configuration causes any URL with a ";" to be 403 (access denied). This is a bit over-zealous, considering buggy email readers will convert an ampersand (&) to &.

http/Provision/Config/Nginx/server.tpl.php

map $args $is_denied {
default '';
- ~*delete.+from|insert.+into|select.+from|union.+select|onload|\.php.+src|system\(.+|document\.cookie|\;|\.\. is_denied;
+ ~*delete.+from|insert.+into|select.+from|union.+select|onload|\.php.+src|system\(.+|document\.cookie|\.\. is_denied;
}

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bgm created an issue. See original summary.

bgm’s picture

Status: Active » Needs review
FileSize
956 bytes

patch

omega8cc’s picture

It is here by design. Removing protection like this is not a solution, though, if you don't like it. We should perhaps move the configuration which depends on this regex to <?php if ($nginx_config_mode == 'extended'): ?>

###
### Deny listed requests for security reasons.
###
if ($is_denied) {
  return 403;
}
omega8cc’s picture

Title: nginx over-zealous filter causes 403 » Nginx: Use $args sec filtering only in the extended config
Assigned: Unassigned » omega8cc
Category: Bug report » Feature request
Status: Needs review » Needs work
omega8cc’s picture

Assigned: omega8cc » Unassigned
Status: Needs work » Fixed

Change committed.

bgm’s picture

I think it's debatable for the ";" in URLs, but the fix you committed in provision works for me, and I do appreciate that the nginx configuration comes with "batteries included".

omega8cc’s picture

Most of the time the ";" in URLs (args) is a malicious attempt to trick the server into downloading and executing some evil code. The "buggy email readers" problem is a very low price for this protection, and thus the protection shouldn't be removed, but of course it belongs to the 'extended' config mode.

Thanks for bringing this to our attention!

omega8cc’s picture

Category: Feature request » Bug report

Indeed, it was a bug and not a feature request.

omega8cc’s picture

Project: Hosting » Provision
Component: Code » HTTP Service

Moving this to the correct queue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.