JANUS: Agentic Cross-Language Fuzzing Harness Generation for Android Native Libraries
In the authors' words
Modern Android apps extensively rely on native libraries, bridging Java/Kotlin and C/C++ through the Java Native Interface (JNI). This cross-language interoperation, however, exposes the memory-safe Android Runtime to the unsafe C/C++ world, creating an attack surface that has been repeatedly exploited for full device compromise. While fuzzing is a proven technique for vetting native libraries, state-of-the-art harness generation tools struggle to faithfully capture closed-source cross-language API usage: (i) precise program analysis across the JNI boundary does not scale, whereas lightweight approximations miss critical invocation patterns; and (ii) none tackles the construction of complex composite objects consumed by JNI methods. In this paper, we propose JANUS, the first agentic approach to synthesizing cross-language JNI-aware fuzzing harnesses for Android native libraries. JANUS iteratively resolves both explicit and implicit cross-language call dependencies to recover app-specific runtime context, and recursively assembles cross-language argument objects in a bottom-up manner. JANUS leverages an autonomous agentic workflow to reduce reliance on hand-crafted heuristics, capturing the vast landscape of hidden API usage knowledge embedded in closed-source native libraries. Evaluation on 44 popular real-world apps (such as Google and YouTube Music, covering 21,386 JNI methods total) shows that JANUS produces over 5.9 times as many valid harnesses (6,094) as state-of-the-art automatic harnessing tools. On pre-installed apps from five mainstream Android vendors (e.g., Xiaomi, Vivo, Samsung), JANUS further uncovers 6 previously unknown vulnerabilities in closed-source native libraries.
In plain words AI summary
Android apps use native libraries that connect Java code to C/C++ code, creating security risks. Existing tools struggle to automatically create test programs for these libraries because they cannot fully capture how apps use them. JANUS is a new automated system that builds test programs by figuring out dependencies and assembling complex objects step by step. It uses an autonomous agent to learn hidden usage patterns without relying on manually written rules. On 44 real apps, JANUS created over 5.9 times more valid test programs than prior tools, and found 6 new vulnerabilities in vendor apps.
Written by Kimi K2.5 using only the abstract above. Jev checked that every sentence is supported by the abstract sentences it cites, and removed any that were not. Point at a sentence to highlight its source.
Appeared: Friday, October 23. arXiv. Preprint, not yet peer-reviewed.
Authors' comment: Harness Generation, Android Native Libraries, LLM Agent