Skip to content

Commit b64d764

Browse files
fixed security issue with notes deletion (#19)
1 parent 4d11ad5 commit b64d764

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

backend/utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ def delete_folder(notes_dir: str, folder_path: str) -> bool:
132132
try:
133133
full_path = Path(notes_dir) / folder_path
134134

135+
# Security check: ensure the path is within notes_dir
136+
if not validate_path_security(notes_dir, full_path):
137+
print(f"Security: Path is outside notes directory: {full_path}")
138+
return False
139+
135140
if not full_path.exists():
136141
print(f"Folder does not exist: {full_path}")
137142
return False

0 commit comments

Comments
 (0)