Lesson 7 of 13 · 10m
TLS Is Not a Given
Cleartext permission is a per-app, per-SDK policy decision set in networkSecurityConfig and the ATS dict — one staging exemption or NSAllowsArbitraryLoads silently undoes it.
https:// in the URL is not the guarantee
On Android, whether cleartext HTTP is even allowed depends on usesCleartextTraffic and the app's targetSdkVersion, not on your URL strings. Apps targeting API 27 or lower permit cleartext by default; API 28+ (Pie, 2018) flipped the default to blocked. A target-33 app that silently falls back to http:// for an endpoint fails the connection — unless somebody set usesCleartextTraffic="true" or a networkSecurityConfig <domain-config cleartextTrafficPermitted="true"> entry to make a staging build work, and shipped it.
The manifest-level config is res/xml/network_security_config.xml, pointed to by android:networkSecurityConfig. Its vocabulary matters: <base-config> applies to everything, <domain-config> overrides per host, <trust-anchors> picks between system and user CA stores, <debug-overrides> exists precisely so test builds can trust a proxy CA without touching release config, and <pin-set> does pinning — covered next lesson. The audit question is never "do we use HTTPS"; it's "what does our config permit where we didn't look" — and WebView inherits the same policy, so a cleartext exception is also WebView's exception.
iOS answers the same problem with App Transport Security: since iOS 9 (announced WWDC 2015), NSURLSession, WKWebView, and URLSession connections must be TLS 1.2+ with forward secrecy and 2048-bit RSA minimums. NSAllowsArbitraryLoads — the flag every StackOverflow answer reaches for — disables the whole thing globally; NSAllowsArbitraryLoadsInWebContent (iOS 10+) scopes the kill to web content, and NSExceptionDomains in the NSAppTransportSecurity dict scopes it to named hosts with per-domain minimums like NSExceptionMinimumTLSVersion. App Review asks you to justify arbitrary loads; grep the Info.plist for NSAllows before you grep URLs for http.
Where it actually breaks
Third-party SDKs ship their own HTTP stacks. An analytics or ad SDK running plain HTTP to its ingest endpoint doesn't care what your networkSecurityConfig intends — MobSF and a proxy will show the traffic your manifest forgot about. Cleartext also arrives through the seams: WebView.loadUrl("http://..."), image loaders fetching http URLs from API responses, a deeplink handler that passes a url extra straight into a WebView — each bypasses the "we only do HTTPS" story even though the framework policy may still block or permit per config. The other direction breaks too: permissive cleartextTrafficPermitted entries survive refactors, and nobody audits them at release.
Redirects deserve their own sentence: a 302 from https to http inside a WebView under arbitrary loads is a downgrade the URL bar never shows.
Certificate Transparency is the quieter companion control: since 2018 Chrome and (on iOS) ATS-adjacent policy require publicly trusted certs to appear in CT logs — which means an attacker can't mint a cert for your domain without it landing in a public, auditable log (crt.sh queries them). CT catches rogue issuance; it does nothing about a rogue-but-installed trust anchor, which is the gap pinning exists to close.
The same config files hold the trust-anchor policy: <trust-anchors> restricts who the app will believe, and since API 24 the user store isn't believed by default — your own test CA needs a <debug-overrides> entry, not a release exemption.
The wrong model
"HTTPS is a URL property." It isn't — it's a platform policy decision applied per-connection. The app, its WebViews, its image pipeline, its deeplink handler, and every bundled SDK each get a policy, and any of them can hold an exception you didn't write. The certificate trust anchors, TLS floor, and cleartext permission all live in config files a junior edits to unblock a demo and forgets.
Practice
rg 'cleartext|NSAllows'over the manifest andInfo.plistin every release audit; the answer should be empty or a reviewed list.- Keep
usesCleartextTrafficabsent (target 28+ default) or explicitlyfalse. - Never ship
NSAllowsArbitraryLoads; scoped exceptions viaNSExceptionDomainsonly, withNSIncludesSubdomainsset correctly. - Run
nscurl --ats-diagnostics https://your.api(macOS) when an iOS connection fails mysteriously — it tells you exactly which ATS rule killed it. - Test the real artifact through a proxy: the SDK traffic you see in Burp is the audit, not the manifest alone.
Was this lesson helpful?
Keep reading
Related articles from the SudoSecurity blog.
They Got Root on a Fully Patched Ivanti VPN and the Integrity Checker Said Everything Was Fine
Volexity caught an attacker chaining zero-days into unauthenticated root on an Ivanti Connect Secure appliance running the latest build. The payload never touched disk, commands rode in over the same HTTPS requests as the exploit, and Ivanti's Integrity Checker reported no modifications.
Gitea Shipped 21 CVEs in One Release and Eleven of Them Are the Same Bug
Gitea 28.3.0 landed November 1 with twenty-one CVE fixes. Read the list and a pattern jumps out: more than half are the same failure repeated across different route handlers, where a token scoped to public data gets handed private data anyway. That's not twenty-one mistakes.
php2shell: The PHP Bug That Fires Before Your Code Runs
Two critical PHP flaws landed October 21 and were in CISA's exploited-vulnerabilities catalog five days later. The 9.2 score isn't the part that should bother you. It's where the bug lives — it goes off while PHP is still assembling $_POST, before a single line of your application has run.
A Certificate Authority's Private Keys Were the Numbers 4, 56 and 66
Eight eMudhra intermediate CA keys turned out to be recoverable from their own public certificates. Not stolen — computable, because the key generation produced almost no entropy. A researcher pulled all eight in under a second and signed a message with each one to prove it.