Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion sentinelops-backend/app/services/local_git_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,13 @@
return ""
if not os.path.isdir(normalized):
return ""
if not os.path.isdir(os.path.join(normalized, ".git")):
git_dir = os.path.realpath(os.path.join(normalized, ".git"))
try:
if os.path.commonpath([git_dir, normalized]) != normalized:
return ""
except ValueError:
return ""
if not os.path.isdir(git_dir):

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression High

This path depends on a
user-provided value
.
return ""
return normalized

Expand Down
Loading