Commit Graph
2034 Commits
Author SHA1 Message Date
EljeesandAjin Abraham 3eadf6cc0a fix(rules): match the literal mode argument in getSharedPreferences (#2638)
The world readable/writable patterns matched any argument list ending with 1 or 2, so decompiled identifiers such as var1, var2 or mode2 were reported as world permissions.

Signed-off-by: Eljees <[email protected]>
Co-authored-by: Ajin Abraham <[email protected]>
2026-08-09 16:57:21 -07:00
Zen1th53andAjin Abraham 4d85257b01 Fix formatting in SKIP_CLASS_PATH list (#2634)
this is very very important fix ;)

Co-authored-by: Ajin Abraham <[email protected]>
2026-08-09 16:54:07 -07:00
b76513a12f fix csrf error (#2633)
SAML identity providers (e.g., Keycloak) do not include the Origin header in their SAML requests. This causes Django's CSRF middleware to reject the request with a "null origin" error.
To resolve this, we disable CSRF validation for the SAML login endpoint, as the SAML protocol itself provides its own security mechanisms (signature and assertion validation), making the CSRF check redundant in this specific flow.
---------
Co-authored-by: Khabarov Konstantin Olegovich <[email protected]>
Co-authored-by: Ajin Abraham <[email protected]>
Co-authored-by: Cursor <[email protected]>
2026-08-09 16:51:25 -07:00
8c7b9d80fc Update: certificate analysis (apksigner) (#2630)
Cert Analysis:
- updated apksigner.jar: was from build-tools 32.0.0, now from build-tools 37.0.0
- modified cert_analysis.py to be more apksigner-version-agnostic via get_signature_versions (backward compatible)
- cleaned up apksigtool_cert / get_cert_data for more generic shape handling

Apktool:
- updated apktool (now 3.0.3) and converter.py CLI args for apktool 3.x (order / deprecated flags)

Maintainer follow-ups:
- apktool bumped further to 3.0.3 (SHA256 verified against Bitbucket)
- apksigner checked against developer.android.com / build-tools — latest stable still 37.0.0; jar SHA256 matches Google zip
- Failsafe rework: always keep v1–v4 keys; merge apksigner results instead of replacing the dict; soft-fail (no re-raise) so apksigtool/androguard fallbacks still run
- Graceful degradation for malformed attacker-controlled certs/files:
  - safe wrappers around cert/pubkey parsing so one bad entry does not wipe all findings
  - apksigner subprocess timeout (BINARY_ANALYSIS_TIMEOUT)
  - tolerant minSdkVersion parsing
  - MANIFEST.MF read with errors='ignore'
  - cert_info failure return keeps a shaped dict (certificate_info / certificate_findings / certificate_summary)

Co-authored-by: Cursor <[email protected]>
---------
Co-authored-by: Ajin Abraham <[email protected]>
Co-authored-by: Cursor <[email protected]>
2026-08-09 16:41:07 -07:00
Ajin Abraham 62563ca429 [HOTFIX][Security] Security Updates July 5 2026 (#2627)
Security Fixes

[GHSA-8j49-mmcx-4mp5] Arbitrary File Read via Path Traversal in ZIP/APK Icon Extraction
The android:icon attribute from an APK manifest was interpolated into file paths without validation, allowing a crafted APK to read arbitrary files from the server. Fixed by adding is_path_traversal() and is_safe_path() guards in find_icon_path_zip. Dependency bump included.

[GHSA-3p54-567p-2wpr] CSRF Checks Not Enforced After Django Middleware Migration
The migration from the deprecated MIDDLEWARE_CLASSES to MIDDLEWARE omitted CsrfViewMiddleware, SecurityMiddleware, and XFrameOptionsMiddleware, leaving CSRF, HSTS, and clickjacking protections silently disabled. All three have been restored to the active MIDDLEWARE tuple. The now-dead MIDDLEWARE_CLASSES block has been removed to prevent future confusion.

[GHSA-x768-8642-mmq9] Zip Bomb Denial of Service via Per-File Size Limit Bypass
The per-file size check in ZIP extraction logged a warning on oversized members but was missing a continue, allowing files exceeding ZIP_MAX_UNCOMPRESSED_FILE_SIZE to be extracted anyway as long as the aggregate limit was not reached. Fixed by adding the missing continue.

[GHSA-95px-34x5-p37h] SSRF Port Restriction Bypass in assetlinks_check
valid_host() was called with only the bare hostname, allowing android:port to be appended afterward without going through port validation, bypassing the HTTP/HTTPS-only restriction. Fixed with a two-layer approach: primary port allowlist check before URL assembly in get_browsable_activities, and a defence-in-depth re-check in _check_url.

Hardening

The hand-rolled safe_extract used os.path.abspath (symlink-blind) instead of os.path.realpath, creating a TOCTOU window where a symlink could redirect extraction outside the destination directory. Replaced with Python 3.12's tarfile.extractall(filter='data') (PEP 706), which rejects symlinks, hardlinks, absolute paths, and traversal members per-member before extraction. A robust realpath-based fallback is included for older Python versions.
Both download_app_data call sites in the iOS dynamic analyser now wrap app_container and tarfile with shlex.quote when building the SSH tar command, as defensive coding hygiene.
Refactoring

is_path_traversal, is_safe_path, clean_filename, cmd_injection_check, is_pipe_or_link, and is_attack_pattern were scattered across utils.py and shared.py. All have been moved to mobsf/MobSF/security.py as the single authoritative location for security primitives.
Developer Tooling

AGENTS.md / CLAUDE.md - AI agent guidelines
Added a coding-standards document for AI coding agents (Cursor, Claude, Codex) covering MobSF-specific secure-by-default patterns: path traversal guards, archive extraction safety, Django middleware active-tuple hygiene, split-validation anti-patterns (SSRF port bypass), guard completeness (continue/return/raise after every security check), and Django-specific security features (form validators, decorators, middleware). CLAUDE.md is a symlink to AGENTS.md.
v4.5.1
2026-07-05 16:55:49 -07:00
potato-20andAjin Abraham c098134845 Add Android WebView mixed-content detection rule (#2618)
Adds android_webview_mixed_content to the Android static-analysis ruleset.
It flags WebViews configured with MIXED_CONTENT_ALWAYS_ALLOW, which lets a
page loaded over HTTPS pull resources from insecure HTTP origins, exposing
the app to man-in-the-middle content injection (CWE-319 / OWASP-Mobile M3 /
MASVS-NETWORK-1).

The pattern matches only the insecure MIXED_CONTENT_ALWAYS_ALLOW mode and
not the safe MIXED_CONTENT_NEVER_ALLOW or MIXED_CONTENT_COMPATIBILITY_MODE
values. Verified with libsast: fires on the insecure mode and produces no
false positives on the safe modes.

Co-authored-by: Ajin Abraham <[email protected]>
2026-07-05 16:55:22 -07:00
Yushawn d045022d7d [HOTFIX] Fix false positive in debug symbol stripping check using objdump (#2616)
* Fix [BUG] Debug symbols stripped false positive #2502
2026-07-05 16:49:10 -07:00
6e875fb77b Jailbroken iOS Device Support (#2536)
Enables dynamic analysis on real jailbroken iOS devices connected via USB or WiFi SSH, complementing the existing Corellium-based iOS analysis.              
                                                                                                                                                                                                                                                                                                                                                                                                                                                                
  - SSH connectivity — connects to jailbroken devices over USB (via iproxy port forwarding) or WiFi using Paramiko SSH                                         
  - Frida instrumentation — spawns/attaches Frida on-device, with full hook support matching the existing Corellium flow                                       
  - Environment setup — installs AppSync Unified and Frida server on first run; supports both arm and arm64 devices                                            
  - Dynamic analysis — app file extraction, system log streaming (oslog), screenshot capture, process listing, and report generation
  - SSH terminal — execute shell commands on the device over SSH

---------

Co-authored-by: CylentSec <[email protected]>
Co-authored-by: Oz <[email protected]>
2026-03-23 01:46:03 -07:00
Ajin Abraham 6f8a43c1b7 [SECURITY][HOTFIX] Security Fixes and Hardening (#2600)
* Fix GHSA-hqjr-43r5-9q58

* Update security docs

* Security hardening

* Bump deps
v4.4.6
2026-03-21 14:50:01 -07:00
df069296d4 Disable setting RequestedAuthnContext during saml request (#2580)
Co-authored-by: Thomas Kreuzer <[email protected]>
Co-authored-by: Ajin Abraham <[email protected]>
2026-03-21 12:17:47 -07:00
Ajin Abraham 2b08dd050e [SECURITY] Security Update + Dependency Bump (#2584)
* Bump Dependencies
* Fix a Stored XSS: GHSA-8hf7-h89p-3pqj
* Remove all  | safe in templates and HTML from Python
* Add permissions to Github Actions
v4.4.5
2026-01-25 22:33:34 -08:00
457d1e61f3 Improve error handling and logging in MalwareDomainCheck (#2555)
* Improve error handling and logging in MalwareDomainCheck


---------

Co-authored-by: Saurabh <[email protected]>
Co-authored-by: Ajin Abraham <[email protected]>
2025-12-14 21:32:03 -08:00
Ajin Abraham 4b004f3817 HOTFIX: Fix AppSec Score Card for iOS 2025-12-08 19:17:25 -08:00
Ajin Abraham 2c712e2ebc [HOTFIX] Dec 2025 QA + Bug Fixes (#2574)
* Dependency bump
* Fix [FEATURE] urls should be extracted as case-sensitive #2491
* Fix Code analysis -> IP Address disclosure flags on invalid IP's (Version Numbers) #2562
2025-12-07 21:34:08 -08:00
Sai Prathik RandSai Prathik R e3e539cd59 feat: Update URL extraction to preserve case sensitivity (#2550)
Bug 2491, which stated that the URLs were being converted to lowercase, which potentially caused issues for URLs with uppercase characters.

Co-authored-by: Sai Prathik R <[email protected]>
2025-12-07 20:37:58 -08:00
Ajin Abraham 9b6e0f0fe4 Socket Supply Chain Scan (#2559)
Socket Supply Chain Firewall
2025-10-04 15:04:04 -07:00
dependabot[bot] 3539414fe9 Bump django from 5.2.6 to 5.2.7 (#2558)
Bumps [django](https://github.com/django/django) from 5.2.6 to 5.2.7.
- [Commits](https://github.com/django/django/compare/5.2.6...5.2.7)

---
updated-dependencies:
- dependency-name: django
  dependency-version: 5.2.7
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-01 21:59:14 -07:00
Ajin Abraham e371db8388 [HOTFIX] Update Slack Join Link (#2556)
* Update README.md

* Update SUPPORT.md

* Update bug_report.md

* Update CONTRIBUTING.md

* Update auto-comment.yml
2025-09-30 10:54:10 -07:00
Ajin Abraham 5d1096d458 Hotfix: Fix LIEF nx and arc check 2025-09-07 12:33:53 -07:00
Ajin Abraham de7bf03656 Python 3.13 Support (#2546)
* Python Support updated to 3.12-3.13
* Bump mitmproxy
* Bump httptools
* Remove pinned xmlsec, lxml
* Android Permission Update
* Updates Signatures
v4.4.2
2025-08-30 23:46:20 -07:00
Ajin Abraham 7f3bc086c0 [Security] Fix Vulnerabilities Aug 2025 MobSF v4.4.1 (#2545)
Bump dependencies
Fix Security Vulnerabilities reported by @noname1337h1
https://github.com/MobSF/Mobile-Security-Framework-MobSF/security/advisories/GHSA-9gh8-9r95-3fc3
https://github.com/MobSF/Mobile-Security-Framework-MobSF/security/advisories/GHSA-ccc3-fvfx-mw3v
v4.4.1
2025-08-30 19:28:41 -07:00
49537563cc fix(ios_analyzer): Correctly resolve executable path in .app bundles (#2533)
* fix(ios_analyzer): Correctly resolve executable path in .app bundles

The previous method for locating the executable within an IPA file was failing for apps with spaces in their `.app` bundle name. The logic incorrectly performed a string replacement on the full path of the bundle, resulting in an invalid path to the binary.

This commit refactors the path resolution logic to use `pathlib` features correctly. It now finds the `.app` directory as a `Path` object and uses the `.stem` attribute to reliably determine the executable's name. This approach is more robust, properly handles spaces and special characters in filenames, and avoids fragile string manipulation.

* Add doc string back

* Update mobsf/StaticAnalyzer/views/ios/binary_analysis.py

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Ajin Abraham <[email protected]>
Co-authored-by: Copilot <[email protected]>
2025-07-11 23:36:21 -07:00
Ajin Abraham 7e0355c51d June 22nd 2025 updates (#2530)
* Breaking change: Frida 17+ support and script updates
* Breaking change: Corellium iOS device must install frida >=17
* Updated Frida scripts for logging, ssl/cert pinning bypass
* Added bridges support to frida
* Poetry dependency updates
* Fix Frida Code Editor code alignment issues
* Fix Google Play Scrapper timeout issues behind proxy
* Apply MobSF proxy settings to standalone tools_download.py
2025-06-23 00:57:33 -07:00
Ajin Abraham 6987a94648 v4.3.3 Security Updates (#2518)
* Fix GHSA-mwfg-948f-2cc5

* stricter email case validation

* Fix GHSA-c5vg-26p8-q8cr

* Bump deps

* Lint QA
2025-05-04 16:33:07 -07:00
Ajin Abraham cecec6e96d update postgres to 14 2025-04-25 14:05:53 -07:00
Ajin Abraham 702e9b2100 Lint fixing: 2025-04-25 11:23:09 -07:00
Ajin Abraham caa223d94a pin lxml version as well 2025-04-25 11:16:33 -07:00
loraksteandAjin Abraham df9c53dcd0 Correct CVSS calculation by accessing findings key properly (#2511)
Fixed an issue where the average CVSS score calculation was incorrect due to improper access to the findings key within the JSON structure. The calculation logic was bypassing the findings key and therefore failing to extract valid CVSS scores.

Co-authored-by: Ajin Abraham <[email protected]>
2025-04-24 12:04:49 -07:00
jpierson-at-riis 92ac55ee68 Fix misspelling of the word unpatched (#2515) 2025-04-24 09:39:14 -07:00
Ajin Abraham 4b8bab5a98 [SECURITY] Improve SSRF checks, strict path check for well_known_path (#2510)
* Improved SSRF checks (credential checks, length check, port check, path, query, and params check, ipv6, ipv4 coverage, handle possible decimal or hex IP bypasses)
* Add additional strict path check for Applink well known path
* Moved `valid_host` to `security.py`
* Update `security.md`
* Bump dependencies
* Fix docker build
v4.3.2
2025-03-28 17:38:23 -07:00
Ajin Abraham 506434670a March 25 QA (#2504)
* Dependency bump
* Strict firebaseio domain check
* Fix frida server download proxy SSL verify config
* Fix CI build on mac
2025-03-23 12:27:01 -07:00
ae34f7c055 Saml group mapping (#2487)
* add SSO groups mapping

* typo corrected

---------

Co-authored-by: Khabarov Konstantin Olegovich <[email protected]>
Co-authored-by: Ajin Abraham <[email protected]>
2025-02-05 11:39:20 -08:00
Ajin Abraham 05206e72ca [SECURITY] Security update to fix vulnerabilities reported by Positive Technologies researchers (#2488)
* Fix Stored XSS in iOS Dynamic Analysis, GHSA-cxqq-w3x5-7ph3
* Fix DOS by loose re_path check and strict check inside function, GHSA-jrm8-xgf3-fwqr
* Fix API Key leakage, replace REST API with authenticated endpoint, GHSA-79f6-p65j-3m2m
* Update SECURITY.md
2025-02-04 21:00:57 -08:00
Ajin AbrahamandNick Lupien d1d3b7a9ae Dep bump + Support HTTPS upgrade for Assetlinks check (#2484)
* Fix false positives caused in Android manifest analysis
* Dep bumps + Support HTTPS upgrade for Assetlinks check
* MobSF version bump to 4.3.0

---------

Co-authored-by: Nick Lupien <[email protected]>
v4.3.0
2025-01-22 23:15:32 -08:00
Ajin AbrahamandByteSnipers GmbH 79b2d28c3b Byte snipers patch 2 (#2477)
* Fix for missing 'packaging.metadata module

Changed the packaging version to 24.2

Co-authored-by: ByteSnipers GmbH <[email protected]>
2024-12-18 18:35:11 -08:00
180de6b611 Add files list in scorecard desc (#2473)
* Add files list in scorecard desc
* fix lint

---------

Co-authored-by: Dmitry Maryushkin <[email protected]>
Co-authored-by: Ajin Abraham <[email protected]>
2024-12-17 17:56:54 -08:00
17332e88c0 Save only unique intent priorities in findings (#2474)
* Save only unique intent priorities in findings

* Save only unique intent priorities in findings

* Save only unique intent priorities in findings

* Save only unique intent priorities in findings

---------

Co-authored-by: Dmitry Maryushkin <[email protected]>
Co-authored-by: Ajin Abraham <[email protected]>
2024-12-17 17:56:25 -08:00
Ajin Abraham fbf567446b dependencies bump + show resources 2024-12-17 17:03:03 -08:00
Ajin Abraham 3223736d93 HOTFIX: Show Abused Permissions, Fix Download AAB, Dependency bump 2024-12-11 18:08:06 -08:00
Ajin Abraham 8310104ba9 Update README.md 2024-12-02 22:38:47 -08:00
Ajin Abraham 8ea095ac80 Fixes a stored XSS in Recent Scans diff APK, GHSA-5jc6-h9w7-jm3p 2024-12-02 22:33:42 -08:00
Ajin Abraham 27d1658728 Fixes a stored XSS in Recent Scans diff APK, GHSA-5jc6-h9w7-jm3p 2024-12-02 22:33:01 -08:00
Ajin Abraham 0d3b1ec3b9 Fix x86_64 Android AVD in Windows (#2471) 2024-12-02 21:43:53 -08:00
Ajin Abraham b75d209063 Fix frida on_message for docker compose 2024-12-01 16:46:27 -08:00
Ajin Abraham c886ea5ed9 DjangoQ2 Scan Queue QA + Updated defaults 2024-11-30 23:27:19 -08:00
Ajin Abraham a5c30c077b Helper script for migration 2024-11-28 18:04:26 -08:00
Ajin Abraham 5ce7e237af [4.2.8] Multiple APK Analysis improvements, general Code QA & bug fixes (#2470)
* Dockerfile QA
* Add sdk-build-tools to Docker image
* Replace biplist with plistlib std lib
* Fixed a bug in iOS pbxproj parsing
* Added support for APK parsing with aapt2/aapt
* Use aapt/aapt2 as a fallback for APK parsing, files listing and string extraction
* Added "started at" to Scan task queue model #2463
* Tasks List API to return string status #2464
* Replaced all minidom calls with defusedxml.minidom
* Code QA on android manifest data extraction and parsing
* Improved android file analysis
* Improved android manifest data extraction
* Improved android icon file extraction
* Improved android app name extraction
* Improved android appstore package details extraction
* Android string extraction to fallback on aapt2 strings
* APK analysis arguments refactor
* Handle packed APKs, refactor unzip to handle malformed APK files
* Handle reserved filename conflict during ZIP extraction
* Explicit Zipslip handling during ZIP extraction
* Graceful files extraction on unzip failure
* Removed bail out and continue analysis
* Moved androguard parsing to the start of static analysis
* AndroidManifest.xml fallback from apktool to androguard during extraction and parsing
* Updated Tasks UI to show started at
2024-11-28 17:26:50 -08:00
Ajin Abraham a015df5871 [4.2.7] Updates (#2462)
Bump to google fork of baksmali 3.0.8
IPA: Graceful handling of plist dump exception
2024-11-25 00:04:40 -08:00
Ajin Abraham af49985dd1 [4.2.7] Androguard & ApkInspector Bump + Patch AXMLParsing (#2461)
* Androguard 293ab2d89ab9ce011c7dbbc5df3c876172875a1c update
* AXML Parser warn "reserved must be zero!" instead of raise
* Fallback on get app name when androguard returns empty string
2024-11-24 22:53:21 -08:00
Ajin Abraham 23cbd41614 CodeQL config update 2024-11-24 14:24:41 -08:00