Skip to content

JANUS: Using agents to generate cross-language fuzzing harnesses for Android native librariesJANUS: Agentic Cross-Language Fuzzing Harness Generation for Android Native Libraries

arXiv· arXiv:2610.30218· Xiangyu Zhang, Yucheng Su, Lingling Fan, Yinan Li, Sen ChenNankai University; Zhongguancun Academy; Xiaohongshu Inc.Indexed by this site · 2026-10-23· Originally publishedAttacks

Quick read

Other

Based on the paper PDF (AI-generated); refer to the original

The authors propose Janus, which uses an LLM agent to generate JNI fuzzing harnesses for Android closed-source native libraries; on Poirot-44 the number of runnable harnesses is 7.4×/5.9× that of Atlas++/Poirot, and it discovers 6 unknown vulnerabilities in vendor preinstalled apps.

Questions
Android apps call C/C++ native libraries via JNI, exposing the memory-safe ART to unsafe native code and forming a repeatedly exploited attack surface. Existing harness generation tools struggle to recover cross-language API usage of closed-source apps and cannot construct the complex composite objects required by JNI methods.
Methods
Janus delegates harness synthesis to an LLM agent workflow: a cross-language parser builds a JNI binding table, a structure-aware retriever lets the agent query the code, a dependency-driven algorithm iteratively completes prerequisite call sequences, a recursive constructor assembles parameter objects bottom-up, and template- and validation-guided iterative repair produces the harness.
Experiments and results
On Poirot-44 (44 apps, 21,386 JNI methods), Janus generates 6,094 runnable harnesses, which is 7.4×/5.9× that of Atlas++/Poirot, with average coverage 16.9% (baselines 2.9%/2.6%); on Vendor-20 it confirms 6 unknown vulnerabilities, none of which were found by either baseline.
Limitations and future work
The authors point out that Janus is based on a linear execution model and may not be able to satisfy state dependencies established asynchronously/concurrently, nor does it model deep interaction with Android system services (such as Binder); the evaluation covers only two categories, ordinary commercial apps and vendor preinstalled apps, and the authors say other categories of apps are left for future work.
Experimental setupGLM-5、Claude Opus 4.5 et al. · Poirot-44、Vendor-20 · #Build、#Run et al.
Threat model
The goal is to discover memory corruption vulnerabilities in Android closed-source native libraries: native libraries share the address space and privileges of the host process, and their memory defects can be used for full device compromise. Janus is a defensive auditing tool that takes an APK as input, synthesizes fuzzing harnesses for JNI methods, and tests them with AFL++; the paper does not define assumptions about attacker knowledge or capability.
Evaluated models
GLM-5Claude Opus 4.5GPT-5.2DeepSeek-V3.2Kimi-K2.5Qwen-3.5
Benchmarks
Poirot-44Vendor-20
Metrics
#Build#RunCov (AFL++ bitmap coverage)#Crashes
AI summaryJANUS is the first to use agents to generate cross-language fuzzing harnesses for Android native libraries. On 44 popular apps (21,386 JNI methods in total), it generated 6,094 valid harnesses, more than 5.9 times that of the existing best-performing tool. In the closed-source native libraries of preinstalled apps from five major vendors including Xiaomi, Vivo, and Samsung, it also found 6 previously unknown vulnerabilities.

