From 5b115d27f73e4f9fabd1718ced1133cbacba2775 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 7 Oct 2026 04:10:06 +0000 Subject: [PATCH] Fix insecure extension check in read_sheet_file Co-authored-by: Horizontal42 <75383519+Horizontal42@users.noreply.github.com> --- src-tauri/src/main.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 9a32958..1668980 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -938,8 +938,12 @@ fn load_extensions(app: AppHandle) -> Vec { } fn is_sheet_path(path: &str) -> bool { - let lower = path.to_lowercase(); - lower.ends_with(".numi") || lower.ends_with(".sum") + std::path::Path::new(path) + .extension() + .map_or(false, |ext| { + let ext = ext.to_string_lossy().to_lowercase(); + ext == "numi" || ext == "sum" + }) } /// A sheet handed to us by the OS (file association, second launch): same