Beyond Certificate Pinning in Mobile Apps
How TLS, Public Key Pinning, Certificate Transparency, and runtime protection work together to protect communication with your backend.
Your application can use strong encryption and still send sensitive data to an endpoint it should never have trusted.
The cause might be an insecure trust configuration, an improperly issued certificate, or an attacker modifying the application’s security checks. Encryption can remain intact while the intended security policy fails.
For banking, payments, identity, and other applications handling sensitive information, protecting network communication means addressing three questions:
Who is the application connecting to? How is the data protected? And can an attacker interfere with the checks?
The OWASP Mobile Application Security Verification Standard, or MASVS, provides a useful foundation. Its network requirements address secure communication and identity pinning, while its resilience requirements address attempts to modify or instrument the application.
What TLS, Public Key Pinning, and Certificate Transparency actually protect
TLS establishes secure communication
TLS encrypts traffic and protects it against modification in transit. In a typical HTTPS connection, the application also validates the server’s certificate and checks that it belongs to the intended hostname.
These checks matter as much as encryption. A proxy cannot decrypt correctly authenticated TLS traffic simply because it controls the Wi-Fi network or routes traffic through a VPN. Interception requires the application to accept the proxy’s identity or its validation controls to be bypassed.
MASVS-NETWORK-1 addresses this foundation: securing network traffic according to current best practices. In practice, that means appropriate TLS settings, correct certificate and hostname validation, and preventing sensitive communication from falling back to cleartext.
Public Key Pinning restricts accepted server identities
This is what developers usually mean by certificate pinning or SSL pinning, though the two terms cover several different approaches.
Ordinary certificate validation relies on trusted certificate authorities. Public Key Pinning adds a more specific requirement: the server’s validated certificate chain must contain a public key that the application explicitly accepts.
For example, a banking application can pin its backend’s public key. A replacement certificate containing another key will then fail the pinning check, even if it would otherwise be trusted.
MASVS-NETWORK-2 specifies identity pinning for remote endpoints under the developer’s control. This additional restriction reduces reliance on the wider set of certificate authorities trusted by the device.
Pinning a server key provides a narrower restriction than pinning a certificate authority’s key. The choice affects both security and the flexibility available when certificates or infrastructure change.
Certificate Transparency adds another check
Certificate Transparency makes certificate issuance publicly auditable. Applications can enforce a transparency policy, while domain owners monitor logs for unexpected certificates.
A certificate can be publicly logged and still have been issued improperly.
Certificate Transparency makes that issuance discoverable; Public Key Pinning checks whether the connection uses an explicitly accepted key. The two controls have distinct roles.
Certificate Transparency is a complementary control. MASVS-NETWORK-1 and MASVS-NETWORK-2 do not explicitly require it, and Certificate Transparency does not replace the identity pinning specified by MASVS-NETWORK-2.
Should the app trust this connection?
An example blocking policy with both Public Key Pinning and Certificate Transparency enabled. Each check serves a different purpose.
Why the checks need protection too
Network security controls run inside the client application. An attacker who can modify or instrument that application may try to replace its pins, alter a validation result, or prevent a failed check from blocking the connection.
These attempts can target platform APIs, third-party libraries, and custom implementations. SSL pinning bypass is well documented, with public tooling available for both Android and iOS; OWASP’s Mobile Application Security Testing Guide, or MASTG, covers the pinning bypass techniques directly.
The attacker may also target plaintext before encryption or after decryption. Malicious or injected code can expose data without breaking TLS.
This connects network security to MASVS-RESILIENCE. In particular, MASVS-RESILIENCE-2 addresses anti-tampering mechanisms, while MASVS-RESILIENCE-4 addresses resistance to dynamic analysis and instrumentation. These protections help defend the application code that makes and enforces security decisions.
Protect the code that enforces trust
An attacker with sufficient access inside the app can target checks or plaintext.
Integrity checks and runtime defenses help protect the trust decision and resist access to sensitive data inside the application.
Network Communication Hardening
DexProtector’s network communication hardening reinforces the application’s network security controls and combines them with application integrity and runtime protection.
The DexProtector Runtime Engine uses an independent certificate-chain validation implementation. This reduces reliance on standard platform validation paths that attackers commonly target. Its integration with anti-tampering, anti-hooking, and other runtime defenses makes interference with those controls harder.
On Android and iOS, a certificate may pass the application’s normal trust checks without meeting its Certificate Transparency requirements; for example, a proxy certificate issued by a locally installed CA that the application trusts. When DexProtector is configured to require Certificate Transparency for a domain, its Runtime Engine verifies the certificate’s Certificate Transparency evidence and independently validates the certificate chain and checks that the certificate matches the requested hostname. If the Certificate Transparency evidence is missing or invalid, the engine blocks the connection even if the certificate passes platform validation.
DexProtector provides reinforced Public Key Pinning and Certificate Transparency enforcement on Android 5.0 and later, and on iOS 13 and later, using the same Public Key Pinning and Certificate Transparency configuration on both platforms.
For organizations supporting a broad range of devices, this brings these controls across their supported Android and iOS application ecosystem.
The approach combines:
- TLS policy enforcement: strengthens transport settings and prevents cleartext communication.
- Public Key Pinning: restricts accepted server identities using configured public keys.
- Certificate Transparency: enforces the configured Certificate Transparency requirements.
- Blocking and reporting: enforces connection policy and provides evidence for investigation.
- Integrity and runtime protection: resists attempts to modify, hook, or bypass the security controls.
Applications often use several networking stacks, including native libraries, cross-platform frameworks, and embedded SDKs. Coverage should therefore be verified across the connections carrying sensitive information, including after networking libraries or protocols change.
Connecting the protections to OWASP MASVS
For teams using MASVS in development, procurement, or security assessments, the relevant relationships are straightforward:
Secure network communication using current best practices.
TLS configuration, server authentication, and protection against cleartext communication.
Identity pinning for endpoints under the developer’s control.
Public Key Pinning.
Resistance to application tampering.
Integrity checks protecting code, resources, and security controls.
Resistance to dynamic analysis.
Defenses against debugging and runtime instrumentation.
These controls cover related but separate responsibilities. Network communication hardening supports the network requirements, while DexProtector’s integrity and runtime protections support the resilience requirements. Conformance must be assessed against the application’s configuration, coverage, and applicable assessment scope.
Where network protection and mobile API protection meet
Network communication hardening helps the application authenticate the service and enforce transport policy. Mobile API Protection provides application and runtime evidence for the backend to validate before authorizing a request. It’s a good idea to combine that evidence with user authentication, permissions, request binding and replay controls.
Transport security also has limits in payment flows. Malware may manipulate inputs before the application creates a payment cryptogram or sends a protected request; NFC relay attacks can involve relaying messages without breaking TLS. A valid TLS connection alone does not establish transaction correctness, user intent or physical proximity. Apply the appropriate transaction validation and payment-protocol protections in addition to network hardening and application attestation.
A practical checklist for mobile security teams
When evaluating network communication hardening, verify:
- Coverage. The relevant operating systems, networking libraries, and protocols are supported.
- Correct validation. Certificate and hostname checks remain effective alongside Public Key Pinning and Certificate Transparency.
- Resistance to bypass. Protection covers the checks, their configuration, and the code enforcing the result.
- Operational continuity. Backup pins, rotation, older clients, and emergency recovery are tested.
- Assessment evidence. Testing demonstrates the relevant MASVS-NETWORK and MASVS-RESILIENCE controls in the application.
FAQs
What’s the difference between SSL pinning and certificate pinning?
In practice the terms are used interchangeably, and both usually refer to the same idea: restricting which server identities an application will accept beyond ordinary certificate validation.
What matters more than the label is what’s pinned. Pinning a specific certificate is the narrowest option and breaks when the certificate is renewed. Pinning a public key survives certificate renewal provided the key is reused. Pinning an intermediate or root CA is the broadest, and allows any certificate issued under that authority. DexProtector uses Public Key Pinning, which is the approach MASVS-NETWORK-2 specifies.
Does HTTPS already prevent man-in-the-middle attacks?
Correctly configured HTTPS protects against network interception. Its effectiveness depends on certificate validation, the application’s trust policy, and the integrity of the client enforcing those checks.
How does Certificate Transparency work in DexProtector?
When you configure a domain to require Certificate Transparency (CT), the DexProtector Runtime Engine verifies the server certificate’s CT evidence. The engine also independently validates the certificate chain and checks that the certificate matches the requested hostname. If the required CT evidence is missing or invalid, DexProtector blocks the connection even if the certificate passes platform validation.
Does OWASP MASVS require Certificate Transparency?
MASVS-NETWORK-1 and MASVS-NETWORK-2 do not explicitly require Certificate Transparency. They address secure network communication and identity pinning, respectively. Certificate Transparency provides complementary protection.
Which operating systems support DexProtector’s Public Key Pinning and Certificate Transparency enforcement?
DexProtector provides reinforced Public Key Pinning and Certificate Transparency enforcement on Android 5.0 and later and iOS 13 and later.