<p>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 <Emphasis Type="BoldItalic">candidate pick</Emphasis> 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.</p>

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

CNE-San: Fully Automatically Generated and Inserted Assertions for Bug-Oriented Sanitizers

  • Chien-Jung Chiu,
  • Hong-Yen Chen,
  • Tsung-Nan Lin

摘要

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.