Chiosa
AI Security & Safety

LLM4SAST finds faults in six Java and Rust code analyzers

Combining LLM and Dynamic Analysis for Universal Testing of Static Application Security Testing Tools · arXiv:2610.21309

3 min
Updated
Overview of LLM4SAST Workflow
Overview of LLM4SAST WorkflowFigure 2 · Combining LLM and Dynamic Analysis for Universal Testing of Static Application Security Testing Tools · Huaien Zhang et al. · CC BY 4.0

In plain words

The paper introduces a framework that tests software tools that scan code for security problems. A language model changes example programs in three ways: it keeps their behavior, fixes a vulnerability, or adds one. The framework checks the changes and compares the scanner’s warnings with what should happen.

Across six Java and Rust tools, researchers reported 66 distinct faults. The detailed status table lists 12 fixed and 24 confirmed, but the paper’s abstract and contribution text say 32 were confirmed or fixed. Those figures conflict; 30 reports were still pending.

The research

If tests generate narrow or invalid code changes, a scanner’s missed warning or extra warning can be mistaken for a defect in the test. How can testing cover different kinds of code changes while checking that each changed program really fits the intended change?

LLM4SAST has a language model create three kinds of code changes, checks whether they fit the intended change, then tests scanners against the resulting warnings.

LLM4SAST records a scanner’s warnings, then uses a language model to preserve behavior, repair a vulnerability, or add one. Compilation, execution, and dynamic-analysis checks screen variants before the scanner’s new warnings are compared with expected patterns.

Across six Java and Rust tools, researchers reported 66 distinct faults. The detailed status table lists 12 fixed and 24 confirmed, but the abstract and contribution text report 32 confirmed or fixed, so the source gives conflicting figures.

Another 30 reports were pending. The results show the approach surfaced candidate faults in the tested tools.

The evaluation covered six selected Java and Rust tools and their security-related rules. Some invalid variants may remain, and clustering left some variants unanalyzed, so false reports or missed faults remain possible.

What the evidence shows

  • Testing code scanners

    LLM4SAST is an automated testing framework for static application security testing (SAST) tools, which inspect code for possible security problems. The paper describes earlier testing approaches as often limited to one language or a narrow set of code transformations.

    Generated programs can also be invalid, making it difficult to know whether a surprising scanner report reflects a scanner fault or a faulty test input.

  • Three kinds of changes

    The framework asks a language model to create variants that preserve behavior, repair a vulnerability, or add one. For each change, it predicts how the scanner’s warnings should relate to the original report: the same warnings, a subset, or a superset.

    A mismatch identifies a possible fault. Compilation, runtime, and dynamic-analysis checks help filter variants that fail to meet the requested change.

  • What the framework found

    In tests of six selected Java and Rust tools, researchers reported 66 distinct faults. All three transformation types contributed: 31 came from behavior-preserving changes, 19 from repairs, and 16 from vulnerability additions.

    The detailed status table lists 12 fixed and 24 confirmed, while the abstract and contribution text report 32 confirmed or fixed. Those figures conflict; 30 reports were still pending, so the total includes reports developers had not yet verified.

  • How results compare

    In the reported comparison, LLM4SAST detected 66 faults, while Statfier detected 13 and a proof-of-concept Rust adaptation detected 6. The approaches used the same stated collection of seed programs, but differed in their transformation sets.

    On average, they used 73, 596, and 728 variants per detected fault, respectively. An ablation also found fewer false positives and variants with dynamic-feedback-driven selection while retaining the same fault count in that evaluation; the result is specific to that setup.

Deep

Next paperProfiling reveals capabilities that threat labels miss in agent skills