Files
Mobile-Security-Framework-M…/.github/SECURITY.md
T
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.
2026-07-05 16:55:49 -07:00

4.6 KiB

Security Policy

Keeping MobSF updated to the latest version is essential for ensuring security and stability.

Reporting a Vulnerability

Please report all security issues here. We believe in coordinated and responsible disclosure.

Past Security Issues

Vulnerability Affected Versions
SSRF port restriction bypass in assetlinks_check <=4.5.0
Zip Bomb Denial of Service via Per-File Size Limit Bypass in ZIP/APK <=4.5.0
Regression: CSRF checks not enforced after Django migration <=4.5.0
Arbitrary File Read via Path Traversal in ZIP Uploads <=4.5.0
SQL Injection in SQLite Database Viewer utils <=4.4.5
Stored XSS via Manifest Analysis - Dialer Code Host Field <=4.4.4
Arbitrary File Write (AR-Slip) via Absolute Path in .a Extraction <=4.4.0
Path Traversal in GET /download/<filename> using absolute filenames in MobSF data directory) <=4.4.0
Zip bomb Denial of Service (DoS) via Resource Exhaustion (Disk Space) <=4.3.2
Stored Cross Site Scripting (XSS) via malicious SVG app icon <=4.3.2
SSRF on assetlinks_check with DNS Rebinding <=4.3.1
Partial Denial of Service due to strict regex check in iOS report view URL <=4.3.0
Local Privilege escalation due to leaked REST API key in web UI <=4.3.0
Stored Cross-Site Scripting in iOS dynamic_analysis view via bundle id <=4.3.0
Stored Cross-Site Scripting Vulnerability in Recent Scans "Diff or Compare" <=4.2.8
Zip Slip Vulnerability in .a extraction <=4.0.6
Open Redirect in Login redirect <=4.0.4
SSRF in firebase database check <=3.9.7
SSRF in AppLink check via abusing url redirect <=3.9.6
SSRF in AppLink check via crafted android:host <=3.9.5
Arbitrary Local file read in APK icon resource >=1.0.4, <=3.9.2
Remote Code Execution via arbitrary file overwrite vulnerability in apktool <2.9.2, [CVE-2024-21633] <=3.9.1
Arbitrary Local file read regression <3.0.0
Upload a malicious zip file can overwrite arbitary files >=0.9.3.2, <=0.9.4.1
Arbitrary Local file read <=0.9.2