Android network checks
Android network security configuration review
The network security configuration states which connections an Android app permits and which certificates it trusts. It describes policy, not traffic, so read it as the starting point for a network check.
Find the effective configuration
Since Android 7.0 (API 24), an app can reference an XML file from the android:networkSecurityConfig attribute of its <application> element. When it is absent, platform defaults apply, and those depend on the app's target SDK.
Record the target SDK, the configuration file and any android:usesCleartextTraffic attribute. On Android 7.0 and higher, that manifest attribute is ignored when a network security configuration is present. These checks map to MASVS-NETWORK.
Read each setting for what it allows
Scroll the table horizontally on small screens.
| Setting | What it allows | What it does not prove |
|---|---|---|
| Cleartext permitted | cleartextTrafficPermitted="true" in a base or domain config permits HTTP. Apps targeting API 27 or lower permit cleartext by default; from API 28 the default is to block it. | That the app sent sensitive data over HTTP. |
| User CAs trusted | <certificates src="user"/> in the trust anchors lets certificates installed by the device user validate connections. Apps targeting API 24 or higher trust only system CAs unless they opt in. | That an attacker can install a CA on a real user's device. |
| Certificate pinning | A <pin-set> restricts a domain to listed public-key hashes. An expiration date turns pinning off after that date. | That every network library in the app uses the pins. |
| Debug overrides | <debug-overrides> applies only when the app is debuggable. | A risk in a release build, unless that build is also debuggable. |
The Android network security configuration documentation lists every element and default.
Example network_security_config.xml
A release configuration that blocks cleartext, trusts only system CAs, pins one API domain and keeps user CAs for debug builds looks like this. The file lives in res/xml/ and is referenced as android:networkSecurityConfig="@xml/network_security_config".
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="false">
<trust-anchors>
<certificates src="system" />
</trust-anchors>
</base-config>
<domain-config>
<domain includeSubdomains="true">api.example.test</domain>
<pin-set expiration="2027-06-01">
<pin digest="SHA-256">7HIpactkIAq2Y49orFOOQKurWxmmSFZhBCoQYcRhJ3Y=</pin>
<!-- backup key, so a rotation does not lock users out -->
<pin digest="SHA-256">fwza0LRMXouZHRC8Ei+4PyuldPDcf3UKgO/04cDM1oE=</pin>
</pin-set>
</domain-config>
<debug-overrides>
<trust-anchors>
<certificates src="user" />
</trust-anchors>
</debug-overrides>
</network-security-config>The pin values above are placeholders. When reviewing a real file, check each element against the table: is cleartextTrafficPermitted="true" set anywhere, does a <certificates src="user"/> appear outside <debug-overrides>, does the pin set have a backup pin, and has its expiration date already passed? After that date the pins are ignored. How to compute and test pins is covered in the certificate pinning guide.
Check the code that can override it
The configuration governs the platform's network stack and libraries that respect it. Search the code for a custom TrustManager that accepts every certificate, a HostnameVerifier that always returns true, or a WebView error handler that proceeds on TLS errors. Any of these can weaken validation regardless of the XML.
Native code and cross-platform frameworks with their own TLS implementation may not follow the configuration at all. Record which stack each relevant request uses before concluding that a setting protects it.
Confirm with observed traffic
In an authorized runtime session, exercise the workflows that use the affected domains with test data. An attributable capture of sensitive data over HTTP, or of a connection accepted with an untrusted certificate, is observed evidence. A configuration line alone is a candidate.
If the app pins certificates or rejects the interception certificate, traffic may not be visible. Record that as a coverage gap for those requests, not as a clean result. Bypassing pinning is a separate, explicitly scoped activity.
Example: cleartext for one domain
Suppose a release build targets API 34 and its configuration permits cleartext only for legacy.example.test. The base default still blocks HTTP elsewhere. The review question becomes which workflows call that domain and what they send.
If an authorized session shows a login request to that domain over HTTP with test credentials, report an observed exposure. If only image downloads use it, the impact is different and the report should say so.
This example describes an assessment method, not a finding measured by AppBreach on a customer app.
Next steps
Use the static vs dynamic testing guide to plan the runtime session, and the report evidence guide to record the result. AppBreach pairs static network-configuration checks with optional authorized real-device Android verification; runtime coverage depends on the approved scope and available environment.