flutter/flutter

5 real CVE-2021-42574 / Trojan-Source violations in docs/releases/archive/ — caught by oss-baseline's no_bidi_controls rule, missed by every other tool in the pipeline.

Narrative
Polyglot wins
Rules
68
Last revalidated
Engineering reference
README on GitHub · .alint.yml

Why this matters

flutter/flutter is the flagship “platform-driven polyglot monorepo” in the corpus — a single tree where the framework itself is Dart, but every native-OS embedder (Android, iOS, macOS, Linux, Windows, Fuchsia, GLFW desktop, the cross-platform “embedder” ABI) lives as a peer subdirectory under engine/src/flutter/shell/platform/, each implementing the same surface (PlatformView, ExternalTexture, KeyEventHandler, VsyncWaiter, PlatformMessageHandler, AccessibilityBridge) in the language native to that OS:

Where apache/arrow is the data-format-driven polyglot (one schema, six per-language readers), flutter is the platform-driven polyglot (one framework, six per-OS embedders).

Concrete polyglot density in the in-scope tree:

No per-platform IDE / linter sees the cross-platform conventions: Android Studio sees android/, Xcode sees darwin/{ios,macos}/, MSVC sees windows/, but no one tool sees them as peers.

Headline catch

Running the alint config against the live tree surfaces 5 real Trojan-Source / CVE-2021-42574 errors in docs/about/Values.md and 4 archived release-notes files under docs/releases/archive/, caught by oss-baseline’s no_bidi_controls rule. Flutter ships these with embedded bidi controls in contributor names / commit messages; alint surfaces them at PR time.

This is the strongest single “alint catches things other tools miss” data point in the case-study corpus. The bidi controls slip past every per-language linter (Dart analyzer, clang-format, clang-tidy, eslint, gofmt, etc.) because they’re embedded in markdown text content, not source code; they slip past markdown linters because the controls are valid Unicode and don’t break rendering. alint’s no_bidi_controls rule, shipped in the oss-baseline@v1 ruleset by default, catches them across the whole repo in one pass.

CVE-2021-42574 (Trojan Source) is the 2021-disclosed attack class where bidirectional text controls let attackers visually conceal malicious code in commits — exactly the threat model where “valid Unicode that no per-language tool flags” is the failure mode. A language-agnostic tool that scans every text file in the repo by default is the only structural defence.

Plus the Apple framework four-file layout (Headers/, Source/, Info.plist, module.modulemap per engine/src/flutter/shell/ platform/darwin/{ios,macos}/framework/) — another invariant no Linux/Windows developer would notice was broken; drift here silently breaks xcodebuild framework targets that external Flutter apps consume.

Where alint earns its keep here

The Flutter-Authors BSD-style header rule across 5 native languages + Dart is the cleanest single-rule polyglot demo in the catalogue — one regex, ~9,000 source files across 6 languages, one alint pass. The engine subtree’s format.sh enforces this on engine/src/flutter/ only; alint extends the same gate to the framework subtree (packages/, dev/, examples/) where it’s currently enforced only by review discipline.

Per-platform structural invariants checked once across the entire polyglot tree:

flutter is the fifth independent demand signal for cross_language_implementation_complete (now v0.11+ ship-target, saturated at 5 sources: arrow + TF + protobuf + angular + flutter) and the first platform-driven source — distinct from the data-format-driven variant that arrow + tensorflow demonstrate. The shape generalises to every cross-platform UI framework with per-OS native embedders (React Native, Xamarin/MAUI, Qt, Tauri).

flutter also surfaces:

Future story angles

The factual engineering writeup (tooling inventory, mapping table, gap catalogue, validation status footer) lives in the public alint repo at github.com/asamarts/alint/tree/main/examples/flutter-flutter/README.md.