Procházet zdrojové kódy

Fix nextcloud leak of version information

This could be of obvious use to adversaries
Bob Mottram před 7 roky
rodič
revize
32d89e951f
1 změnil soubory, kde provedl 18 přidání a 0 odebrání
  1. 18
    0
      src/freedombone-app-nextcloud

+ 18
- 0
src/freedombone-app-nextcloud Zobrazit soubor

@@ -483,6 +483,15 @@ function install_nextcloud_main {
483 483
         echo '  # Index' >> $nextcloud_nginx_site
484 484
         echo '  index index.php;' >> $nextcloud_nginx_site
485 485
         echo '' >> $nextcloud_nginx_site
486
+
487
+        # By default nextcloud advertises highly specific version information
488
+        # on status.php, which can obviously be used by adversaries.
489
+        # Blocking status.php prevents this information leak
490
+        echo '  location = /status.php {' >> $nextcloud_nginx_site
491
+        echo '    return 404;' >> $nextcloud_nginx_site
492
+        echo '  }' >> $nextcloud_nginx_site
493
+        echo '' >> $nextcloud_nginx_site
494
+
486 495
         echo '  # PHP' >> $nextcloud_nginx_site
487 496
         echo '  location ~ \.php {' >> $nextcloud_nginx_site
488 497
         echo '    include snippets/fastcgi-php.conf;' >> $nextcloud_nginx_site
@@ -539,6 +548,15 @@ function install_nextcloud_main {
539 548
     echo '  # Index' >> $nextcloud_nginx_site
540 549
     echo '  index index.php;' >> $nextcloud_nginx_site
541 550
     echo '' >> $nextcloud_nginx_site
551
+
552
+    # By default nextcloud advertises highly specific version information
553
+    # on status.php, which can obviously be used by adversaries.
554
+    # Blocking status.php prevents this information leak
555
+    echo '  location = /status.php {' >> $nextcloud_nginx_site
556
+    echo '    return 404;' >> $nextcloud_nginx_site
557
+    echo '  }' >> $nextcloud_nginx_site
558
+    echo '' >> $nextcloud_nginx_site
559
+
542 560
     echo '  # PHP' >> $nextcloud_nginx_site
543 561
     echo '  location ~ \.php {' >> $nextcloud_nginx_site
544 562
     echo '    include snippets/fastcgi-php.conf;' >> $nextcloud_nginx_site