• Services
    • Vulnerability Management
    • Pentest
    • Network Pentest
    • Website Security Check
    • Phishing Campaign
    • Mystery Guest
    • Quick scan
  • NetCaptain
  • Knowledge base
  • Partners
    • MSP
  • About us
    • Contact
    • Why CyberAnt
    • News
    • Vacancies
  • Login
  • EN
    • NL
  • Menu Menu

Pin or no pin: the trade-off around certificate pinning in mobile apps

in Cyber Security, Knowledge base

Certificate pinning sounds like the holy grail for a secure mobile app. Your app then no longer trusts every Certificate Authority that Android or iOS trusts by default, but only a pre-approved set of public keys. An attacker with a fraudulently issued or locally installed root certificate then has no chance. Still, the Android Developers documentation explicitly advises against it, mainly because of the operational risks when a server configuration changes. A future CA change or certificate rotation could render the app completely inaccessible, and a fix requires an app-store update that users only install when they want to.

Why pinning remains enticing

Standard TLS validation leans on the operating system’s trust store. In it are more than a hundred root CAs. If one of those CAs is compromised, or if malware or a corporate proxy places an additional root CA on the device, an attacker can present a valid-looking certificate for your API. For a banking app, a healthcare app or an application that controls industrial controls, this is unacceptable. OWASP therefore classifies identity pinning as MASVS-NETWORK level 2 control, recommended for apps that process sensitive data.

The two golden rules

Those who do pin must follow two rules. The first is:pin public keys, not certificates. A certificate changes every 60 to 90 days with automated vendors such as Let’s Encrypt, but the underlying key pair can remain static. The hash of the SubjectPublicKeyInfo, SPKI for short, is your pin. Generate it with OpenSSL:

openssl s_client -connect api.jouwdomein.nl:443 | openssl x509 -pubkey -noout | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | openssl base64

The second is: always add a backup pin. That’s a second key pair that you keep offline and don’t hang in production yet. When you need to rotate, you put the backup pair on the server and the app already trusts it, no update needed. Only in a subsequent release do you introduce a new backup and delete the old primary.

Also remember that pinning is a line of defense, not an impenetrable wall. An attacker with root on the device can repackage the APK, modify the pins and re-sign the app. Therefore, pinning belongs in a broader strategy that includes Play Integrity, root detection, obfuscation and runtime checks.

https://cyberant.com/wp-content/uploads/2026/06/cert-pinning.png 1024 1536 cyberant https://cyberant.com/wp-content/uploads/2020/08/logo-cyberant.svg cyberant2026-06-03 17:54:022026-06-03 17:54:02Pin or no pin: the trade-off around certificate pinning in mobile apps

Help! I have been hacked

in Cyber Security, Hacken
Read more
https://cyberant.com/wp-content/uploads/2024/05/HACKED_help_ik_ben_gehackt.jpg 889 1333 cyberant https://cyberant.com/wp-content/uploads/2020/08/logo-cyberant.svg cyberant2024-05-23 13:11:502024-06-04 13:43:08Help! I have been hacked

Tens of thousands of computer systems vulnerable to break-in

in Cyber Security, News, Risk management
Read more
https://cyberant.com/wp-content/uploads/2024/02/Critical-systems-error.jpg 819 1226 cyberant https://cyberant.com/wp-content/uploads/2020/08/logo-cyberant.svg cyberant2024-03-04 11:48:012024-03-04 11:48:05Tens of thousands of computer systems vulnerable to break-in

NIS2 Guidelines: What companies need to know and how to comply

in Knowledge base, News, Risk management
Read more
https://cyberant.com/wp-content/uploads/2023/11/NIS2-Richtlijnen-cybersecurity.jpg 669 1000 John de Kroon https://cyberant.com/wp-content/uploads/2020/08/logo-cyberant.svg John de Kroon2023-11-03 12:38:202023-11-28 10:56:16NIS2 Guidelines: What companies need to know and how to comply

What is cross-site scripting (XXS)?

in Hacken, Knowledge base
Read more
https://cyberant.com/wp-content/uploads/2023/10/cross-site-scripting.jpg 540 733 cyberant https://cyberant.com/wp-content/uploads/2020/08/logo-cyberant.svg cyberant2023-10-12 16:14:302023-11-09 11:29:18What is cross-site scripting (XXS)?

What is cross-site request forgery (CSRF)?

in Hacken, Knowledge base
Read more
https://cyberant.com/wp-content/uploads/2023/10/Cross-site-request-forgery-kennisbank-artikel.jpg 801 1180 cyberant https://cyberant.com/wp-content/uploads/2020/08/logo-cyberant.svg cyberant2023-10-12 16:06:372023-11-09 11:42:01What is cross-site request forgery (CSRF)?

User settings for AWS security audits

