Manuscript Offprint

arXiv:2609.09386

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

Md. Wasiul Haque, Sagar Dasgupta, Mizanur Rahman

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Md. Wasiul Haque ∗^{*}

Department of Civil, Construction & Environmental Engineering, The University of Alabama

2009 Smart Communities and Innovation Building (SCIB), 28 Kirkbride Lane,

Tuscaloosa, AL 35487-0288

ORCID: 0009-0007-8417-9261

Email: mhaque16@crimson.ua.edu

Sagar Dasgupta, Ph.D.

Department of Civil, Construction & Environmental Engineering, The University of Alabama

2009 Smart Communities and Innovation Building (SCIB), 28 Kirkbride Lane,

Tuscaloosa, AL 35487-0288

ORCID: 0000-0001-8491-662X

Email: sdasgupta@ua.edu

Mizanur Rahman, Ph.D.

Department of Civil, Construction & Environmental Engineering, The University of Alabama

2007 Smart Communities and Innovation Building (SCIB), 28 Kirkbride Lane,

Tuscaloosa, AL 35487-0288

ORCID: 0000-0003-1128-753X

Email: mizan.rahman@ua.edu

∗^{*}Corresponding author

ABSTRACT

Objectives: Automated vehicles rely on millions of lines of safety-critical software, but general-purpose analysis tools do not understand which code can affect vehicle motion. This study asks whether providing large language models (LLMs) with explicit automated vehicle (AV) security knowledge helps them detect weaknesses that rule-based tools cannot represent.

Methods: We developed an AV vulnerability taxonomy containing 18 weakness classes derived from vulnerability records, security advisories, and AV-security literature. We then created LLM-based Security Analysis for Automated Vehicles (LLMSec-AV) and evaluated it 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 with 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 also tested using AFL++ and sanitizers.

Findings: The LLM conditions recovered up to 76% of the 46 known weakness locations, substantially outperforming the conventional analyzers. CodeQL, Semgrep, and the Clang Static Analyzer matched none, while cppcheck matched one despite producing 1,301 alerts. This advantage was not attributable to the taxonomy alone, because unaided prompting achieved similar detection performance. However, taxonomy context increased the proportion of findings assigned to a weakness class from near zero to more than four-fifths, substantially improving interpretability and triage. The analysis also showed that 6 of the 18 classes cannot be directly represented as static-analysis rules.

Novelty: This study introduces an AV-specific vulnerability taxonomy used directly as machine-readable input for weakness discovery, evaluated on real AV code against known weaknesses.

Practical Applications: LLMSec-AV can help developers and reviewers organize and prioritize safety-relevant findings alongside conventional analyzers.

INTRODUCTION

An automated driving system is, in operational terms, a software system. Perception, localization, prediction, planning, and control are implemented as communicating components, and every steering, acceleration, or braking command is the result of computation. The safety case for an autonomous vehicle (AV) therefore depends in part on the correctness of several million lines of code. Functional-safety practice recognizes software faults as a systematic source of hazardous behavior (International Organization for Standardization 2018), while current regulatory and cybersecurity frameworks require manufacturers to establish management processes covering the software throughout the vehicle life cycle (United Nations Economic Commission for Europe 2021; International Organization for Standardization 2021). Transportation agencies assessing automated-driving deployments, and developers preparing them, consequently need practical methods for identifying software weaknesses that can affect vehicle motion. Empirical studies show that such defects occur at scale in automated-driving codebases (Garcia et al. 2020; Lou et al. 2022).

Existing static-analysis tools were not designed around this vehicle context. CodeQL (Avgustinov et al. 2016), Semgrep (Semgrep, Inc. 2025), cppcheck (Marjamäki 2025), and the Clang Static Analyzer (LLVM Project 2025) detect general programming weaknesses such as buffer overruns, null dereferences, and resource leaks. However, they do not inherently represent which data reach a steering actuator, which inputs are externally influenceable, or when a missing validation check constitutes a transportation-safety hazard rather than a routine implementation defect (Haque et al. 2027). In AV software, this distinction is critical. A missing finiteness check may be inconsequential in a logging utility but hazardous in a lateral controller, because not-a-number is a valid value for floating-point message fields (IEEE 2019). The severity of a weakness therefore depends not only on its code pattern, but also on its location, reachability, and vehicle-level consequence.

Large language models (LLMs) offer a possible way to incorporate this context. Their code-generation and reasoning capabilities are well established (Chen et al. 2021; Fan et al. 2023), and they have been applied to vulnerability detection with mixed results on generic corpora (Zhou et al. 2019; Chakraborty et al. 2022). Yet an LLM prompted only to identify “security bugs” in AV source code has no explicit model of actuation reachability or safety impact (Haque et al. 2026). Our premise is that effective AV-specific analysis requires structured domain knowledge that defines what constitutes an AV-specific weakness and why it matters.

