Platforms

Flutter app security: what the framework does and what’s missing

Flutter security capabilities, additional controls and criteria for assessing runtime protection on Android and iOS.

Updated

Scope of Flutter security

Flutter lets you write a single app for Android and iOS in the Dart language. That advantage has a security consequence: many recommendations written for native apps do not apply as-is, and some widespread ideas about Flutter are simply wrong.

This guide covers what the framework does for you, what it does not and which decisions are yours to make. Everything we say about Flutter comes from its official documentation; the sources are at the end.

How a Flutter app is compiled

In release mode, your app’s Dart code is not interpreted: it is compiled ahead of time (AOT) to native machine code, on both Android and iOS. On Android, that compiled code is packaged into a library called libapp.so; on iOS, into a framework called App.framework.

This can be read two ways:

  • The good part. Anyone trying to understand your logic is not looking at a readable file but at machine code. Analyzing it takes more effort and different tools.
  • What does not change. More effort is not impossibility. Given time, that code can be studied and modified. And since all of your app’s logic lives in that binary, it is a natural target for anyone who wants to alter it.

There is another practical consequence: because the Dart logic lives in a native library, protections that only look at the Java or Kotlin code of an Android app miss the core of a Flutter app.

The official obfuscation: what it does and what it doesn’t

Flutter includes an obfuscation option that you enable when building with --obfuscate together with --split-debug-info, which tells it where to store the symbols. It only works in release builds and is not available for the web.

What it does. It renames the symbols in the compiled Dart code: class, function and variable names stop being descriptive. That makes it more tedious to work out what each part does.

What it doesn’t do. Flutter’s own documentation is clear: obfuscation only renames symbols; it does not encrypt resources or protect against reverse engineering. It does not obfuscate enum names either. Your images, configuration files and strings are still there, readable.

What it costs. Once you obfuscate, stack traces are no longer readable. To interpret them you need the symbol files generated by that build, so you have to keep them for every version you ship. If you lose them, debugging a production crash becomes much harder.

Our recommendation: turn on obfuscation for your production builds, store the symbols carefully and do not mistake it for protection. It is a layer that raises the cost of static analysis, nothing more.

Credential management

Flutter’s documentation says it explicitly: storing secrets in the app’s code is bad practice. No amount of obfuscation changes that.

If your app needs a key to talk to an external service, that key can be extracted from the binary. The alternatives are well known:

  • move the call to the external service to your backend, which keeps the key;
  • issue short-lived credentials from your server, bound to the user or the device;
  • require an attestation proof before handing out any sensitive credential.

And if a key has already shipped inside a published version of your app, assume it is exposed and rotate it: there is no way to pull it back from the phones where it is already installed.

Secure storage on the device

For data that does need to stay on the phone, such as a session token, Flutter has no built-in solution. The usual approach is to use community packages that store the information in each platform’s secure stores: the Keychain on iOS and the Keystore on Android.

Two caveats:

  • Those packages are not official Flutter packages. They are published by third parties. Check who maintains them, how often they are updated and how they configure each platform.
  • Secure storage protects data at rest, not in use. On a rooted phone, or with a tool injected into your app, the data can be read at the moment your app uses it. That is where runtime protection comes in.

Keep the framework up to date

Flutter’s security guidance insists on something unglamorous but essential: keep the SDK and your dependencies up to date. Only the stable channel receives security patches, and staying on an old version, or on a modified copy of the framework, leaves you without them.

Make updating a recurring task, not something you do when there is time.

Controls beyond the framework

Flutter decides how your app is built, but it does not change the phone it runs on. A Flutter app faces exactly the same threats as a native one:

  • Rooted or jailbroken phones, where the system no longer guarantees that your files and memory are private.
  • Instrumentation tools that inject themselves into the process and change what your app does while it runs. To them it makes no difference whether the logic was written in Dart, Kotlin or Swift: it all ends up as native code in memory.
  • Re-signed copies of your app, with the Dart binary modified to skip a payment or a check.
  • Emulators used to study your app or automate fraud at scale.

None of that is solved by the framework, nor does it claim to be: it is not its job. Obfuscation raises the cost of reading your code; secure storage protects data at rest. Detecting and responding to a hostile environment while the app runs is a separate layer, and you have to add it.

Criteria for evaluating RASP protection

Assess coverage per operating system, application compatibility and response behavior. Shared Flutter code does not eliminate security differences between Android and iOS. Evaluate the builds and devices that will be used in production.

Pulse scope

Pulse provides Flutter integration with risk-signal detection on Android and iOS, policy management and security reports. Coverage is assessed per platform and SDK version.

Response flows must be integrated and tested in the application: a notification does not by itself restrict a business operation. Validation should include navigation, startup, resumption and the devices used by your users.

Pulse does not obfuscate Dart code or replace credential management or backend controls. Review the integration requirements before defining the evaluation scope.

Checklist for your Flutter app

  • Build production with --obfuscate and --split-debug-info, and keep the symbols for every version.
  • Keep secrets out of the app; move them to your backend.
  • Use a well-maintained secure storage package for tokens.
  • Keep the Flutter SDK and your dependencies on the stable channel and up to date.
  • Add runtime protection built on native code.
  • Decide what your app does when it detects a hostile environment: record, alert or close.
  • Validate an attestation proof on your server for sensitive operations.

Sources

Evaluate Pulse for your application

Discuss coverage, integration requirements and deployment options with our team.

Request an evaluation