VeriCWEty: Embedding enabled Line-Level CWE Detection in Verilog

arXiv cs.AI / 4/20/2026

💬 OpinionModels & Research

Key Points

  • The paper presents VeriCWEty, an embedding-based framework for detecting and classifying common CWEs (common weaknesses and exposures) in Verilog RTL generated or analyzed in the context of LLM-based code generation.
  • Unlike prior approaches that rely mainly on rule-based checks, formal properties, or coarse structural analysis, the method targets both module-level and line-level granularity to improve semantic vulnerability detection and precise localization.
  • The reported performance includes about 89% precision for identifying common CWEs such as CWE-1244 and CWE-1245.
  • It also reports 96% accuracy for detecting line-level bugs, aiming to help catch vulnerabilities that could otherwise evade untrained reviewers.
  • The work is positioned as a bridge between improved RTL generation and the need for more reliable security-focused bug detection in generated hardware code.

Abstract

Large Language Models (LLMs) have shown significant improvement in RTL code generation. Despite the advances, the generated code is often riddled with common vulnerabilities and weaknesses (CWEs) that can slip by untrained eyes. Attackers can often exploit these weaknesses to fulfill their nefarious motives. Existing RTL bug-detection techniques rely on rule-based checks, formal properties, or coarse-grained structural analysis, which either fail to capture semantic vulnerabilities or lack precise localization. In our work, we bridge this gap by proposing an embedding-based bug-detection framework that detects and classifies bugs at both module and line-level granularity. Our method achieves about 89% precision in identifying common CWEs such as CWE-1244 and CWE-1245, and 96% accuracy in detecting line-level bugs.