Android network configuration permits cleartext (HTTP) traffic
ID |
dart.config.android_insecure_transport_configuration |
Severity |
critical |
Remediation Complexity |
trivial |
Remediation Risk |
low |
Remediation Effort |
low |
Resource |
Config |
Language |
Dart |
Description
Android Network Security Configuration permits cleartext HTTP traffic (cleartextTrafficPermitted="true" in network_security_config.xml, or android:usesCleartextTraffic="true" in AndroidManifest.xml). Combined with Flutter’s ignore-OS-proxy behaviour this exposes the app to trivial MitM on any hostile network.
Rationale
Android since API 28 enforces cleartext-traffic blocking by
default: http:// connections from any Android system component
(WebView, HttpsURLConnection, OkHttp) are refused unless the
app explicitly opts in. The two opt-in flags are:
-
android:usesCleartextTraffic="true"on the<application>element inAndroidManifest.xml— a blanket enable for the whole app. -
cleartextTrafficPermitted="true"on a<base-config>or<domain-config>innetwork_security_config.xml— same effect, optionally restricted to specific domains.
Either flag re-opens the cleartext path. For Flutter apps the
exposure is wider than for native Android apps: Flutter’s
dart:io HttpClient runs OUTSIDE the Android networking stack
and isn’t affected by this XML at all — but enabling it signals
that the developer accepts cleartext traffic, and any native
plugin / WebView using the Android stack inherits the
permission.
Either way: any Wi-Fi / LAN / ISP attacker decrypts and forges
HTTP responses, and the app may load attacker-supplied content
(including malicious WebView content as in
unrestricted_webview_load).
Remediation
Set both flags to false (or omit them — the secure default).
For genuinely-cleartext local-development scenarios, scope the
exception to a <domain-config> for localhost / 10.0.2.2
only, and never ship that profile to a release build.
<!-- Vulnerable -->
<application android:usesCleartextTraffic="true" ...>
<base-config cleartextTrafficPermitted="true">...</base-config>
<!-- Fixed -->
<application android:usesCleartextTraffic="false" ...>
<base-config cleartextTrafficPermitted="false">
<trust-anchors><certificates src="system"/></trust-anchors>
<pin-set expiration="2027-01-01">
<pin digest="SHA-256">7HIpactk...</pin>
</pin-set>
</base-config>
References
-
OWASP Top 10 2025 - A04 : Cryptographic Failures.
-
OWASP Top 10 2025 - A02 : Security Misconfiguration.
-
Android — Network Security Configuration — Canonical reference; documents
cleartextTrafficPermittedand<pin-set> -
Talsec — OWASP Mobile Top 10 for Flutter M5 — Insecure communication for Flutter and Dart, including Android network-config pitfalls
-
Cossack Labs — Flutter application security considerations — Notes that Flutter HTTP traffic bypasses the Android network stack and needs Dart-layer pinning