CNE-San: Fully Automatically Generated and Inserted Assertions for Bug-Oriented Sanitizers
Journal
SN Computer Science
Journal Volume
6
Journal Issue
8
ISSN
2662995X
Date Issued
2025-11-14
Author(s)
Abstract
Unit testing is a method to find predefined defects; fuzzing is a method to find crashes or hangs by running the program with random inputs. However, these procedures cannot find the CWE security defects if they do not trigger any exceptions. If developers are unaware of the specific scenario, unit testing cases will not cover this scenario. Fuzzers cannot also find them since the execution may not trigger any exceptions. To find these security defects, Go-Sanitizer was proposed in Golang, but it is difficult to pick or put the assertions correctly or validly by hand in the candidate pick stage. To solve this problem, we propose an algorithm named CNE-San, which leverages the abstract syntax tree (AST, a kind of static analysis method), fully automatically generates and inserts assertion statements into the correct positions and scopes of the source code. Then, we combine the traditional methods such as unit testing or fuzzing to trigger the inserted assertion, which can massively save the investigation time and avoid the false positive problem. We also implement this algorithm in Python, as the first bug-oriented assertion generator in this language. It can automatically analyze the code and insert the code snippets, helping the traditional testing methods find these defects with these code snippets.
Subjects
Assertion generation
Bug detection
CWE
Program diagnostics
Publisher
Springer Science and Business Media LLC
Type
journal article
