arXiv:2608.29808cs.CRAug 2026

Manuscript Offprint

arXiv:2608.29808

POLYFLOW: A Neuro-Symbolic Framework for Static Cross-Language Information Flow Analysis

Haoran Yang, Zhixuan Zhong, Jiawei Guo, Haipeng Cai

Haoran Yang

Washington State University

Zhixuan Zhong

University at Buffalo, SUNY

Jiawei Guo

University at Buffalo, SUNY

Haipeng Cai

University at Buffalo, SUNY

University at Buffalo, SUNY

Abstract—Modern software systems are commonly constructed in multiple, interacting programming languages. This construction leads to additional, often stealthy vulnerabilities buried in complex information flow due to language interactions. Existing static analyzers are impeded by the heterogeneous semantics of different languages, whereas dynamic approaches suffer from the limited coverage of (available and/or generated) test inputs. In this paper, we develop POLYFLOW, a neural-symbolic framework for statically reasoning about information flow across language boundaries, combining large language models (LLMs) and static analysis synergistically. Governed by the control-flow representation of a given multi-language system, POLYFLOW leverages LLMs to identify implicit flow facts due to challenging language features, hence augmenting the base representation and then propagating data flow through the system. It tackles inherent barriers (e.g., token limit and hallucination) of LLMs by putting them under careful guidance (e.g., static-analysis-guided scoping, context management, and fact checking), along with a multi-LLM expert panel for negotiated validation. Our experiments on real-world Python-C and Java-C systems show that POLYFLOW is cost-effective and superior to various kinds of state-of-the-art baselines, revealing previously unknown cross-language vulnerabilities that are missed by all the baselines.

1. Introduction

Software systems today are mostly and increasingly multilingual [22], [7], [48], [62], composed of code units in diverse programming languages that interact with each other to deliver seamless functionalities [53], [41], [54], [31], [61], [63]. This heterogeneous composition is well justified by combining the unique advantages of individual languages[3], [42]. For instance, highly impactful machine learning frameworks (e.g., PyTorch) and mobile systems (e.g., Android) are typical examples of multi-language software that couple a high-level host language (e.g., Python or Java) with performance-critical native C code via foreign-function interfaces [18], [35], [37].

However, the multilingual construction also results in greater complexity of multi-language systems, which leads to their statistical proneness [29], [48], [1], [25], [15] and practical exposure [8], [28] to increased security threats. In particular, the interaction between languages introduces cross-language vulnerabilities as recently discovered [51], [32]: security flaws that arise from semantic mismatches, implicit assumptions and flows, or unsafe data exchange across language boundaries [20], [64]. For example, in Python-C systems, improper marshaling of data types due to dynamic typing in Python caused unsafe memory allocation hence corruption in C through a native function call [28]. These vulnerabilities are systemic yet stealthy, often evading detection as existing analysis tools mostly operate in language-specific silos [17], [64]. Securing multi-language systems demands a holistic, cross-language analysis [28], [66], [8], [30], whose urgency is driven by the growing dominance of those systems [62], [43], [55], [36], [33].

In response, relevant approaches exist. Yet many of them [12], [13], [16], [40], [8], [44] actually tackle single-language bugs, where the “cross-language” terms, when present, refer to “supporting different languages”, not concerning scenarios where those languages co-exist and interact in one project [36], [35], [33], [48], [5], [68]. Among techniques that do address multilingual code, some only look at the design-level smells [1], [37] or are limited to API misuses [52], [18]. To really tackle cross-language bugs, a few dynamic approaches emerged [4], [58], [28], [21], [60]. However, they can only reveal bugs exercised by given test cases—which are particularly scarce in multi-language projects [32]. While this may be mitigated by generating more tests, existing solutions resort to much manual effort [20] or fail due to the technique’s randomness [32].

Current static approaches bypass the coverage limitation, but they rely on language-specific semantic rules [66] or abstract summaries [26], [47]/specification [24] for native code and/or language interoperability, hence requiring labor-intensive per-language engineering. Recent advances support static cross-language analysis [49], [67], whose potential for detecting cross-language bugs has yet to be demonstrated. More importantly, they require separate, mature analysis infrastructure for each language, which is not always available (e.g., for Python). As showcased lately, learning-based cross-language bug detection [64], [34] may potentially complement both static and dynamic approaches. Unfortunately, they struggle to generalize to new and unseen codebases, and their performance is highly dependent on the quality and quantity of training data, which (e.g., labeled buggy datasets [59]) are particularly lacking in the domain of multi-language software. Additionally, extant static, dy-namic, and learning-based techniques are commonly limited in analyzing challenging language features (e.g., decorators in Python, as well as reflection in Java) hence missing highly stealthy cross-language bugs (e.g., those buried in implicit information flow).

In this paper, we aim to statically analyze cross-language information flow while overcoming the limitations of extant approaches. Static information flow analysis is a fundamental technique for vulnerability discovery [45], [11], [23], [19], [46], [38], which formulates the detection of various kinds of vulnerabilities as a source-sink problem (with sources/sinks defined accordingly). It has been widely used in practice (e.g., underlying GitHub CodeQL [14] and Facebook Infer [6]) for single-language software. Yet, developing a static information flow analysis across language boundaries is challenging.

