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.

fix: replace ReDoS-vulnerable regex with safer pattern

LearningCircuit40efed1dddc0
diff --git a/src/local_deep_research/web_search_engines/search_engine_factory.py b/src/local_deep_research/web_search_engines/search_engine_factory.py
index 2008a3656f..9a4b549970 100644
--- a/src/local_deep_research/web_search_engines/search_engine_factory.py
+++ b/src/local_deep_research/web_search_engines/search_engine_factory.py
@@ -89,11 +89,14 @@ def create_search_engine(
# e.g., "🔬 OpenAlex (Scientific)"
# Try to extract the base name from the label
+ # Use a safe regex pattern to avoid ReDoS vulnerabilities
import re
- label_match = re.match(r"^.+?\s+(.+?)\s+\(.+\)$", engine_name)
+ # Pattern: non-space chars (icon), space, captured group (base name - no parens),
+ # space, open paren, text, close paren
+ label_match = re.match(r"^[^\s]+\s+([^()]+)\s+\([^)]+\)$", engine_name)
if label_match:
- base_name = label_match.group(1)
+ base_name = label_match.group(1).strip()
logger.info(
f"Extracted base name '{base_name}' from label '{engine_name}'"
)