JANUS is the first to use agents to generate cross-language fuzzing harnesses for Android native libraries. On 44 popular apps (21,386 JNI methods in total), it generated 6,094 valid harnesses, more than 5.9 times that of the existing best-performing tool. In the closed-source native libraries of preinstalled apps from five major vendors including Xiaomi, Vivo, and Samsung, it also found 6 previously unknown vulnerabilities.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    Automatically generate JNI-aware fuzzing harnesses for Android closed-source native libraries to audit the cross-language attack surface.

    How to automatically generate fuzzing harnesses for Android closed-source native libraries that can effectively execute JNI methods, thereby auditing the cross-language memory-corruption attack surface at scale.

    • Problem setting and importance: Android apps call C/C++ native libraries from Java/Kotlin via JNI; native libraries share the address space and privileges of the host process but are not protected by ART memory safety. The authors state that this attack surface has been exploited by LANDFALL spyware and Google Project Zero's Pixel 10 0-click chain.
    • Shortcomings of existing methods: The authors state that Atlas's cross-language symbolic execution cannot scale to commercial apps due to path explosion (only 51% directly usable on its dataset of 17 vendor apps); Poirot performs only lightweight analysis on the Java side, with degraded precision (only 49.5% effective on about 4K apps). Both struggle to capture cross-language API usage knowledge and cannot construct complex composite parameter objects.
    • Core challenges: C1, reconstructing cross-language call sequences requires app-specific runtime context; missing or out-of-order explicit and implicit dependencies lead to silent failures or shallow execution; C2, JNI methods often accept nested composite objects whose construction logic cannot be inferred from type signatures and must be assembled from scratch on the native side using reflective JNI functions.
    • What the paper proposes: Janus, which the authors describe as the first agentic harness synthesis method for JNI fuzzing of Android native libraries, using LLM agents to iteratively resolve dependencies and recursively construct parameters, reducing reliance on manual heuristic rules.
    • Threat model:
      • Goal: discover memory-corruption vulnerabilities in closed-source native libraries that can be triggered by external input (defensive auditing).
      • Victim system: Android apps carrying closed-source native libraries, including vendor preinstalled apps running with system privileges.
      • Attacker capability: in the case studies, the paper states that vulnerabilities can be triggered remotely via messages, downloads, or web links, or locally via an exported activity without permissions; no formal attacker model is given.
      • Tool input: only the APK file, no source code required.
  2. What related research exists?

    Related work falls into three categories: automatic harness generation, Android/JNI vulnerability detection, and cross-language program analysis; the baselines are Atlas++ and Poirot.

    Automatic harness generation

    • OGHarn (2025) stitches candidate C-API harnesses based on header files and filters mutations; SnakeCharmer (2026) targets Python↔C/C++ mixed libraries to recover interface types and exception semantics.
    • LLM-driven harness synthesis: source-level pipelines such as LLM4FDG and CKGFuzzer, and the agentic HarnessAgent (2025). The paper notes that these works target open-source C/C++ projects and do not address the two cross-language difficulties of closed-source Android native libraries: Java-host-driven prerequisite calls and state binding, and jobject parameters that require finding construction paths on the Java side and recursively assembling them according to field accesses on the native side.

    Android/JNI vulnerability detection

    • FANS (2020) synthesizes harnesses from Android system service source code but assumes source code is available; JNIFuzzer (2020) fuzzes JNI methods but lacks Java-side context modeling; NativeSummary (2024) extracts JNI summaries for information-flow tracking rather than memory corruption.
    • Atlas (2024) and Poirot (2025) are the closest systems, both using static program analysis to infer app-specific JNI usage. The paper states that both are constrained by the precision-scalability trade-off and neither recovers construction knowledge for complex composite objects.

    Cross-language program analysis

    • JN-SAF (2018) and NDroid (2018) track cross-language data flow and taint flow; JuCify (2022) unifies Java and native intermediate representations to build a cross-language call graph; AXA (2024) and Confluence (2025) are general JNI analysis frameworks.
    • The paper notes that such analyzers cannot be directly used for harness synthesis: they focus on structural reachability or information flow rather than generating executable driver code; AXA relies on an analyzer designed for standard Java bytecode and does not fit Android DEX; heavyweight call-graph construction often times out or produces empty results on large obfuscated apps.

    Baselines and benchmarks: the comparison baselines are Atlas++ (an open-source improved reimplementation of Atlas, released April 2026; the original Atlas is not public) and Poirot; the datasets are Poirot-44 (44 Google Play apps, 21,386 JNI methods) and the self-built Vendor-20 (20 preinstalled apps from 4 vendors).

    The authors position Janus as replacing manual heuristic rules with an agentic workflow to mitigate the precision-scalability trade-off inherent in the above static analysis methods.

  3. How does the paper address this problem?

    Janus synthesizes harnesses in three stages with an LLM agent workflow: cross-language parsing, dependency-driven synthesis, and verification-guided repair.

    Janus takes an APK as input, splits it into DEX bytecode and .so native libraries, and through three stages—Cross-Language Parser, Harness Synthesizer, Feedback-Driven Harness Refiner—produces a runnable AFL++ harness (Figure 3). The entire pipeline is built on the OpenCode agent, the algorithms are encoded as OpenCode Skills, and the main model is GLM-5.

    Cross-Language Parsing (Phase 1)

    • Java-side parsing: Extract the signature of each class and method, the owning class, parameter and return types, and inter-method call relationships.
    • Native-side parsing: Extract function bodies and their implicit constraints on input parameters (such as validity checks on file descriptors or object fields).
    • JNI binding table: Resolve the runtime address of each native method on the device via ART, covering both dlsym static registration and RegisterNatives dynamic registration (hooking), recording the Java signature, parameter and return types, the owning .so, and the relative offset.

    Harness Synthesizer (Phase 2)

    • Structure-aware code retriever: Implements a JNI-aware cross-language Language Server, connecting the symbol indexes of jdtls (Java) and clangd (native) with the JNI binding table into a unified symbol table, supporting bidirectional cross-boundary queries; it also defines two sets of AST-Grep templates to capture Java-side native declarations and object propagation paths, and native-side JNI field accesses, with matches returned as ⟨location, symbol information, code snippet⟩ triples.
    • Dependency-driven call sequence extraction: Distinguishes explicit dependencies (which can be fully established on the Java side, such as constructing objects and assigning fields) from implicit dependencies (which must be established on the native side by prerequisite JNI calls, such as global state and written-back C pointers). The goal is formalized as: given a target method m and an unmet dependency set Dm, construct a prerequisite call sequence Sm and annotation set Am such that Dm ⊆ Resolution(Sm, Am), i.e., the dependencies that the current sequence can establish cover all identified dependencies. Algorithm 1 iterates driven by unmet dependencies: generate query→retrieve code→propose candidate calls→insert and annotate→check from an audit perspective whether resolved→fail if budget exhausted; after resolution, perform a global review checking call order, dependency consistency, and binding relationships.
    • Recursive parameter constructor: Algorithm 2 first tries to resolve a parameter type τ directly (leaf types already bound in Am that can be synthesized directly, such as primitive types and String, or a hit in the memory bank); otherwise it enumerates candidate construction paths (constructors, factory methods, in-app instantiation points), and the agent selects a path based on "how it is instantiated in the app" and "coverage of fields read on the native side", recursively constructing each sub-parameter type and backtracking on failure; finally it emits reflective calls such as FindClass/GetMethodID/NewObject to assemble the object, and after passing local checks (symbol existence + smoke test) writes it to the memory bank.
    • Harness memory manager: Persists verified call sequences and construction schemes along with their metadata, and subsequent methods preferentially reuse compatible components; if a reused component fails downstream verification, it is bypassed for the current target but the entry is kept for use by other methods.

    Feedback-Driven Harness Refiner (Phase 3)

    • Application-specific harness template: Fixes the execution skeleton and the topological order of each functional section, and the agent only fills in designated slots, constraining the generation space.
    • Verification-guided iterative repair: Verifies with three types of signals—compilation diagnostics, runtime exceptions, and coverage feedback. Using Frida edge instrumentation, a harness is considered valid only if under mutation trial inputs it hits the target entry address and covers new branches after the function prologue, replacing the "no crash means success" self-assessment. After failure attribution, it routes: malformed code goes back to Phase 3 to resynthesize the slot; parameter state or prerequisite dependency issues go back to Phase 2 to fix the construction scheme or call sequence.

    Implementation

    • The algorithms are encoded as OpenCode Skills, specifying task goals, inputs and outputs, tool scope, execution steps, decision criteria, and verification and termination conditions; project-level orchestration instructions are written in src/AGENTS.md.
    • Experimental environment: Mac Studio (M3 Ultra, 512 GB RAM); Android Emulator API 31 (4 cores, 6 GB RAM); Quarkslab's ART emulation scheme + Frida-driven AFL++.
  4. What experiments did the paper conduct?

    Compared with Atlas++/Poirot on Poirot-44 and Vendor-20, including ablation, backbone model comparison, manual crash verification, and confirmation of 6 vulnerabilities.

    Experimental Setup

    • Systems under test: Janus (GLM-5 as backbone, temperature 0, 3 independent runs per JNI target averaged); baselines are Atlas++ and Poirot (rerun as-is with their official Docker images).
    • Datasets: Poirot-44, 44 Google Play apps with a total of 21,386 JNI methods, of which 16 apps have over 500 million downloads; following Poirot's convention, after excluding methods with no call sites, 7,453 targets remain. Vendor-20, 20 preinstalled apps extracted from the latest flagship phones of Xiaomi, Vivo, OnePlus, and OPPO (all running the February 5, 2026 security patch), with 11,172 JNI methods extracted, leaving 9,327 targets after filtering.
    • Metrics: #Build (compiled, linked, and packaged successfully), #Run (valid harnesses that initialize the runtime, load the target library, consume input, and produce coverage growth), Cov (AFL++ bitmap coverage, counted only for #Run), #Crashes (unique crashes after AFL deduplication).
    • Budget: 30 minutes for the static analysis phase of each tool, 30 minutes for harness construction per JNI target; each built harness is allocated at most a 4-minute AFL++ verification window (RQ1); in RQ3 each runnable harness has a fuzzing budget of at most 12 hours, terminated early if there is no new branch for 1 hour.
    • Statistical test: paired Wilcoxon, p < 0.05 (notes to Table 1 and Table 2).
    • Manual verification: The 200 highest-coverage crashes on Poirot-44 were manually analyzed by 3 security researchers with over 3 years of experience, each taking 2–18 hours.

    Main Results

    Aggregate results of the three tools on Poirot-44 (according to Table 1, Cov is the per-app mean):

    Swipe horizontally to read the table

    Tool#Build#RunCov (%)#Crashes
    Janus7,2576,09416.95,390
    Atlas++2,1198192.9404
    Poirot1,2741,0342.6905
    • The authors report: of 7,453 targets, Janus built 7,257 (97.4%), of which 6,094 are runnable (84.0% of built), i.e., built is 3.4×/5.7× that of Atlas++/Poirot and runnable is 7.4×/5.9×; crashes are distributed across 35 apps (baselines: 13 and 14).
    • The authors attribute the gains to Janus's ability to capture application-specific cross-language dependencies and complex construction knowledge; the improvements pass the paired Wilcoxon test with p < 0.05.
    • Failure analysis: Of the 1,163 harnesses that failed #Run, 637 eventually succeeded after extending the iteration budget to 2 hours each; the remaining failures fall into three categories: the emulated environment provides only coarse-grained crash signals, the target library depends on external runtime state such as sensors, and the target library contains anti-emulation or integrity checks.

    Ablation Study (RQ2)

    • Setup: Four variants on Poirot-44, each disabling one component and letting the agent handle that stage freely; they also tested out-of-the-box OpenCode+GLM-5 (without the Janus workflow), which failed to produce buildable harnesses and is therefore not included in the quantitative comparison.
    • Results (Figure 5, degradation relative to full Janus): w/o-Retriever lowers #Build by 32.0% and coverage from 16.9% to 10.5%; w/o-CallSeq lowers #Build by only 10.4%, but the run/build ratio drops from 84.0% to 52.3% (the lowest among the variants); w/o-RecArg lowers #Build by only 5.7% and coverage to 9.4%; w/o-Memory is the mildest (#Build down 8.9%, #Run down 16.5%).
    • Authors' interpretation: The retriever is the foundation of the build rate, call sequence extraction is the key link from "buildable" to "runnable", recursive parameter construction determines exploration depth, and memory maintains quality at scale.

    Unknown Vulnerability Discovery (RQ3, Vendor-20)

    • Results: Of 9,327 targets, 8,053 were built (86.3%) and 2,174 are runnable (27.0% of built, which the authors call 7.3×/5.2× that of Atlas++/Poirot); 2,535 raw crashes were deduplicated into 306 groups, and after manual triage 6 vulnerabilities were confirmed (Table 3: 2 in the Vivo theme process, 1 in Xiaomi Theme Manager, 1 in the OnePlus reader, and 1 each in the OPPO reader and video player, with CWE types including CWE-787 out-of-bounds write, CWE-502 deserialization, and CWE-190 integer overflow).
    • Comparison: The authors report that neither Atlas++ nor Poirot found any of these 6 vulnerabilities; 1 OPPO vulnerability has been confirmed by the vendor as a zero-day and a bounty was paid, 2 others have been confirmed and are under investigation, and 3 await triage.
    • Authors' explanation for the low #Run rate: Vendor JNI methods depend on private ROM services or hardware contexts that are not present in the emulator; a large number of thin getter/setter bridge methods have flat coverage and are excluded by the strict #Run check.

    Backbone Model Comparison (§6.1)

    • Setup: 5 apps randomly sampled from Poirot-44 with a total of 225 JNI methods, changing only the underlying LLM and keeping everything else the same.
    • Results (Table 4): DeepSeek-V3.2, Kimi-K2.5, and Qwen-3.5 built 6, 31, and 40 respectively, with 0, 9, and 19 runnable; GLM-5 built 99 with 84 runnable; Claude Opus 4.5 built 104 with 93 runnable (highest on the subset); GPT-5.2 built 102 with 81 runnable. GLM-5's runnable count is 90.3% of Opus 4.5's.
    • Cost: The authors report that on the full Poirot-44, Opus 4.5 costs $7,225.8, about 5.6× that of GLM-5 ($1,292.6); GLM-5 costs about $0.21 per runnable harness.

    Other Ablations and Analyses

    • Manual crash verification (Poirot-44): Of the 200 high-coverage crashes, 46 that do not accept attacker-controlled input were excluded, then 65 false positives were excluded (12 from incorrect call patterns inferred by the LLM, 23 from incorrect code information produced by the decompiler due to obfuscation, and 30 benign exceptions thrown by the target method's own exception handling logic); the remaining 89 were confirmed to have defects, but since the app versions are from 2022, the authors state after verification that these defects have all been fixed in the latest versions.
    • Run cost (RQ1): Each full run consumes 2.57 billion tokens, with an input-to-output ratio of 11.05:1 and a context cache hit rate of 94.7%.
  5. What are some points that can be further explored?

    The authors list two limitations: asynchronous/concurrent dependencies and system service interaction; the evaluation covers two types of apps and six backbone models.

    Limitations and future directions noted by the authors

    • Concurrency and asynchronous dependencies (§6.2.1): Janus is based on a linear execution model and may fail to satisfy state dependencies established by asynchronous calls (e.g., coroutines), and may miss concurrency-related vulnerabilities in highly parallel native libraries.
    • Framework and system service interaction (§6.2.1): Janus models only in-app JNI call paths and does not consider deep interaction with the Android system (e.g., Binder); it may fail to generate harnesses for native libraries that heavily depend on such system interaction.
    • Evaluation generalizability (§6.2.2): Poirot-44 represents only commercial apps with ordinary user permissions, and Vendor-20 consists of vendor preinstalled apps with system permissions; the authors state that other categories of Android apps may still be uncovered and leave broader-spectrum evaluation to future work.

    Scope of the experiments

    • The tools under test are Janus, Atlas++, and Poirot; the original Atlas is not public, so the comparison uses its open-source reimplementation Atlas++.
    • The datasets are Poirot-44 (44 apps, 21,386 JNI methods, 7,453 targets after filtering) and Vendor-20 (20 preinstalled apps, 9,327 targets).
    • The backbone model comparison is conducted on 5 sampled apps and 225 JNI methods, covering 6 models: DeepSeek-V3.2, Kimi-K2.5, Qwen-3.5, GLM-5, GPT-5.2, and Claude Opus 4.5; the full evaluation uses only GLM-5.
    • Janus results are the mean of 3 independent runs with temperature fixed at 0; the paper does not report the number of repeated runs for the baseline tools.
    • Manual verification covers 200 crashes on Poirot-44 and 306 deduplicated crash groups on Vendor-20; the paper does not report inter-analyst agreement metrics.
  6. Summarize the main content of the paper

    Janus uses an LLM agent to synthesize JNI fuzzing harnesses, with a runnable count 7.4×/5.9× the baselines, and discovers 6 unknown vulnerabilities.

    Janus is an agentic JNI fuzzing harness generation method for Android closed-source native libraries, and the authors call it the first agentic method in this direction.

    • Problem to solve: Native libraries expose the memory-safe ART to unsafe C/C++, forming an attack surface that is repeatedly exploited; existing tools (Atlas, Poirot) are constrained by the static analysis precision-scalability trade-off, making it difficult to recover application-specific cross-language call contexts, and they also cannot construct the complex composite parameter objects accepted by JNI methods.
    • Method highlights: Built on the OpenCode agent with GLM-5 as the backbone, in three stages—cross-language parsing builds a JNI binding table; a dependency-driven algorithm iteratively resolves explicit/implicit dependencies to generate prerequisite call sequences, a recursive constructor assembles parameter objects bottom-up, and a structure-aware retriever and memory bank support long-horizon reasoning; finally, a fixed template and verification-guided iterative repair (three signals: compilation, exceptions, coverage + failure attribution) ensure the harness actually reaches the target logic.
    • Main results:
      • Poirot-44 (44 apps, 7,453 targets): 7,257 built (97.4%), 6,094 runnable, which is 7.4×/5.9× that of Atlas++/Poirot; average bitmap coverage 16.9% vs. 2.9%/2.6%; 5,390 deduplicated crashes (Table 1).
      • Ablation shows each of the four components contributes: removing the retriever lowers the build rate by 32.0%, and after removing call sequence extraction the run/build ratio drops from 84.0% to 52.3% (Figure 5).
      • Vendor-20 (20 vendor preinstalled apps): 6 unknown vulnerabilities confirmed (out-of-bounds write, deserialization, integer overflow), and neither baseline found any of them; 1 has been confirmed by OPPO as a zero-day and a bounty was paid.
      • Cost: a single full run of GLM-5 costs $1,292.6, about $0.21 per runnable harness; the authors report that the full cost of Opus 4.5 is about 5.6× that.
    • Authors' conclusion: Janus outperforms the current best tools in the number of harnesses synthesized, execution effectiveness, and coverage, laying the foundation for agentic cross-language fuzzing harness generation for the Android ecosystem; the authors have released the prototype and artifacts, and point out that asynchronous/concurrent dependencies and interaction with system services are future directions.
Read originalarxiv.org