Skip to content

Commit

Permalink
Check for internet before attempting to download APK (#2422)
Browse files Browse the repository at this point in the history
* Check for internet before attempting to download APK
  • Loading branch information
ayushmanchhabra authored Sep 20, 2024
1 parent 8ebe498 commit f6193dc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mobsf/MobSF/views/apk_downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
handle_uploaded_file,
)
from mobsf.MobSF.utils import (
is_internet_available,
is_path_traversal,
is_zip_magic,
strict_package_check,
Expand Down Expand Up @@ -133,6 +134,9 @@ def apk_download(package):
downloaded_file = None
data = None
try:
if not is_internet_available():
logger.warning('Internet Not Available. Unable to download APK')
return None
if not strict_package_check(package) or is_path_traversal(package):
return None
logger.info('Attempting to download: %s', package)
Expand Down

0 comments on commit f6193dc

Please sign in to comment.