From 63d7879941c9bef37544f9a6589b7eaa5cf9bff9 Mon Sep 17 00:00:00 2001 From: Jaydin_MacBook Date: Tue, 16 Jan 2024 11:18:57 -0500 Subject: [PATCH] Fix Issue #11 Uncontrolled data used in path expression --- .gitignore | 2 ++ backend/app.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 78a3d75..edc549e 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ frontend/.env *.pyc *.DS_Store backend/support/.DS_Store +credentials.json +backend/credentials.json \ No newline at end of file diff --git a/backend/app.py b/backend/app.py index a178985..1a1a384 100644 --- a/backend/app.py +++ b/backend/app.py @@ -32,8 +32,8 @@ def is_file_valid(file_path): - return os.path.isfile(file_path) and not os.path.islink(file_path) - + normalized_path = os.path.normpath(file_path) + return os.path.isfile(normalized_path) and not os.path.islink(normalized_path) def remove_file_safely(file_path): try: