Niedrig

MobSF has SSRF port restriction bypass in assetlinks_check

  • Veröffentlicht: 18.08.2026
  • Aktualisiert: 11.10.2026 14:19

Summary

MobSF's Android App Link assetlinks checker validates only the manifest android:host value with valid_host(), but then appends the separate android:port value into the URL used for the server-side request. This bypasses the current port restriction in valid_host() and lets a crafted APK cause MobSF to fetch http://host:<attacker-port>/.well-known/assetlinks.json or https://host:<attacker-port>/.well-known/assetlinks.json.

Impact

An authenticated user who can upload or trigger analysis of a crafted APK can cause the MobSF server to make an outbound request to an attacker-selected port during Android manifest analysis. When the host is controlled by the attacker and uses DNS rebinding, the validation lookup can resolve to a public IP while the later HTTP client lookup resolves to an internal address, allowing SSRF to internal services on non-80/443 ports.

This is not arbitrary URL SSRF. The path remains fixed to /.well-known/assetlinks.json, and redirects are disabled. The bypass is that the final fetched URL is assembled after the host-only validation, so the current port guard is not applied to the actual URL.

Root cause

valid_host() rejects ports other than 80 and 443 when a port is included in the string being validated:

python
port = parsed.port
...
if port and port not in (80, 443):
    return False

In get_browsable_activities(), only the host attribute is passed to valid_host():

python
host = data.getAttribute(f'{ns}:host')
port = data.getAttribute(f'{ns}:port')
...
if not valid_host(host):
    logger.warning('Invalid Host: %s', host)
    continue
shost = f'{scheme}://{host}'
if port and is_number(port):
    c_url = f'{shost}:{port}{WELL_KNOWN_PATH}'
else:
    c_url = f'{shost}{WELL_KNOWN_PATH}'
well_known[c_url] = shost

_check_url() then fetches the assembled URL after checking only path, query, and params:

python
purl = urlparse(url)
if (purl.path != WELL_KNOWN_PATH
    or len(purl.query) > 0
        or len(purl.params) > 0):
    logger.warning('Invalid Assetlinks URL: %s', url)
    continue
r = requests.get(url,
                 timeout=5,
                 allow_redirects=False,
                 proxies=proxies,
                 verify=verify)

Reproduction

Use an Android manifest with a browsable App Link data tag that has a benign-looking host and a restricted port:

xml
<activity android:name=".DeepLink" android:exported="true">
  <intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.BROWSABLE" />
    <category android:name="android.intent.category.DEFAULT" />
    <data android:scheme="http" android:host="rebind.example" android:port="22" />
  </intent-filter>
</activity>

A safe local proof with DNS and HTTP monkeypatching shows that MobSF validates only rebind.example, then fetches a URL that preserves the unchecked port:

well_known map: {'http://rebind.example:22/.well-known/assetlinks.json': 'http://rebind.example'}
requests.get calls: [('http://rebind.example:22/.well-known/assetlinks.json', {'timeout': 5, 'allow_redirects': False, 'proxies': None, 'verify': True})]
findings: [{'url': 'http://rebind.example:22/.well-known/assetlinks.json', 'host': 'http://rebind.example', 'status_code': 200, 'status': True}]
VULNERABLE: valid_host validated only rebind.example, but assetlinks_check fetched unchecked port 22 via http://rebind.example:22/.well-known/assetlinks.json

The same code pattern is present in latest release v4.4.6 and current main.

Remediation

Validate the final URL after all manifest components have been applied. In particular:

  1. Build c_url, then run validation on the full URL, including scheme, hostname, port, path, query, and params.
  2. Reject android:port values other than 80 and 443 before appending them to the URL.
  3. Prevent DNS rebinding by pinning the validated DNS result to the outbound connection or otherwise ensuring the actual HTTP request cannot resolve to a different address than the validation step.
  4. Keep allow_redirects=False for the existing redirect mitigation.

Betroffene Software

Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.

PlattformPaketAnfällige VersionenBehoben in
Python (PyPI) mobsf < 4.5.1 4.5.1

Verweise

CVSS-Wert 3/10
CVSS-Vektor
CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:L/I:N/A:N
Schwäche (CWE)
CWE-918
Plattform
Python (PyPI)
Paket
mobsf
Veröffentlicht
18.08.2026
Aktualisiert
11.10.2026 14:19

Quellen und Lizenzen

OSV / GitHub Advisory Database - PYSEC-2026-3690 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-95px-34x5-p37h - CC BY 4.0

Schwachstellenhistorie: mobsf

Alle veröffentlichten Schwachstellen dieses Pakets (Python (PyPI)), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.

Alle (22) im Archiv
Einträge insgesamt
22
Erste → letzte
10.2022 08.2026
Ohne Fix
1
In Angriffen ausgenutzt
0

Verteilung nach Schweregrad

  • Hoch 9
  • Mittel 11
  • Niedrig 2

Veröffentlichungen pro Jahr

  1. 2022: 1
  2. 2023: 1
  3. 2024: 6
  4. 2025: 8
  5. 2026: 6
Schweregrad:
  1. MobSF has SSRF port restriction bypass in assetlinks_check dieser Eintrag
    Niedrig · 3.0 CVE-2026-68927 < 4.5.1 4.5.1
  2. Hoch · 6.5 CVE-2025-24805 < 4.3.1 4.3.1
  3. Hoch · 6.5 CVE-2025-24804 < 4.3.1 4.3.1
  4. Hoch · 8.1 CVE-2025-24803 < 4.3.1 4.3.1
  5. Hoch · 7.3 CVE-2024-29190 < 3.9.7 3.9.7

Erkennen Sie Schwachstellen in Ihrer Anwendung

Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.

Anwendung verbinden
DockRay Newsletter

Anwendungssicherheit in Ihrem Postfach

Wichtige Schwachstellen, konkrete Empfehlungen und praktische Tipps für Ihre Anwendungen. Wählen Sie Ihre Technologien und verfolgen Sie, was für Ihr Projekt relevant ist.

  • Eine tägliche Zusammenfassung neuer Schwachstellen, auch kritischer.
  • Benachrichtigungen über wichtige Updates.
  • Praktische Tipps zur Sicherheit und Überwachung von Anwendungen.

Leer lassen, um Meldungen zu allen Technologien zu erhalten.

Kostenlos anmelden. In jeder E-Mail mit einem Klick abmelden.