LLM framework improves automated vehicle software weakness detection

LLMSec-AV: A Vulnerability Taxonomy and LLM-Driven Software Weakness Discovery Framework for Autonomous Vehicles

Cryptography and Security

Summary

Automated vehicles use complex software that must be safe and secure, but existing tools struggle to find dangerous bugs related to vehicle movement. The authors created a way to categorize types of vehicle software weaknesses and used large language models (LLMs) to better spot these weaknesses in real vehicle code. Their approach found many known problems that traditional tools missed and helped organize the findings to make them easier to understand and fix. This shows that combining vehicle-specific knowledge with LLMs can make security checks for automated cars more effective.

What this means in practice

  • For automotive software engineers: Detect and organize safety-related software weaknesses in automated vehicle code more effectively than conventional analysis tools.
  • For software security teams: Prioritize and triage software security findings in safety-critical vehicle software using a machine-readable vulnerability taxonomy.

Authors

Md. Wasiul Haque, Sagar Dasgupta, Mizanur Rahman

Abstract

Automated vehicles rely on millions of lines of safety-critical software, yet general-purpose analyzers do not understand which code can affect vehicle motion. This study asks whether large language models (LLMs) with explicit automated-vehicle (AV) security knowledge improve weakness detection beyond rule-based tools. We developed an AV vulnerability taxonomy with 18 weakness classes from vulnerability records, security advisories, and AV-security literature, and integrated it into LLM-based Security Analysis for Automated Vehicles (LLMSec-AV). Evaluated on Autoware, the framework decomposed 770 translation units into 4,673 functions and analyzed 161 functions under four prompting conditions involving taxonomy context, retrieval from 374 prior disclosures, and multi-step analysis. Findings were compared with 46 weakness locations mined from upstream fixes and a flag-volume-matched permutation baseline. CodeQL, Semgrep, cppcheck, and the Clang Static Analyzer evaluated the same code, with AV-specific rules added to CodeQL and Semgrep. Generated fuzzing harnesses were tested using AFL++ and sanitizers. LLM conditions recovered up to 76% of the 46 known weakness locations, outperforming conventional analyzers. CodeQL, Semgrep, and the Clang Static Analyzer matched none, while cppcheck matched one despite 1,301 alerts. Unaided prompting achieved similar detection performance, showing that the taxonomy did not drive recall. However, taxonomy context increased the share of findings assigned to a weakness class from near zero to over 80%, improving interpretability and triage. Six of the 18 classes could not be directly represented as static-analysis rules. LLMSec-AV introduces an AV-specific, machine-readable vulnerability taxonomy for weakness discovery and shows that LLMs can complement conventional analyzers by identifying and organizing safety-relevant findings in real AV software.