Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOTFIX][SECURITY] Fix an LFI, DSA Pub Key parsing bug and dependencies #2326

Merged
merged 4 commits into from
Jan 14, 2024
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion .github/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ Please report all security issues [here](https://github.com/MobSF/Mobile-Securit

| Vulnerability | Affected Versions |
| ------- | ------------------ |
| [Arbitrary Local file read in APK icon resource](https://github.com/MobSF/Mobile-Security-Framework-MobSF/commit/a58f8a8c0aa49e1581d97e19e8e2255ca96cd838) | `>=1.0.4, <=3.9.2` |
| [Remote Code Execution via arbitrary file overwrite vulnerability in apktool <2.9.2](https://github.com/MobSF/Mobile-Security-Framework-MobSF/commit/19c1b55c2c59596f2d43439926c9dc976cbeaec4), [[CVE-2024-21633]](https://github.com/0x33c0unt/CVE-2024-21633) | `<=3.9.1` |
| [Arbitrary Local file read regression](https://github.com/MobSF/Mobile-Security-Framework-MobSF/issues/1197) | `<3.0.0` |
| [Upload a malicious zip file can overwrite arbitary files](https://github.com/MobSF/Mobile-Security-Framework-MobSF/issues/358) | `>=0.9.3.2` && `<=0.9.4.1` |
| [Upload a malicious zip file can overwrite arbitary files](https://github.com/MobSF/Mobile-Security-Framework-MobSF/issues/358) | `>=0.9.3.2, <=0.9.4.1` |
| [Arbitrary Local file read](https://github.com/MobSF/Mobile-Security-Framework-MobSF/pull/166) | `<=0.9.2` |
2 changes: 1 addition & 1 deletion mobsf/MobSF/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

logger = logging.getLogger(__name__)

VERSION = '3.9.2'
VERSION = '3.9.3'
BANNER = """
__ __ _ ____ _____ _____ ___
| \/ | ___ | |__/ ___|| ___|_ _|___ // _ \
Expand Down
6 changes: 3 additions & 3 deletions mobsf/StaticAnalyzer/views/android/cert_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ def get_pub_key_details(data):
elif isinstance(x509_public_key, dsa.DSAPublicKey):
alg = 'dsa'
dsa_parameters = x509_public_key.parameters()
p = dsa_parameters.p
q = dsa_parameters.q
g = dsa_parameters.g
p = dsa_parameters.parameter_numbers().p
q = dsa_parameters.parameter_numbers().q
g = dsa_parameters.parameter_numbers().g
y = x509_public_key.public_numbers().y
to_hash = f'{p}:{q}:{g}:{y}'
elif isinstance(x509_public_key, ec.EllipticCurvePublicKey):
Expand Down
6 changes: 6 additions & 0 deletions mobsf/StaticAnalyzer/views/android/icon_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from mobsf.MobSF.utils import (
find_java_binary,
is_file_exists,
is_path_traversal,
)


Expand Down Expand Up @@ -156,6 +157,8 @@ def get_icon_src(a, app_dic, res_dir):
icon_name = None
if a:
icon_name = a.get_app_icon(max_dpi=icon_resolution)
if is_path_traversal(icon_name):
icon_name = None
if not icon_name:
# androguard cannot find icon file.
icon_name = ''
Expand Down Expand Up @@ -196,6 +199,9 @@ def get_icon_src(a, app_dic, res_dir):
if icon_src.endswith('.xml'):
logger.warning('Cannot find icon file from xml')
icon_src = ''
elif not icon_src.endswith(('.png', '.svg', '.webp')):
logger.warning('Cannot find a valid icon file')
icon_src = ''
if not icon_name:
logger.warning('Cannot find icon file')
icon_src = ''
Expand Down
2 changes: 1 addition & 1 deletion mobsf/StaticAnalyzer/views/android/manifest_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def _check_url(host, w_url):
'status': status}

except Exception:
logger.exception(f'Well Known Assetlinks Check for URL: {w_url}')
logger.error(f'Well Known Assetlinks Check for URL: {w_url}')
return {'url': w_url,
'host': host,
'status_code': None,
Expand Down
136 changes: 68 additions & 68 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "mobsf"
version = "3.9.2"
version = "3.9.3"
description = "Mobile Security Framework (MobSF) is an automated, all-in-one mobile application (Android/iOS/Windows) pen-testing, malware analysis and security assessment framework capable of performing static and dynamic analysis."
keywords = ["mobsf", "mobile security framework", "mobile security", "security tool", "static analysis", "dynamic analysis", "malware analysis"]
authors = ["Ajin Abraham <ajin@opensecurity.in>"]
Expand Down