From 87269b9393b955f3249f1e0e790eb250dabc4703 Mon Sep 17 00:00:00 2001 From: Pier-Jean Malandrino Date: Fri, 3 Apr 2026 13:03:48 +0200 Subject: [PATCH] Add PDF type validation to file picker upload The drop handler validated PDF type but the file picker did not, allowing non-PDF files to bypass client-side validation. --- frontend/src/features/document/ui/DocumentUpload.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/features/document/ui/DocumentUpload.vue b/frontend/src/features/document/ui/DocumentUpload.vue index 26b664c..49613c7 100644 --- a/frontend/src/features/document/ui/DocumentUpload.vue +++ b/frontend/src/features/document/ui/DocumentUpload.vue @@ -42,7 +42,10 @@ function openFilePicker() { async function onFileSelect(e: Event) { const target = e.target as HTMLInputElement const file = target.files?.[0] - if (file) { + if ( + file && + (file.type === 'application/pdf' || file.name.toLowerCase().endsWith('.pdf')) + ) { try { store.clearError() const doc = await store.upload(file)