First (Challenge-1), different languages define and handle constructs (e.g., type systems, memory management, and control flow) differently. These semantics disparities complicate the creation of a unified (especially static) analysis framework capable of accurately interpreting and reasoning about code across languages. Second (Challenge-2), diverse language features (e.g., function pointers and inline assembly in C), especially dynamic code constructs (e.g., dynamic typing and reflection in Python, dynamic class loading in Java), can obscure the flow of information and make it difficult to analyze even single-language code at compile time. Dealing with such features in/across multiple languages is only harder.

These intrinsic static-analysis challenges could be tackled by large language models (LLMs), given their demonstrated potential for code understanding [9], [39] and reasoning [27], [57], [38]. Yet (Challenge-3), LLMs are not magic boxes—merely delegating a complex task like cross-language analysis to them may not help much. For one thing, their token/context-size limits make it infeasible to feed them with the entire system, especially as multi-language codebases tend to be larger than single-language ones. Analyzing one function at a time alleviates this barrier, but the LLMs would not capture even interprocedural context, not to mention inter-language effects—both of which are essential for effective cross-language analysis. For another, LLMs may hallucinate, producing spurious results [27], [57].

Overcoming such challenges, we developed POLYFLOW, a repository/project-level static cross-language information flow analysis that synergistically combines traditional program analysis with foundation LLMs in a neural-symbolic framework. Given a multi-language system, we start with a lightweight cross-language interprocedural analysis, resulting in an approximate (incomplete and imprecise) representation of the whole system with only explicit control/data flow facts. Based on this representation, the static analysis works further as the system controller, invoking LLMs to analyze implicit flow facts, hence potentially augmenting the representation and propagating information between given sources and sinks through the system, so as to address Challenge-1.

To identify and resolve the implicit flows, which are induced by respective language features, we elicit the LLMs' relevant knowledge via few-shot in-context learning, while aiming to achieve analysis soundness via a fixed-point iteration of feature handling, hence addressing Challenge-2.

Importantly, the static analysis coordinates interprocedural and inter-language contexts, which allows the LLMs to only provide complementary assistance (e.g., handling the challenging features) in a minimal scope (a function or a control-flow path) on demand. Moreover, we leverage multiple LLMs formed as a negotiation/arbitration component, called expert panel, to cross-validate results of every LLM query, while using static-analysis-produced facts to check those results. The careful guidance (adaptive scoping, context management, and fact checking) and negotiated-agreement-based validation procedure collectively address Challenge-3.

For evaluation purposes, we implemented POLYFLOW for Python-C and Java-C systems given their high and lasting popularity (e.g., in the impactful AI/ML, mobile, and web software ecosystem) [29], [31], [62]. To rigorously validate POLYFLOW, we curated xFlowBench, the first static cross-language analysis benchmark with ground-truth information flow facts with respect to different features of three languages. We then applied POLYFLOW to 29 real-world multi-language systems of diverse scales and application domains, and compared it to various kinds of state-of-the-art (SOTA) baselines.

Our extensive experiments reveal POLYFLOW's promising cost-effectiveness and scalability. On the microbench, POLYFLOW achieved 97.9% precision, 87.3% recall, and 91.8% F1. On the complex real-world systems, it achieved 76.8% precision and discovered 17 previously unknown, exploitable cross-language vulnerabilities—none of which are found by any of the baselines. Ablation studies confirmed that each of its key design elements/components contributes significantly to its overall performance. POLYFLOW also reasonably scales to large-scale systems, incurring 12.86 hours and 482.5 MB peak memory on average per project; In terms of LLM costs, POLYFLOW only consumes on average 2.81-M tokens to analyze each multi-language system.

POLYFLOW showcases a novel paradigm of neuro-symbolic approaches to code analysis. Instead of an LLM-based core invoking external (symbolic) tools, our framework is centered around a static analyzer, which judiciously (1) utilizes LLMs where they offer the most value while traditional analysis falls short, (2) decides when, where, and how to employ LLMs while supplying contexts on demand, and (3) integrates LLM outputs as intermediate results to the analysis, hence combining the strengths of both methods while overcoming each other's shortcomings—the key insight and takeaway of our work.

The main contributions of this paper include:

  • POLYFLOW, a novel static analysis of multi-language software that holistically addresses cross-language information flow, including implicit ones and those induced by language features challenging to existing analyses ( §3§3).

  • An open-source implementation of POLYFLOW working with real-world Python-C and Java-C systems across various scales and domains (§4).

  • xFlowBench, an open multilingual static analysis benchmark, which is the first such benchmark with ground-truth cross-language information flow facts as we know (§5).

  • A comprehensive evaluation of POLYFLOW on both the micro-benchmarks and real-world multi-language systems, which demonstrates its promising merits in cross-language analysis effectiveness and vulnerability discovery superior to SOTA baselines (§6).

References (65)