View All
mobile-apps

Mobile App Security Best Practices for 2026

Layla Wakily6 min read

Mobile app security means protecting the people who use your app, the data it stores and the servers it talks to, so that a lost phone, a fake app or a curious attacker cannot read or change information they should not see. In practice, most real-world app breaches come from a small set of avoidable mistakes: weak login handling, secrets hidden in the app, unprotected APIs and sensitive data stored in plain text on the device.

Key Takeaways

  • Treat the app as untrusted: anything shipped inside it, including API keys, can be extracted.
  • Most security work happens on the server and API, not in the app screens.
  • Use the platform's secure storage (Keychain on iOS, Keystore on Android) for tokens, never plain files.
  • Keep dependencies, SDKs and the backend updated; old libraries are a common way in.
  • Test before launch with a checklist, and plan how you will respond if something goes wrong.

Why Does Mobile App Security Matter for Small Businesses?

Because a single leak of customer phone numbers, addresses or payment details can damage trust far more than a slow screen or a missing feature. Small businesses are often targeted precisely because attackers expect fewer defenses.

In Afghanistan, many apps handle exactly the kind of data people worry about: student records, delivery addresses, mobile money references and personal phone numbers that double as WhatsApp accounts. For the Afghan diaspora in Europe, North America and Australia, data protection laws such as the GDPR in the EU also apply if you serve customers there. Building security in from the start is far cheaper than retrofitting it after an incident. If you are still at the planning stage, our mobile app development guide for Afghanistan explains how security fits into the overall project.

What Are the Most Common Mobile App Security Mistakes?

The most common mistakes are trusting the app too much and protecting the server too little. The app runs on a device you do not control, so assume a determined person can read its code and change its behavior.

  • Hard-coded secrets: API keys, admin passwords or payment keys placed in the app bundle can be pulled out with free tools within minutes.
  • Insecure local storage: saving login tokens or personal data in plain preference files or unencrypted databases.
  • Weak authentication: no rate limiting on login or one-time-code screens, long-lived tokens that never expire, or password reset flows that can be abused.
  • APIs that trust the client: the server accepts whatever user ID or price the app sends without checking permissions.
  • Outdated third-party SDKs: analytics, ad or chat libraries that have not been updated in years.
  • Verbose logs: printing tokens, phone numbers or full API responses to logs that end up on the device or in crash reports.

How Do You Secure Logins and User Accounts?

Secure logins rely on short-lived access tokens, refresh tokens stored safely, and server-side checks on every request. Here is a practical baseline:

  1. Use a proven authentication service or framework rather than writing your own password handling.
  2. Hash passwords on the server with a modern algorithm; never store or send them in plain text.
  3. Issue short-lived access tokens and rotate refresh tokens; revoke them on logout and password change.
  4. Store tokens only in the iOS Keychain or Android Keystore-backed storage.
  5. Add rate limiting and lockouts to login and SMS or WhatsApp one-time-code endpoints to stop brute force and SMS cost abuse.
  6. Offer passkeys or biometric unlock where it fits, but keep the real authorization decision on the server.
  7. Log security events (failed logins, password resets) on the server so you can spot unusual activity.

How Should an App Protect Data and APIs?

The app should send everything over HTTPS, store as little as possible on the device, and rely on an API that checks permissions for every single request. Your API is the real front door; the app is only one of many possible clients.

On the server side, validate every input, check that the logged-in user actually owns the record they are asking for, and never trust prices, discounts or roles sent from the app. Use separate keys for development and production, and keep secrets in environment variables or a secrets manager, not in the code repository. If your app connects to payment gateways, SMS providers or a CRM, the integration should run on your backend so that third-party keys never touch the phone. This is the core of how we approach API integration for clients.

On the device, encrypt any local database that holds personal data, clear sensitive screens from the app switcher preview where appropriate, and avoid copying sensitive values to the clipboard. For apps used on shared family phones, which is common in Afghanistan, consider an app-level PIN or biometric lock for sensitive sections.

Does Low Connectivity Change Security?

Yes, slightly: offline-first apps keep more data on the device, so encryption and data minimization become more important. If your app caches orders or student lists for use on weak mobile data, as described in our article on offline-first mobile apps, cache only what is needed, encrypt it, and expire it. Make sure queued actions are re-validated by the server when the connection returns, rather than being accepted blindly.

Mobile App Security Checklist Before Launch

Use this checklist in the final weeks before you publish to Google Play or the App Store:

  1. Search the codebase and build files for any keys, passwords or private URLs.
  2. Confirm all network calls use HTTPS and that certificate validation is not disabled anywhere.
  3. Test the API directly (without the app) to confirm users cannot read or edit other users' data.
  4. Check token expiry, logout and password reset behavior.
  5. Review every third-party SDK: is it needed, is it current, what data does it collect?
  6. Turn on code obfuscation and remove debug menus and test accounts from release builds.
  7. Fill in the Google Play Data safety form and Apple privacy details accurately.
  8. Set up crash reporting that does not capture personal data.
  9. Write a short incident plan: who gets alerted, how you revoke keys, how you notify users.

After launch, schedule regular updates. Mobile operating systems, store policies and libraries change every year, and an app that is not maintained slowly becomes less secure even if no one touches the code. The same thinking applies to your website; see our website security checklist.

Work With Sheen

Sheen designs and builds mobile apps with security planned from the first sprint, from secure login and encrypted storage to protected APIs. See our mobile app development service, or book a call to review your app idea or an existing app. You can also reach us at info@sheen.af or +93 784 966 018.


Frequently Asked Questions

Can someone really extract API keys from my app?

Yes. Android and iOS app packages can be downloaded and decompiled with freely available tools, and strings such as API keys are usually easy to find even when the code is obfuscated. Obfuscation only slows people down. The safe approach is to keep secret keys on your server, have the app call your own API, and give the app only limited, revocable tokens tied to the logged-in user.

Is HTTPS enough to secure a mobile app?

No. HTTPS protects data while it travels between the phone and your server, which is essential, but it does nothing if your API lets one user read another user's records, if tokens never expire, or if sensitive data sits unencrypted on the device. Think of HTTPS as the minimum requirement, then add proper authentication, permission checks on every request and careful local storage.

How often should a mobile app get security updates?

Plan a maintenance release at least every few months, and act immediately when a library you use announces a serious vulnerability. Google and Apple also raise their minimum SDK and policy requirements regularly, so apps that are not updated can eventually be hidden or blocked from new installs. Backend servers and dependencies need the same regular patching schedule as the app itself.

Do small apps need a professional security test?

Not every app needs a full penetration test, but every app should be reviewed against a security checklist before launch. If your app handles payments, health information, children's data or large numbers of users, an independent review is worth the cost. For simpler apps, a careful internal review of authentication, API permissions, storage and third-party SDKs covers most of the real risks.


Keep reading

Read More