NextCloud NGINX Sicherheitslücke schließen !Wichtig!

Eine kleine Änderung in der NGINX Konfiguration, um externe Ausführungen von php Scripts in Nextcloud zu verhindern.

Ich habe eine Nachricht von Nextcloud erhalten, wo es um die Anpassung von den NGINX Einstellungen geht, um eine wichtige Sicherheitslücke zu schließen. Dazu verbindet ihr euch mit eurem Server per SSH und bearbeitet die NGINX Konfiguration mit dem Befehl:

sudo nano /etc/nginx/sites-available/default

In dieser Datei müsst ihr folgende Änderungen machen

location / {
  rewrite ^ /index.php$request_uri;
}
location / {
  rewrite ^ /index.php;
}
location ~ ^\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+)\.php(?:$|\/) {
  fastcgi_split_path_info ^(.+?\.php)(\/.*|)$;
  include fastcgi_params;
  fastcgi_param SCRIPTFILENAME $document_root$fastcgi_script_name;
  fastcgi_param PATHINFO $path_info;
  fastcgi_param HTTPS on;
  # Avoid sending the security headers twice
  fastcgi_param modHeadersAvailable true;
  # Enable pretty urls
  fastcgi_param front_controller_active true;
  fastcgi_pass php-handler;
  fastcgi_intercept_errors on;
  fastcgi_request_buffering off;
}
location ~ ^\/(?:index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+)\.php(?:$|\/) {
  fastcgi_split_path_info ^(.+?\.php)(\/.*|)$;
  try_files $fastcgi_script_name =404;
  include fastcgi_params;
  fastcgi_param SCRIPTFILENAME $document_root$fastcgi_script_name;
  fastcgi_param PATHINFO $path_info;
  fastcgi_param HTTPS on;
  # Avoid sending the security headers twice
  fastcgi_param modHeadersAvailable true;
  # Enable pretty urls
  fastcgi_param front_controller_active true;
  fastcgi_pass php-handler;
  fastcgi_intercept_errors on;
  fastcgi_request_buffering off;
}

Danach müsst ihr euren Server neustarten. Das macht ihr mit dem Befehl:

sudo service nginx restart

Sobald ihr das gemacht habt, müsstet ihr wieder auf der sicheren Seite sein.

Themen

Bugfixing Cloud Hack Linux nginx php Raspberry Pi Sicherheit

Beitrag teilen

WhatsAppen

Folgen Sie uns