From e7894c3712a1647a04affc9306d575d5f2c1ef7f Mon Sep 17 00:00:00 2001 From: Gamosoft Date: Mon, 13 Apr 2026 16:15:03 +0200 Subject: [PATCH] fix for metadata note retrieval --- backend/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/utils.py b/backend/utils.py index 1292165..26629e0 100644 --- a/backend/utils.py +++ b/backend/utils.py @@ -526,7 +526,11 @@ def create_note_metadata(notes_dir: str, note_path: str) -> Dict: """Get metadata for a note""" full_path = Path(notes_dir) / note_path - if not full_path.exists(): + if not full_path.exists() or not full_path.is_file(): + return {} + + # Security check: ensure the path is within notes_dir (same as get_note_content) + if not validate_path_security(notes_dir, full_path): return {} stat = full_path.stat()