Repository navigation
Description
As part of the work we are doing to better secure FlutterActivity and FlutterFragment against attacks via setting engine flags via Intent extras, we are removing the ability to set engine flags on Android via Intents entirely. See below for details.
The problem this solves
As described in #172553, malicious actors can take advantage of the Intent extras mechanism for setting engine flags on Android by using flag vulnerabilities to run malicious code. For example, attackers could specify a malicious path for the --aot-shared-library-name= flag that allows for the running of native C code; see go/flutter-fragment-flag-security-analysis for analysis of this specific case. Though not all engine flags are open to this vulnerability, this design pattern is dangerous and gives leeway to security vulnerabilities to Flutter Android apps, especially those in release mode (production).
The solution
In order to combat this, we are removing support for setting flags via Intents entirely, which means that flags can no longer be set dynamically. Instead, Flutter developers will have to used one of the following more secure mechanisms:
- Statically in the manifest (
AndroidManifest.xml) - Via the command line
Steps involved in removing Intent support
- Add the ability to set engine flags via the manifest (done in [Android] Add mechanism for setting Android engine flags via Android manifest (take 2) #181632)
- Remove the Flutter tool's reliance on
Intentextras to pass engine flags to the embedding (see go/flutter-android-no-more-intents for design discussion) - Remove support for setting flags via
Intents entirely (will likely require better warnings and a migration guide on the website)
Outstanding concerns
We recognize that adding the ability to set engine flags via the manifest may add additional startup time to apps due to the newly introduced parsing of the manifest, but ultimately, we think that the security benefit of preventing attacks via running arbitrary code outweigh that extra startup time.
Part of #172553.
Activity
camsim99 commentedon Feb 5, 2026
Discussed this offline but wanted to paste here an opposing argument to this work in debug mode so we remember why the decision to move forward with work on this issue:
Opposing argument to doing this in debug mode
We should allow arguments to be set via
Intentin debug mode because otherwise, we are breaking the debug workflow using ADB of installing a pre-built APK to a device for testing over and over while changing the flags but not rebuilding the APK itself (whichflutter runrequires).Why I think we should also do this in debug mode
I am concerned about breaking the workflow but given this same workflow can be done using
flutter run --use-application-binary=<path/to/app.apk>, I would only be ok breaking it if the workflow is not common. This is because otherwise, we would have to leave the path of setting flags viaIntents in the code which is definitively less secure than take it out completely as I planned.Ultimately, I’m deciding to move forward with removing the
Intentpath entirely because I do not see proof that this workflow is common. I took a chance to go through all issues mentioning the launching Flutter apps via ADB workflow and did some Google searching, and I found that the primary use case by far for the workflow is testing deep links, which my work really would not impact.[Android] Add mechanism for setting Android engine flags via Android …
[Android] Add mechanism for setting Android engine flags via Android …
[Android] Add mechanism for setting Android engine flags via Android …
[Android] Add mechanism for setting Android engine flags via Android …
Reland "[Android] Add mechanism for setting Android engine flags via …
[Android] Add mechanism for setting Android engine flags via Android …
Reland "[Android] Add mechanism for setting Android engine flags via …
Reland "[Android] Add mechanism for setting Android engine flags via …
[Android] Propagate --enable-flutter-gpu Intent extra to engine args (f…
camsim99 commentedon Aug 3, 2026
Closing in favor of #190461. See that issues for details on the pivot!
revert(messaging,android): drop shell args persistence in favour of m…
docs(messaging): document Android background isolate engine flags
fix(messaging,android): fix an issue that could cause duplicate call …
github-actions commentedon Aug 17, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.