LLM-Assisted Static Analysis for Detecting Security Vulnerabilities

Ziyang Li, Saikat Dutta, Mayur Naik

arXiv:2405.17238 · 2026-07-27 공개 · arXiv · PDF

llm gpt-4 neuro-symbolic static-analysis security-vulnerability codeql cwe-bench-java taint-specification

Abstract

Software is prone to security vulnerabilities. Program analysis tools to detect them have limited effectiveness in practice due to their reliance on human labeled specifications. Large language models (or LLMs) have shown impressive code generation capabilities but they cannot do complex reasoning over code to detect such vulnerabilities especially since this task requires whole-repository analysis. We propose IRIS, a neuro-symbolic approach that systematically combines LLMs with static analysis to perform whole-repository reasoning for security vulnerability detection. Specifically, IRIS leverages LLMs to infer taint specifications and perform contextual analysis, alleviating needs for human specifications and inspection. For evaluation, we curate a new dataset, CWE-Bench-Java, comprising 120 manually validated security vulnerabilities in real-world Java projects. A state-of-the-art static analysis tool CodeQL detects only 27 of these vulnerabilities whereas IRIS with GPT-4 detects 55 (+28) and improves upon CodeQL's average false discovery rate by 5% points. Furthermore, IRIS identifies 4 previously unknown vulnerabilities which cannot be found by existing tools. IRIS is available publicly at https://github.com/iris-sast/iris.

한국어 요약

한 줄 요약

IRIS는 GPT-4와 정적 분석을 결합한 신경-기호적 접근법으로, Java 프로젝트에서 보안 취약점을 55개 탐지하며 기존 도구 대비 103.7% 개선.

핵심 기여도

핵심 아이디어

IRIS는 LLM의 코드 이해 능력과 정적 분석의 정밀도를 결합한 neuro-symbolic 접근법이다. 기존 정적 분석 도구는 **taint specification**을 수동으로 작성해야 하며, 이는 오류와 누락을 초래한다. IRIS는 LLM을 사용해 **CWE-specific taint specification**을 추론하고, 이를 CodeQL과 결합해 정적 분석을 보완한다. 또한, LLM을 활용한 **contextual analysis**를 통해 경로 정보와 코드 맥락을 프롬프트에 포함시켜 **false positive**를 5.21% 감소시킨다. 이는 개발자의 수동 검토 부담을 줄이는 핵심 기전이다.

기술적 접근법

주요 결과

의의 및 한계

IRIS는 정적 분석의 제한성을 보완하고, LLM의 코드 이해 능력을 활용해 보안 취약점 탐지의 정확도와 효율성을 동시에 향상시킨다. 특히, **taint specification 추론**과 **contextual analysis**를 통해 개발자의 수동 검토 부담을 줄이는 점에서 실용적 가치가 크다. 그러나 IRIS는 여전히 많은 취약점을 탐지하지 못하며, LLM 호출이 많아 분석 비용이 증가한다. 또한, Java 외 언어에서의 성능은 미지수이며, 보고서 형식도 개선이 필요하다는 한계가 있다.

실용적 활용

IRIS는 Java 기반 소프트웨어 보안 검증, CI/CD 파이프라인 내 자동화된 취약점 탐지, 오픈소스 프로젝트의 보안 감사 등에 적용 가능하다. 특히, **taint specification이 부족한 라이브러리나 새로운 취약점**을 탐지하는 데 유용하다.