PYSEC-2026-3690
Vulnerability from pysec - Published: 2026-08-19 11:56 - Updated: 2026-08-19 12:16Summary
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:
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():
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:
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:
<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:
- Build
c_url, then run validation on the full URL, including scheme, hostname, port, path, query, and params. - Reject
android:portvalues other than 80 and 443 before appending them to the URL. - 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.
- Keep
allow_redirects=Falsefor the existing redirect mitigation.
| Name | purl | mobsf | pkg:pypi/mobsf |
|---|
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "mobsf",
"purl": "pkg:pypi/mobsf"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "4.5.1"
}
],
"type": "ECOSYSTEM"
}
],
"versions": [
"3.2.6",
"3.2.7",
"3.2.8",
"3.2.9",
"3.3.3",
"3.3.5",
"3.4.0",
"3.4.3",
"3.4.6",
"3.5.0",
"3.6.0",
"3.6.9",
"3.7.6",
"3.9.7",
"4.1.3",
"4.3.0",
"4.3.2",
"4.4.0",
"4.4.2",
"4.4.5"
]
}
],
"aliases": [
"CVE-2026-68927",
"GHSA-95px-34x5-p37h"
],
"details": "## Summary\n\nMobSF\u0027s 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:\u003cattacker-port\u003e/.well-known/assetlinks.json` or `https://host:\u003cattacker-port\u003e/.well-known/assetlinks.json`.\n\n## Impact\n\nAn 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.\n\nThis 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.\n\n## Root cause\n\n`valid_host()` rejects ports other than 80 and 443 when a port is included in the string being validated:\n\n```python\nport = parsed.port\n...\nif port and port not in (80, 443):\n return False\n```\n\nIn `get_browsable_activities()`, only the host attribute is passed to `valid_host()`:\n\n```python\nhost = data.getAttribute(f\u0027{ns}:host\u0027)\nport = data.getAttribute(f\u0027{ns}:port\u0027)\n...\nif not valid_host(host):\n logger.warning(\u0027Invalid Host: %s\u0027, host)\n continue\nshost = f\u0027{scheme}://{host}\u0027\nif port and is_number(port):\n c_url = f\u0027{shost}:{port}{WELL_KNOWN_PATH}\u0027\nelse:\n c_url = f\u0027{shost}{WELL_KNOWN_PATH}\u0027\nwell_known[c_url] = shost\n```\n\n`_check_url()` then fetches the assembled URL after checking only path, query, and params:\n\n```python\npurl = urlparse(url)\nif (purl.path != WELL_KNOWN_PATH\n or len(purl.query) \u003e 0\n or len(purl.params) \u003e 0):\n logger.warning(\u0027Invalid Assetlinks URL: %s\u0027, url)\n continue\nr = requests.get(url,\n timeout=5,\n allow_redirects=False,\n proxies=proxies,\n verify=verify)\n```\n\n## Reproduction\n\nUse an Android manifest with a browsable App Link data tag that has a benign-looking host and a restricted port:\n\n```xml\n\u003cactivity android:name=\".DeepLink\" android:exported=\"true\"\u003e\n \u003cintent-filter\u003e\n \u003caction android:name=\"android.intent.action.VIEW\" /\u003e\n \u003ccategory android:name=\"android.intent.category.BROWSABLE\" /\u003e\n \u003ccategory android:name=\"android.intent.category.DEFAULT\" /\u003e\n \u003cdata android:scheme=\"http\" android:host=\"rebind.example\" android:port=\"22\" /\u003e\n \u003c/intent-filter\u003e\n\u003c/activity\u003e\n```\n\nA safe local proof with DNS and HTTP monkeypatching shows that MobSF validates only `rebind.example`, then fetches a URL that preserves the unchecked port:\n\n```text\nwell_known map: {\u0027http://rebind.example:22/.well-known/assetlinks.json\u0027: \u0027http://rebind.example\u0027}\nrequests.get calls: [(\u0027http://rebind.example:22/.well-known/assetlinks.json\u0027, {\u0027timeout\u0027: 5, \u0027allow_redirects\u0027: False, \u0027proxies\u0027: None, \u0027verify\u0027: True})]\nfindings: [{\u0027url\u0027: \u0027http://rebind.example:22/.well-known/assetlinks.json\u0027, \u0027host\u0027: \u0027http://rebind.example\u0027, \u0027status_code\u0027: 200, \u0027status\u0027: True}]\nVULNERABLE: valid_host validated only rebind.example, but assetlinks_check fetched unchecked port 22 via http://rebind.example:22/.well-known/assetlinks.json\n```\n\nThe same code pattern is present in latest release `v4.4.6` and current main.\n\n## Remediation\n\nValidate the final URL after all manifest components have been applied. In particular:\n\n1. Build `c_url`, then run validation on the full URL, including scheme, hostname, port, path, query, and params.\n2. Reject `android:port` values other than 80 and 443 before appending them to the URL.\n3. 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.\n4. Keep `allow_redirects=False` for the existing redirect mitigation.",
"id": "PYSEC-2026-3690",
"modified": "2026-08-19T12:16:29.784292Z",
"published": "2026-08-19T11:56:27.673423Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/MobSF/Mobile-Security-Framework-MobSF/security/advisories/GHSA-95px-34x5-p37h"
},
{
"type": "WEB",
"url": "https://github.com/MobSF/Mobile-Security-Framework-MobSF/pull/2627"
},
{
"type": "WEB",
"url": "https://github.com/MobSF/Mobile-Security-Framework-MobSF/commit/62563ca429a75b3e5d47a13b958e1d2e7d5e2bbf"
},
{
"type": "PACKAGE",
"url": "https://github.com/MobSF/Mobile-Security-Framework-MobSF"
},
{
"type": "WEB",
"url": "https://github.com/MobSF/Mobile-Security-Framework-MobSF/releases/tag/v4.5.1"
},
{
"type": "PACKAGE",
"url": "https://pypi.org/project/mobsf"
},
{
"type": "ADVISORY",
"url": "https://github.com/advisories/GHSA-95px-34x5-p37h"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-68927"
}
],
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:L/I:N/A:N",
"type": "CVSS_V3"
}
],
"summary": "MobSF has SSRF port restriction bypass in assetlinks_check"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.