SPLASH: Contrastive Audit Pressure for Detecting and Localizing Security Hallucinations in Generated Code
Mirza Masfiqur Rahman, MD Ajwad Akil, Imtiaz Karim, Ashish Kundu, Ramana Kompella, Elisa Bertino
Abstract
Code generated by large language models often passes every functional test while remaining insecure. These security hallucinations are common, written with high confidence, and repeated across samples, so neither the generator's own uncertainty nor static analyzers reliably catch them. We introduce SPLASH, which is guided by a new measure called audit pressure. It contrasts teacher-forced log-probabilities for the generated program under a security review and a style review. Aggregated to statements and programs, and grounded in a probabilistic model of competing edits, audit pressure allows SPLASH to choose the secure program among a model's candidate programs and locate the vulnerable statement, with no model training, CWE-specific rules, or internal access to the generating model. On 63,684 programs generated by 12 models for 899 tasks, SPLASH picks secure code in 74% of cases, places the vulnerable statement first in 58% of insecure programs, and chooses better than a frontier LLM judge.
Create a lesson
Metadata
- Categories
- cs.CR, cs.LG, cs.SE
Related papers
Secure and Functional Code Generation with Self-Evaluation
Shared title terminologycs.CRMd Afif Al Mamun, Gias Uddin
How Effectively Do Security Skills Guide Coding Agents in Vulnerability Detection in Linux Kernel?
Shared title terminologycs.CRHaoran Xue, Nikta Akbarpour, Gias Uddin et al.
CAT-RAG: Improving Secure Code Generation with Category-Aware Agentic Retrieval
Shared title terminologycs.CRMahdieh Abazar, Lorenzo De Carli, Benjamin Tan
Peer Pressure: Execution-Verified Co-Evolution of Attacker and Defender Populations for Code Security
Shared title terminologycs.CRKhushbu Pahwa, Yubin Ge, Daniele Bonadiman et al.
Enhancing Metaverse Security using Explainable AI-based Intrusion Detection Framework
Shared title terminologycs.CREsha Kuppanda, Shalaka Mahadik, Pranav M. Pawar et al.
Replication of Agentic Security Events: Audit and Investigation (ROGUE-AI)
Shared title terminologycs.CRMengxiao Wang, Mahbub Alam, Kalyan Nakka et al.