Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

Potential fix for code scanning alert no. 18: Uncontrolled command line

Daniel Petti00cb68e3c3af
diff --git a/src/local_deep_research/web/routes/settings_routes.py b/src/local_deep_research/web/routes/settings_routes.py
index e2e57d2c3b..2a22364a90 100644
--- a/src/local_deep_research/web/routes/settings_routes.py
+++ b/src/local_deep_research/web/routes/settings_routes.py
@@ -1214,13 +1214,19 @@ def open_file_location():
flash("No file path provided", "error")
return redirect(url_for("settings.settings_page"))
- # Get the directory containing the file
- dir_path = os.path.dirname(os.path.abspath(file_path))
-
- # Open the directory in the file explorer
try:
+ # Validate the file path
+ file_path = os.path.abspath(file_path)
+ if not os.path.exists(file_path):
+ flash("File path does not exist", "error")
+ return redirect(url_for("settings.settings_page"))
+
+ # Get the directory containing the file
+ dir_path = os.path.dirname(file_path)
+
+ # Open the directory in the file explorer
if platform.system() == "Windows":
- subprocess.Popen(f'explorer "{dir_path}"')
+ subprocess.Popen(["explorer", dir_path])
elif platform.system() == "Darwin": # macOS
subprocess.Popen(["open", dir_path])
else: # Linux