SPLASH identifies vulnerable code written by AI by comparing a ‘security review’ with a ‘style review’

Without any training or rules specific to each type of fault, the method selects the safe programme in 74 per cent of cases out of more than 63,000 programmes generated by 12 models.

The code produced by large language models often passes all functional tests while remaining vulnerable. These "security hallucinations" are frequent, written with aplomb, and repeated from sample to sample: neither model uncertainty nor static analyzers are enough to flush them out. Researchers, including Imtiaz Karim and Ashish Kundu, propose SPLASH to address this.

"Audit pressure"

The idea is to measure the probability that a model attributes to the generated program depending on whether it is asked to reread it from a security perspective or from a style perspective. The difference between the two, aggregated by instruction and then by program, serves as an indicator. It allows you to choose the safest version among several candidates and to point to the faulty line, without training a model, without rules specific to each CWE category and without internal access to the generator.

Tested on 63,684 programs written by 12 models for 899 tasks, SPLASH selects safe code 74% of the time and puts the vulnerable statement at the top of the list in 58% of failed programs, outperforming a state-of-the-art model used as a judge.