Open-sourcing Mariana Trench: Analyzing Android and Java app security in depth
Mariana Trench is Meta's open-sourced static taint-analysis tool for Android and Java apps that finds security and privacy bugs by tracing data flows from sources (e.g., Intent.getData) to sinks (e.g., Log.w, Runtime.exec). It computes per-method models via abstract interpretation and lets security engineers write rules such as user-controlled input reaching an intent-redirection sink. Rules are refined until high-signal and then run on every pull request. Meta deliberately tolerates more false positives to catch rare exploitable edge cases, and triages results with SAPP, a post-processor that groups similar traces and visualizes source-to-sink paths. Mobile apps get this extra pre-release scrutiny because fixes depend on users installing updates.
Related posts
- An open source compositional deadlock detector for Android Java
Meta Engineering hardMasterMeta built a compositional static analyzer, now part of the open source Infer framework, that detects deadlocks in Android Java code without running it. Using abstract interpretation, it summarizes each method once in terms of "critical pairs": which lock it acquires while already holding a given set of locks, plus whether it runs on the main or a background thread. To scale to codebases with hundreds of millions of lines, it analyzes only the methods in a revision's modified files, then uses a heuristic to find outside methods that could deadlock with them. Deployed in CI on every commit to Meta's Android apps, it has led to over 200 fixes at about a 54% fix rate, and the analysis is proven sound and complete for an abstract language with non-deterministic control.
- Building secure mobile apps in the agentic era
Shopify Engineering mediumAdeptShopify keeps pace with an 11x jump in mobile code output (~434k lines changed per week during a 12-week agent-driven rewrite) by maintaining a per-app attack surface map covering deep links, WebViews, stored data, permissions and dependencies, where every item carries one of five verdicts and a code link. Each surface has a reusable agent skill built from OWASP MASVS/MASTG plus lessons from past incidents and HackerOne reports. The skill first inventories every item and then has the model review one item at a time with only the relevant code, which keeps findings specific and verifiable. A weekday pipeline (prepare, review, publish) diffs the map against the last accepted version and validates model output, while agents also read security news and alert the team only when something affects the apps.
- Exploiting vulnerabilities in Cellebrite UFED and Physical Analyzer from an app's perspective
Signal easyNovice
Cellebrite's UFED and Physical Analyzer, whose main job is parsing untrusted app data pulled from seized phones, lack standard exploit mitigations and bundle FFmpeg DLLs from 2012 that miss over a hundred security fixes. A specially formatted file placed in any app on a scanned device can run arbitrary code on the Cellebrite machine. That code could silently alter past and future forensic reports without timestamp or checksum changes. The software also appears to redistribute Apple-signed iTunes DLLs without a license, and Signal hints that future versions will place such files in app storage.
- Protecting user data through source code analysis at scale
Meta Engineering mediumAdeptMeta's Anti-Scraping team encodes known scraping attack vectors as taint-analysis rules in its in-house static analyzers, Zoncolan for Hack and Pysa for Python, so potential vectors are flagged before code ships. Rules define sources (user-controlled parameters such as a result count or target ID) and sinks (data returned to the user), and a possible flow between them is raised as an issue for triage. In a mock followers endpoint, an uncapped count lets scrapers pull entire follower lists in one request and slip past rate limiting. The fix clamps count to a maximum, forcing scrapers into many more requests that rate limits then catch. Static analysis cannot catch scrapers that mimic legitimate usage, so it is one part of a broader defense.
- Retrofitting null-safety onto Java at Meta
Meta Engineering mediumAdeptNullsafe is a static analyzer built at Meta to catch NullPointerExceptions in Java, implemented as an extra compiler pass via the JSR-199 compiler API. It runs flow-sensitive nullness type inference over a control flow graph, then type checks the AST against those results, with added support for nullness in generics despite complications from Java's target typing. A three-tier model (Nullsafe-compliant, optimistically checked first-party code, pessimistically checked third-party code) allowed gradual adoption across millions of lines of legacy code. On Instagram, production NPE crashes fell 27% over 18 months of code transformation.