“Digital Camouflage”: The LLVM challenge in LLM-based malware detection

Large Language Models (LLMs) have emerged as promising tools for malware detection by analyzing code semantics, identifying vulnerabilities, and adapting to evolving threats. However, their reliability under adversarial compiler-level obfuscation is yet to be discovered. In this study, we empirically evaluate the robustness of three state-of-the-art LLMs: ChatGPT-4o, Gemini Flash 2.5, and Claude Sonnet 4 against compiler-level obfuscation techniques implemented via the LLVM infrastructure. These include control flow flattening, bogus control flow injection, instruction substitution, and split basic blocks, which are widely used to evade detection while preserving malicious behavior. We perform a structured evaluation on 40 C functions (20 vulnerable, 20 secure) sourced from the Devign dataset and obfuscated using LLVM passes. Our results show that these models often fail to correctly classify obfuscated code, with precision, recall, and F1-score dropping significantly after transformation. This reveals a critical limitation: LLMs, despite their language understanding capabilities, can be easily misled by compiler-based obfuscation strategies. To promote reproducibility, we release all evaluation scripts, prompts, and obfuscated code samples in a public repository. We also discuss the implications of these findings for adversarial threat modeling, and outline future directions such as software watermarking, compiler-aware defenses, and obfuscation-resilient model design. • LLMs detect vulnerabilities in clean C code with high accuracy. • Compiler-level obfuscation causes consistent misclassifications in LLMs. • LLVM IR transformations affect both vulnerable and non-vulnerable samples. • We evaluated LLMs on obfuscated code via a structured, reproducible protocol. • All code, prompts, and scripts are released for reproducibility in our Github repo and all necesarry steps are in the README file.

Institutions

Publication Details

Journal
Journal of Systems and Software
Published
2025-09-27
DOI
https://doi.org/10.1016/j.jss.2025.112646
Citations
1
Primary Topic
Global Maternal and Child Health
Type
article
Field-Weighted Citation Impact
3.49
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

“Digital Camouflage”: The LLVM challenge in LLM-based malware detection

1 citations
Journal of Systems and Software
Global Maternal and Child Health
3.49
article

“Digital Camouflage”: The LLVM challenge in LLM-based malware detection

article en
1 citations

Abstract

Large Language Models (LLMs) have emerged as promising tools for malware detection by analyzing code semantics, identifying vulnerabilities, and adapting to evolving threats. However, their reliability under adversarial compiler-level obfuscation is yet to be discovered. In this study, we empirically evaluate the robustness of three state-of-the-art LLMs: ChatGPT-4o, Gemini Flash 2.5, and Claude Sonnet 4 against compiler-level obfuscation techniques implemented via the LLVM infrastructure. These include control flow flattening, bogus control flow injection, instruction substitution, and split basic blocks, which are widely used to evade detection while preserving malicious behavior. We perform a structured evaluation on 40 C functions (20 vulnerable, 20 secure) sourced from the Devign dataset and obfuscated using LLVM passes. Our results show that these models often fail to correctly classify obfuscated code, with precision, recall, and F1-score dropping significantly after transformation. This reveals a critical limitation: LLMs, despite their language understanding capabilities, can be easily misled by compiler-based obfuscation strategies. To promote reproducibility, we release all evaluation scripts, prompts, and obfuscated code samples in a public repository. We also discuss the implications of these findings for adversarial threat modeling, and outline future directions such as software watermarking, compiler-aware defenses, and obfuscation-resilient model design. • LLMs detect vulnerabilities in clean C code with high accuracy. • Compiler-level obfuscation causes consistent misclassifications in LLMs. • LLVM IR transformations affect both vulnerable and non-vulnerable samples. • We evaluated LLMs on obfuscated code via a structured, reproducible protocol. • All code, prompts, and scripts are released for reproducibility in our Github repo and all necesarry steps are in the README file.

Journal of Systems and SoftwareVol. 231
German Research Centre for Artificial Intelligence (DE), Technische Universität Berlin (DE)
Openalex Percentile: Top 6%
Global Maternal and Child Health
3.49
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

“Digital Camouflage”: The LLVM challenge in LLM-based malware detection · Journal of Systems and Software (2025) | TGRS Research Map | TGRS