Skip to content

Commit 63808e4

Browse files
authored
Merge pull request #1 from MobSF/master
Update mobSF
2 parents 3223736 + 5064346 commit 63808e4

File tree

20 files changed

+618
-525
lines changed

20 files changed

+618
-525
lines changed

.github/SECURITY.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ Please report all security issues [here](https://github.com/MobSF/Mobile-Securit
1010

1111
| Vulnerability | Affected Versions |
1212
| ------- | ------------------ |
13+
| [Partial Denial of Service due to strict regex check in iOS report view URL](https://github.com/MobSF/Mobile-Security-Framework-MobSF/security/advisories/GHSA-jrm8-xgf3-fwqr) | `<=4.3.0` |
14+
| [Local Privilege escalation due to leaked REST API key in web UI](https://github.com/MobSF/Mobile-Security-Framework-MobSF/security/advisories/GHSA-79f6-p65j-3m2m) | `<=4.3.0` |
15+
| [Stored Cross-Site Scripting in iOS dynamic_analysis view via `bundle` id](https://github.com/MobSF/Mobile-Security-Framework-MobSF/security/advisories/GHSA-cxqq-w3x5-7ph3) | `<=4.3.0` |
1316
| [Stored Cross-Site Scripting Vulnerability in Recent Scans "Diff or Compare"](https://github.com/MobSF/Mobile-Security-Framework-MobSF/security/advisories/GHSA-5jc6-h9w7-jm3p) | `<=4.2.8` |
1417
| [Zip Slip Vulnerability in .a extraction](https://github.com/MobSF/Mobile-Security-Framework-MobSF/security/advisories/GHSA-4hh3-vj32-gr6j) | `<=4.0.6` |
1518
| [Open Redirect in Login redirect](https://github.com/MobSF/Mobile-Security-Framework-MobSF/security/advisories/GHSA-8m9j-2f32-2vx4) | `<=4.0.4` |

.github/workflows/mobsf-test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ jobs:
4747
- name: Install macOS Dependencies
4848
if: startsWith(matrix.os, 'macOS')
4949
run: |
50-
brew install --cask wkhtmltopdf
50+
export WKHTML_URL=https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-2/
51+
export WKHTML_PKG=wkhtmltox-0.12.6-2.macos-cocoa.pkg
52+
curl -L ${WKHTML_URL}${WKHTML_PKG} -O && sudo installer -pkg ${WKHTML_PKG} -target ~ && rm -rf ${WKHTML_PKG}
5153
5254
- name: Install Windows Dependencies
5355
if: startsWith(matrix.os, 'windows')

mobsf/DynamicAnalyzer/views/android/frida_server_download.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def clean_up_old_binaries(dirc, version):
3030
pass
3131

3232

33-
def download_frida_server(url, version, fname, proxies):
33+
def download_frida_server(url, version, fname, proxies, verify):
3434
"""Download frida-server-binary."""
3535
try:
3636
download_dir = Path(settings.DWD_DIR)
@@ -40,6 +40,7 @@ def download_frida_server(url, version, fname, proxies):
4040
url,
4141
timeout=5,
4242
proxies=proxies,
43+
verify=verify,
4344
stream=True) as r:
4445
with LZMAFile(r.raw) as f:
4546
with open(dwd_loc, 'wb') as flip:
@@ -72,7 +73,7 @@ def update_frida_server(arch, version):
7273
for item in response.json()['assets']:
7374
if item['name'] == f'{fserver}.xz':
7475
url = item['browser_download_url']
75-
return download_frida_server(url, version, fserver, proxies)
76+
return download_frida_server(url, version, fserver, proxies, verify)
7677
return False
7778
except Exception:
7879
logger.exception('[ERROR] Fetching Frida Server Release')

mobsf/DynamicAnalyzer/views/ios/corellium_instance.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,8 @@ def download_data(request, bundle_id, api=False):
763763
if failed:
764764
return send_response(failed, api)
765765
if not strict_package_check(bundle_id):
766+
# Check bundle_id during call, as the check
767+
# is not done in REST API/URL repath.
766768
data['message'] = 'Invalid iOS Bundle id'
767769
return send_response(data, api)
768770
ci = CorelliumInstanceAPI(instance_id)

mobsf/DynamicAnalyzer/views/ios/report.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ def ios_view_report(request, bundle_id, api=False):
4949
else:
5050
dev = ''
5151
if not strict_package_check(bundle_id):
52-
# We need this check since bundleid
53-
# is not validated in REST API
52+
# bundle_id is not validated in REST API.
53+
# Also bundleid is not strictly validated
54+
# in URL path.
5455
return print_n_send_error_response(
5556
request,
5657
'Invalid iOS Bundle id',

mobsf/MobSF/init.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818

1919
logger = logging.getLogger(__name__)
2020

21-
VERSION = '4.2.9'
21+
VERSION = '4.3.1'
2222
BANNER = r"""
23-
__ __ _ ____ _____ _ _ ____
24-
| \/ | ___ | |__/ ___|| ___|_ _| || | |___ \
25-
| |\/| |/ _ \| '_ \___ \| |_ \ \ / / || |_ __) |
26-
| | | | (_) | |_) |__) | _| \ V /|__ _| / __/
27-
|_| |_|\___/|_.__/____/|_| \_/ |_|(_)_____|
23+
__ __ _ ____ _____ _ _ _____
24+
| \/ | ___ | |__/ ___|| ___|_ _| || | |___ /
25+
| |\/| |/ _ \| '_ \___ \| |_ \ \ / / || |_ |_ \
26+
| | | | (_) | |_) |__) | _| \ V /|__ _| ___) |
27+
|_| |_|\___/|_.__/____/|_| \_/ |_|(_)____/
2828
""" # noqa: W291
2929
# ASCII Font: Standard
3030

mobsf/MobSF/settings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,8 @@
379379
IDP_SSO_URL = os.getenv('MOBSF_IDP_SSO_URL')
380380
IDP_X509CERT = os.getenv('MOBSF_IDP_X509CERT')
381381
IDP_IS_ADFS = os.getenv('MOBSF_IDP_IS_ADFS', '0')
382+
IDP_MAINTAINER_GROUP = os.getenv('MOBSF_IDP_MAINTAINER_GROUP', 'Maintainer')
383+
IDP_VIEWER_GROUP = os.getenv('MOBSF_IDP_VIEWER_GROUP', 'Viewer')
382384
# SP Configuration
383385
SP_HOST = os.getenv('MOBSF_SP_HOST')
384386
SP_ALLOW_PASSWORD = os.getenv('MOBSF_SP_ALLOW_PASSWORD', '0')

mobsf/MobSF/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252

5353
from . import settings
5454

55-
bundle_id_regex = r'(?P<bundle_id>([a-zA-Z0-9]{1}[\w.-]{1,255}))$'
55+
bundle_id_regex = r'(?P<bundle_id>.+)$'
5656
checksum_regex = r'(?P<checksum>[0-9a-f]{32})'
5757
paginate = r'(?P<page_size>[0-9]{1,10})/(?P<page_number>[0-9]{1,10})'
5858

mobsf/MobSF/utils.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,17 @@ def upstream_proxy(flaw_type):
9898
return proxies, verify
9999

100100

101+
def get_system_resources():
102+
"""Get CPU and Memory Available."""
103+
# Get number of physical cores
104+
physical_cores = psutil.cpu_count(logical=False)
105+
# Get number of logical processors (threads)
106+
logical_processors = psutil.cpu_count(logical=True)
107+
# Get total RAM
108+
total_ram = psutil.virtual_memory().total / (1024 ** 3) # Convert bytes to GB
109+
return physical_cores, logical_processors, total_ram
110+
111+
101112
def print_version():
102113
"""Print MobSF Version."""
103114
logger.info(settings.BANNER)
@@ -122,6 +133,8 @@ def print_version():
122133
dst_str = f' ({dist}) '
123134
env_str = f'OS Environment: {os}{dst_str}{pltfm}'
124135
logger.info(env_str)
136+
cores, threads, ram = get_system_resources()
137+
logger.info('CPU Cores: %s, Threads: %s, RAM: %.2f GB', cores, threads, ram)
125138
find_java_binary()
126139
check_basic_env()
127140
thread = threading.Thread(target=check_update, name='check_update')

mobsf/MobSF/views/authorization.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ class Permissions(Enum):
4949
DELETE = f'StaticAnalyzer.{PERM_CAN_DELETE}'
5050

5151

52-
MAINTAINER_GROUP = 'Maintainer'
53-
VIEWER_GROUP = 'Viewer'
52+
MAINTAINER_GROUP = settings.IDP_MAINTAINER_GROUP
53+
VIEWER_GROUP = settings.IDP_VIEWER_GROUP
5454

5555

5656
def permission_required(perm):

0 commit comments

Comments
 (0)