From cf370a80353683385b824547eaebd0cbcc408b15 Mon Sep 17 00:00:00 2001 From: Jeppe B <2jepp9350@gmail.com> Date: Mon, 1 Jun 2026 23:11:48 +0200 Subject: [PATCH] Fix unauthenticated pdf_store access in file server --- services/nginx/app/file_server.php | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/services/nginx/app/file_server.php b/services/nginx/app/file_server.php index ca217eef..8ea7ef52 100644 --- a/services/nginx/app/file_server.php +++ b/services/nginx/app/file_server.php @@ -40,20 +40,6 @@ if ($isPDF && $isPDFStore) { // Check if the certificate exists if (!$wash_certificate_store->isFileInStore($file)) { - // Try the PDF store - $pdf_store = new \classes\pdf_store(); - if ($pdf_store->isFileInStore(str_replace('/files/', '', $file))) { - // Download the certificate from the PDF store to /tmp - $certificate_path = $pdf_store->download(str_replace('/files/', '', $file)); - // Send the certificate to the client - header('Content-Type: application/pdf'); - header('Content-Disposition: inline; filename="' . str_replace('/files/', '', $file) . '"'); - header('Content-Length: ' . filesize($certificate_path)); - readfile($certificate_path); - // Delete the certificate from /tmp after sending it - unlink($certificate_path); - exit; - } echo 'Certificate not found in store' . $file; //header('HTTP/1.1 404 Not Found'); exit; @@ -118,4 +104,4 @@ if (!$isPDF) { // Delete the file from /tmp after sending it unlink($file_path); exit; -} \ No newline at end of file +}