Static program analysis is built on a elegant premise: we should be able to understand what a program does simply by examining its source code, without actually running it. By parsing text into an Abstract Syntax Tree (AST), an analyzer can map out every possible execution path, trace how data flows from inputs to outputs, and catch bugs or security vulnerabilities before the code ever hits production.
This approach works remarkably well for statically typed, rigid languages like C or Java. But when applied to modern dynamic languages—such as Python, JavaScript, and PHP—the underlying assumptions of static analysis begin to crumble.
In a dynamic language, code is not a fixed blueprint; it is a fluid, evolving structure. Types are resolved at runtime, functions are first-class objects that can be passed around or reassigned, and objects can mutate their shapes on the fly. This creates a fundamental mismatch. When a static analyzer attempts to reason about a dynamic program, it is forced to make guesses. To remain sound (ensuring it doesn't miss any bugs), it must over-approximate, assuming that any dynamic behavior could happen. This leads to an explosion of false positives, rendering the analysis imprecise and often unusable.
To understand why this happens, we must look at the specific mechanisms where static analysis and dynamic execution collide.
The Call Graph Blindspot
At the heart of almost every static analysis tool is the call graph—a directed graph that maps out which functions can call which other functions. If the analyzer cannot build an accurate call graph, it cannot trace control flow across procedural boundaries.
In dynamic languages, building this map is notoriously difficult due to dynamic dispatch and polymorphic calls. For example, as Bhargava Shastry et al. point out in their work on staged program analysis, the presence of virtual tables and dynamic dispatch in object-oriented structures prevents static tools from definitively tracing control flow. Similarly, Qingkai Shi et al. note that object-oriented constructs obscure explicit control flow, making automated reverse-engineering of parsers highly complex.
The problem intensifies in scripting environments where functions are treated as first-class citizens and classes themselves are mutable runtime objects. As Ana L. Milanova et al. explain in their development of PoTo: A Hybrid Andersen's Points-to Analysis for Python, this extreme dynamism makes constructing accurate points-to sets incredibly difficult. If a static analyzer cannot determine what an object points to, it cannot resolve what method will actually be executed at runtime.
Statically:
x.execute() ---> Which 'execute' method?
Could be Class A, B, C... or a dynamically injected function.
The analyzer must guess or evaluate all paths.
Furthermore, features like reflection, runtime code modification (e.g., JavaScript's eval() or Python's getattr()), and dynamic class loading completely blindside static tools. Z. Berkay Celik et al. observe that the heavy use of these features in IoT platforms severely hinders static security assessments, leading to missed vulnerabilities or over-tainting. When code can be injected or altered during execution, a static snapshot of the source code simply does not contain the information required to understand the program's ultimate behavior, a limitation also highlighted by Saeid Tizpaz-Niari et al. and Daniel Kroening et al..
The Dataflow Mirage
Even if an analyzer manages to approximate a call graph, tracking how data moves through a dynamic program—known as dataflow or taint analysis—presents another massive hurdle.
In a statically typed language, a variable's type constrains what can happen to it. In a dynamically typed language, a variable is merely a label pointing to a value. As Lukas Seidel et al. explain, static tools struggle because they cannot resolve these variable types at compile time. Without explicit type definitions, a security scanner cannot reliably determine whether a piece of data is a benign string or a sensitive database client, making it incredibly difficult to trace how untrusted user input propagates through a system.
This ambiguity is compounded by complex language constructs like variable aliasing, nested comprehensions, and implicit type coercion. Arjun Guha argues that implicit type coercion and context-sensitive keywords complicate the development of reliable analysis tools, requiring a reduction to a core calculus to reason about behavior safely. When data structures interact with external libraries or complex internal logic, the data lineage becomes obscured. For instance, El Kindi Rezig et al. note that variable aliasing and dynamic object references frequently break static dataflow tracking in data science pipelines, leaving tools unable to map how dataframes are transformed across procedural boundaries.
def process_data(payload):
# Statically, what is 'payload'?
# Is it a dictionary? A custom object? A string?
# What happens when we call payload.read()?
return payload.read()
When static tools attempt to analyze highly dynamic environments like frontend JavaScript, the sheer complexity of asynchronous callbacks and mutable object structures often leads to a failure to maintain accurate taint propagation without incurring massive performance overhead or losing precision entirely, as demonstrated by Rahul Kanyal et al..
Real-World Consequences
The gap between static assumptions and dynamic reality is not just a theoretical problem; it has severe practical consequences across software engineering.
1. Security Auditing Failures
Security tools rely heavily on static analysis to find vulnerabilities like Server-Side Request Forgery (SSRF) or privacy violations. However, because these tools struggle with dynamic language features—such as argument unpacking in PHP or dynamic calls in Swift—they frequently suffer from high false-positive rates or miss critical flaws entirely. Yuchen Ji et al. show that existing static tools fail to accurately model complex data flows and implicit function calls in PHP web applications. Similarly, in the iOS ecosystem, Dexin Liu et al. highlight that the inherent difficulties in resolving dynamic calls in Objective-C and Swift lead to significant inaccuracies when hunting for privacy violations in software supply chains.
2. The LLM "Time-Lag" and Context Blindness
As Large Language Models (LLMs) take over code generation, their reliance on static representations of code creates new failure modes. For example, Chong Wang et al. discovered that LLMs frequently suggest deprecated APIs in Python because static analysis methods used during training or evaluation fail to fully capture the complexities of Python's dynamic environment. Furthermore, when evaluating LLMs on real-world repositories, Jia Li et al. found that static methods for dependency extraction fail to capture dynamic execution behaviors, leading to inaccurate measurements of whether an AI-generated code snippet will actually run correctly.
Bridging the Gap
Recognizing that pure static analysis is fundamentally limited when facing dynamic languages, researchers have shifted toward hybrid and generative paradigms.
One approach is to use machine learning to predict the missing runtime information. Yun Peng et al. developed a generative type inference approach that teaches LLMs to "think" like static analyzers, combining code slicing with Chain-of-Thought prompting to resolve types that traditional rule-based static tools miss due to dynamic features or external library calls.
Another direction is the development of hybrid analysis frameworks that blend static reasoning with runtime observation. By combining the broad coverage of static analysis with the concrete precision of dynamic execution, modern tools attempt to resolve points-to sets and call graphs dynamically, allowing developers to navigate the fluid landscape of modern programming languages without losing the ability to reason about their safety and correctness.
Key Foundational Work
GAEA Action Equations Paradigm (1988) — contributed 2 concept elements to this direction.