We therefore adopt a taxonomy-first approach. We construct an AV vulnerability taxonomy comprising 18 classes derived from public disclosure records (National Institute of Standards and Technology 2024) and AV-security literature (Dieber et al. 2017; Mayoral-Vilches et al. 2022; Maggi et al. 2022). Each class is operationally defined, mapped to a Common Weakness Enumeration (CWE) identifier (MITRE Corporation 2024), instantiated in ROS 2 idioms (Macenski et al. 2022), and associated with its potential vehicle-level consequence. The taxonomy then serves as machine-readable context for LLMSec-AV, our analysis pipeline, allowing us to evaluate whether explicit AV-domain knowledge improves weakness discovery.

Two design commitments distinguish the study. All measurements are obtained from a real AV stack rather than a curated benchmark: Autoware (Kato et al. 2018), analyzed at a pinned commit and through its native build configuration so that the static analyzer, language model, and fuzzer operate on the same code. We also distinguish flagged from confirmed findings. A weakness reported by either an LLM or a static analyzer remains a hypothesis until a fuzzing harness (Fioraldi et al. 2020) reproduces a sanitizer-detected fault (Serebryany et al. 2012) at the reported location.

This paper addresses four research questions:

RQ1: Does taxonomy-guided, retrieval-augmented analysis improve weakness discovery over unaided LLM prompting on AV source code?

RQ2: How does LLMSec-AV compare with established general-purpose static analyzers on the same code?

RQ3: Which AV weakness classes do rule-based analyzers structurally fail to express, and does domain-grounded analysis reach them?

RQ4: Which component: taxonomy context, retrieval, or multi-step structuring accounts for the observed change in the vulnerability discovery outcome?

These questions cannot be answered using existing artifacts. The required AV-domain knowledge is not yet available in machine-readable form, and no annotated AV codebase provides confirmed weaknesses against which detection performance can be measured. Addressing the research questions therefore required constructing the taxonomy, analysis pipeline, and evaluation benchmark that the study itself evaluates. The paper makes the following contributions:

• We construct a machine-readable AV vulnerability taxonomy comprising 18 weakness classes, including 7 that are specific to the cyber-physical driving context. Each class is operationally defined, mapped to a CWE identifier (MITRE Corporation 2024), instantiated in ROS 2 idioms, and programmatically linked to supporting disclosed vulnerabilities.

• We develop LLMSec-AV, a pipeline that uses the taxonomy as structured analysis context, combines it with retrieval over prior disclosures, and performs multi-step weakness analysis.

• We assemble an evaluation benchmark on a real AV stack in which every reported weakness is submitted for dynamic confirmation, allowing flagged and confirmed findings to be measured separately.

• We compare LLMSec-AV with four general-purpose static analyzers configured for this domain, adding hand-written AV-specific rules to the two that accept them and running the others at their broadest setting, so the comparison is not against stock defaults.

The remainder of the paper is organized as follows. Section 3 reviews AV platforms, vehicle and middleware security, and source-level weakness discovery. Section 4 defines the threat model and experimental scope. Section 5 presents the vulnerability taxonomy, and Section 6 describes the LLMSec-AV pipeline. Section 7 details the evaluation configuration and domain-adapted baselines. Section 8 reports the results, Section 9 interprets them, and Section 10 summarizes the limitations and future directions.

References (25)

  • UNECE, 2021
  • Where Are We and Where Should We Go? In Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE), 2022, pp. 31–43
  • Object-Oriented Queries on Relational Data
  • Lightweight Static Analysis for Many Languages
  • A Tool for Static C/C++ Code Analysis
  • IEEE, 2019
  • Evaluating Large Language Models Trained on Code
  • Survey and Open Problems
  • Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networks
  • Are We There Yet? IEEE Transactions on Software Engineering, Vol. 48, No. 9, 2022, pp. 3280–3296
  • LLM-Assisted Dynamic Threat Analysis for Attacker-Reachable Software Weaknesses in Autonomous Vehicles
  • Robotics and Autonomous Systems, Vol. 98, 2017, pp. 192–203
  • Yen, The Data Distribution Service (DDS) Protocol Is Critical: Let's Use It Securely
  • Science Robotics, Vol. 7, No. 66, 2022, p
  • Enabling Autonomous Vehicles with Embedded Systems
  • A Fast Address Sanity Checker
  • SAE International, 2021
  • Open-Source Software for Autonomous Driving
  • An Open Autonomous Driving Platform
  • Adversarial Optical Channel Exploits Against Lidars for Automotive Applications
  • Yih, T. Rocktäschel, S. Riedel, and D. Kiela, Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
  • Universal Fuzzing with Large Language Models
  • Executors and Callback Groups
  • A Generative Model for Code Generation
  • Open-Weight Reasoning Models