in Knowledge base, Product information
Read more
https://cyberant.com/wp-content/uploads/2023/09/512px-Amazon_Web_Services_Logo.svg.png 307 512 cyberant https://cyberant.com/wp-content/uploads/2020/08/logo-cyberant.svg cyberant2023-09-27 14:37:082023-11-09 11:22:23User settings for AWS security audits

Social Engineering

in Cyber Security, Knowledge base
Read more
https://cyberant.com/wp-content/uploads/2023/09/anonymous-mask-data-thief-in-2023.png 1199 1804 cyberant https://cyberant.com/wp-content/uploads/2020/08/logo-cyberant.svg cyberant2023-09-27 10:59:152023-11-09 14:06:34Social Engineering

Preventing phishing attacks

in Cyber Security, Knowledge base
Read more
https://cyberant.com/wp-content/uploads/2023/09/Phishing-aanvallen-scaled.jpg 1706 2560 cyberant https://cyberant.com/wp-content/uploads/2020/08/logo-cyberant.svg cyberant2023-09-27 10:07:552023-11-09 11:51:27Preventing phishing attacks

The Network Security Check

in Cyber Security, Knowledge base, Product information
Read more
https://cyberant.com/wp-content/uploads/2023/09/netwerk-security-check-cyberant.png 690 1035 cyberant https://cyberant.com/wp-content/uploads/2020/08/logo-cyberant.svg cyberant2023-09-27 09:40:222023-11-09 12:09:21The Network Security Check
Page 1 of 3123

Search

Search Search

Recent Posts

  • Pin or no pin: the trade-off around certificate pinning in mobile apps
  • TrapDoor supply-chain attack steals passwords from developers
  • Once again malware found in US Code Extensions
  • Large-scale attack on popular npm packages: millions of websites and apps potentially affected
  • Age verification on the Internet: what about privacy?

CyberAnt is ISO Certified

Iso gecertificeerd

Tags

.DS Store anti-virus award broken access control clickjacking Cryptographic Failures cyberaanval CyberAnt Cybercrime cybercriminelen CyberRisk Cyber Security Datalek Entity injection Etisch Hacker Hacker Insecure Design ISO 9001 ISO 27001 IT Infrastructuur beschermen malware Mass Assignment aanval NetCaptain NetCat shell upgraden Netgear ProSAFE switches nominated Open web application Security project Owasp path traversal penetration test pentest Ransomeware aanval Ransomware Responsible Disclosure secure coding Secure webshop Security Audit Security audits Security Misconfiguration Server-side request forgery (SSRF) Social Engineering SQL Injection supply chain attack vulnerability management web applicatie scanning
CyberAnt is ISO gecertificeerd

Services

  • Pentest
  • Network Pentest
  • Website Security Check
  • Phishing Campaign
  • Mystery Guest

Cyberant

  • Why CyberAnt
  • Partners
  • Knowledge base
  • News
  • About us

Contact

Marconiweg 1
3899 BR Zeewolde

info@cyberant.com
+31 (0)85 047 1590

© Copyright - CyberAnt 2024
  • Link to Facebook
  • Link to LinkedIn
  • Link to Mail
Scroll to top Scroll to top Scroll to top

Deze site maakt gebruik van cookies. Door verder te surfen op de site gaat u akkoord met ons gebruik van cookies.

Accepteer instellingenVerberg de mededeling enkelInstellingen

Cookie and Privacy Settings



How we use cookies

We may request cookies to be set on your device. We use cookies to let us know when you visit our websites, how you interact with us, to enrich your user experience, and to customize your relationship with our website.

Click on the different category headings to find out more. You can also change some of your preferences. Note that blocking some types of cookies may impact your experience on our websites and the services we are able to offer.

Essential Website Cookies

These cookies are strictly necessary to provide you with services available through our website and to use some of its features.

Because these cookies are strictly necessary to deliver the website, refusing them will have impact how our site functions. You always can block or delete cookies by changing your browser settings and force blocking all cookies on this website. But this will always prompt you to accept/refuse cookies when revisiting our site.

We fully respect if you want to refuse cookies but to avoid asking you again and again kindly allow us to store a cookie for that. You are free to opt out any time or opt in for other cookies to get a better experience. If you refuse cookies we will remove all set cookies in our domain.

We provide you with a list of stored cookies on your computer in our domain so you can check what we stored. Due to security reasons we are not able to show or modify cookies from other domains. You can check these in your browser security settings.

Other external services

We also use different external services like Google Webfonts, Google Maps, and external Video providers. Since these providers may collect personal data like your IP address we allow you to block them here. Please be aware that this might heavily reduce the functionality and appearance of our site. Changes will take effect once you reload the page.

Google Webfont Settings:

Google Map Settings:

Google reCaptcha Settings:

Vimeo and Youtube video embeds:

Privacy Policy

You can read about our cookies and privacy settings in detail on our Privacy Policy Page.

Privacy statement
Accepteer instellingenVerberg de mededeling enkel