r/FlutterDev • u/ScaryDev • Sep 01 '26
Article Code injection via .arb translation files in flutter gen-l10n; check your CI and automated translation pipeline
I just discovered an issue in Flutter that may compromise your app: you can literally write Dart code in your translation files and have it execute in production.
flutter gen-l10n validates ARB resource names but not the placeholder type field, which gets dropped straight into generated Dart. A crafted type string injects arbitrary code that compiles clean and runs when the localization is called.
Not a big deal if your .arb changes get reviewed like code, but plenty of teams auto-merge translations from CI or a third-party tool with nobody reading them, and that's where it gets dangerous: a hacked translation account, a malicious translator, or a compromised vendor can inject code into .arb files that runs in your production app.
It's rare, but it can easily turn into a supply chain attack.
for example:
{
"@@locale": "en",
"greeting": "Hello {user}",
"@greeting": {
"placeholders": {
"user": {
"type": "Object user) { print('>>> ARBITRARY DART EXECUTED FROM A TRANSLATION FILE <<<'); return 'pwned'; } String injectedByTranslation(Object"
}
}
}
}The print will be executed normally.
Full explanation: https://badranh1.medium.com/a-translation-file-can-hack-your-flutter-app-google-says-thats-not-a-vulnerability-ae175473acd3
EDIT: The issue is reported to Google, but it was closed without a fix as they believe it poses no security risk, that is why I am posting it publicly, a nice to know.