Skip to content

Commit

Permalink
QA
Browse files Browse the repository at this point in the history
  • Loading branch information
ajinabraham committed Nov 12, 2024
1 parent ba628ec commit 8d3e91a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions mobsf/MobSF/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -969,18 +969,15 @@ def run_func(result, *args, **kwargs):


def set_permissions(path):
# Convert the path to a Path object
base_path = Path(path)
perm_755 = stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH
perm_644 = stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IROTH
# Set permissions for directories and files
for item in base_path.rglob('*'): # Recursively go through all items
for item in base_path.rglob('*'):

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression High

This path depends on a
user-provided value
.
This path depends on a
user-provided value
.
This path depends on a
user-provided value
.
This path depends on a
user-provided value
.
try:
if item.is_dir():
# Set permissions for directories to 755
item.chmod(perm_755)
elif item.is_file():
# Set permissions for files to 644
item.chmod(perm_644)
except Exception:
pass

0 comments on commit 8d3e91a

Please sign in to comment.