From eb26cb92a8ad925c58c7890777da2d266a391dbd Mon Sep 17 00:00:00 2001 From: zanllp Date: Sun, 23 Jul 2023 20:40:02 +0800 Subject: [PATCH] fix path check --- scripts/iib/api.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/iib/api.py b/scripts/iib/api.py index d7909fa..4ea4d09 100644 --- a/scripts/iib/api.py +++ b/scripts/iib/api.py @@ -165,6 +165,8 @@ def infinite_image_browsing_api(app: FastAPI, **kwargs): def is_path_trusted(path: str): if not enable_access_control: return True + if not os.path.isabs(path): + path = os.path.normpath(os.path.join(os.getcwd(), path)) try: parent_paths = mem["all_scanned_paths"] path = os.path.normpath(path)