journal article·2021-04-02Open access

Automated Software Vulnerability Detection Based on Hybrid Neural Network

Xin Li, Lu Wang, Yang Xin, Yixian Yang, Qifeng Tang, Yuling Chen

Applied Sciences· Volume 11· Issue 7

Abstract

Vulnerabilities threaten the security of information systems. It is crucial to detect and patch vulnerabilities before attacks happen. However, existing vulnerability detection methods suffer from long-term dependency, out of vocabulary, bias towards global features or local features, and coarse detection granularity. This paper proposes an automatic vulnerability detection framework in source code based on a hybrid neural network. First, the inputs are transformed into an intermediate representation with explicit structure information using lower level virtual machine intermediate representation (LLVM IR) and backward program slicing. After the transformation, the size of samples and the size of vocabulary are significantly reduced. A hybrid neural network model is then applied to extract high-level features of vulnerability, which learns features both from convolutional neural networks (CNNs) and recurrent neural networks (RNNs). The former is applied to learn local vulnerability features, such as buffer size. Furthermore, the latter is utilized to learn global features, such as data dependency. The extracted features are made up of concatenated outputs of CNN and RNN. Experiments are performed to validate our vulnerability detection method. The results show that our proposed method achieves excellent results with F1-scores of 98.6% and accuracy of 99.0% on the SARD dataset. It outperforms state-of-the-art methods.
Source: crossref · Quality: baseline

Research context

OpenAlex topics: Software Engineering Research · Advanced Malware Detection Techniques · Software Reliability and Analysis Research

SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.

Affiliations

School of Cyberspace Security, Beijing University of Posts and Telecommunications, Beijing 100876, China

State Key Laboratory of Public Big Data, College of Computer Science and Technology, Guizhou University, Guiyang 550025, China

National Engineering Laboratory for Big Data Distribution and Exchange Technologies, Shanghai Data Exchange Corporation, Shanghai 200436, China

Funding

National Key R&D Program of China · Major Scientific and Technological Special Project of Guizhou Province · Foundation of Guizhou Provincial Key Laboratory of Public Big Data · National Statistical Scientific Research Project of China

References (46)

Show source-provided references
1. (2021, January 19). CVSS Severity Distribution Over Time, Available online: https://nvd.nist.gov/general/visualizations/vulnerability-visualizations/cvss-severity-distribution-over-time.
2. (2021, January 19). Over 500,000 Zoom Accounts Sold on Hacker Forums the Dark Web. Available online: https://www.bleepingcomputer.com/news/security/over-500-000-zoom-accounts-sold-on-hacker-forums-the-dark-web/.
3. (2021, January 19). CheckMarx Software Official Website. Available online: https://www.checkmarx.com.
4. Cadar, C., Dunbar, D., and Engler, D.R. (2008, January 8–12). KLEE: Unassisted and Automatic Generation of High-Coverage Tests for Complex Systems Programs. Proceedings of the OSDI, San Diego, CA, USA.
5. Henzinger, T.A., Jhala, R., Majumdar, R., and Sutre, G. (2003, January 9–10). Software verification with BLAST. Proceedings of the International SPIN Workshop on Model Checking of Software, Portland, OR, USA.10.1007/3-540-44829-2_17 ↗
6. Moshtari, S., and Sami, A. (2016, January 4–8). Evaluating and comparing complexity, coupling and a new proposed set of coupling metrics in cross-project vulnerability prediction. Proceedings of the 31st Annual ACM Symposium on Applied Computing, Pisa, Italy.10.1145/2851613.2851777 ↗
7. Can traditional fault prediction models be used for vulnerability prediction?10.1007/s10664-011-9190-8 ↗
8. Evaluating complexity, code churn, and developer activity metrics as indicators of software vulnerabilities10.1109/TSE.2010.81 ↗
9. Morrison, P., Herzig, K., Murphy, B., and Williams, L. (2015, January 21–22). Challenges with applying vulnerability prediction models. Proceedings of the 2015 Symposium and Bootcamp on the Science of Security, Urbana, IL, USA.10.1145/2746194.2746198 ↗
10. Wang, S., Chollak, D., Movshovitz-Attias, D., and Tan, L. (2016, January 3–7). Bugram: Bug detection with n-gram language models. Proceedings of the 31st IEEE/ACM International Conference on Automated Software Engineering, Singapore.10.1145/2970276.2970341 ↗
11. Software vulnerability analysis and discovery using machine-learning and data-mining techniques: A survey10.1145/3092566 ↗
12. Predicting vulnerable software components via text mining10.1109/TSE.2014.2340398 ↗
13. Pang, Y., Xue, X., and Namin, A.S. (2015, January 9–11). Predicting vulnerable software components through n-gram analysis and statistical feature selection. 2015 IEEE 14th International Conference on Machine Learning and Applications (ICMLA), Miami, FL, USA.10.1109/ICMLA.2015.99 ↗
14. Li, Z., Zou, D., Xu, S., Ou, X., Jin, H., Wang, S., Deng, Z., and Zhong, Y. (2018, January 18–21). Vuldeepecker: A deep learning-based system for vulnerability detection. Proceedings of the 25th Annual Network and Distributed System Security Symposium (NDSS), San Diego, CA, USA.10.14722/ndss.2018.23158 ↗
15. Li, Z., Zou, D., Xu, S., Jin, H., Zhu, Y., and Chen, Z. (2021). SySeVR: A framework for using deep learning to detect software vulnerabilities. IEEE Trans. Dependable Secure Comput., 1.10.1109/TDSC.2021.3051525 ↗
16. Li, X., Wang, L., Xin, Y., Yang, Y., and Chen, Y. (2021). Automated Vulnerability Detection in Source Code Using Minimum Intermediate Representation Learning. Appl. Sci., 10.10.3390/app10051692 ↗
17. Cross-project transfer representation learning for vulnerable function discovery10.1109/TII.2018.2821768 ↗
18. Lin, G., Zhang, J., Luo, W., Pan, L., and Xiang, Y. (November, January 30). POSTER: Vulnerability discovery with function representation learning from unlabeled projects. Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, Dallas, TX, USA.10.1145/3133956.3138840 ↗
19. Vulnerability Prediction from Source Code Using Machine Learning10.1109/ACCESS.2020.3016774 ↗
20. Alon, U., Zilberstein, M., Levy, O., and Yahav, E. (2019, January 14–15). Code2vec: Learning distributed representations of code. Proceedings of the ACM on Programming Languages (POPL), Cascais, Portugal.10.1145/3290353 ↗
21. Alon, U., Brody, S., Levy, O., and Yahav, E. (2019, January 6–9). Code2seq: Generating Sequences from Structured Representations of Code. Proceedings of the International Conference on Learning Representations, New Orleans, LA, USA.
22. Mou, L., Li, G., Zhang, L., Wang, T., and Jin, Z. (2016, January 12–17). Convolutional neural networks over tree structures for programming language processing. Proceedings of the AAAI Conference on Artificial Intelligence, Phoenix, AZ, USA.10.1609/aaai.v30i1.10139 ↗
23. Zhang, J., Wang, X., Zhang, H., Sun, H., Wang, K., and Liu, X. (2019, January 25–31). A novel neural source code representation based on abstract syntax tree. Proceedings of the 2019 IEEE/ACM 41st International Conference on Software Engineering (ICSE), Montréal, QC, Canada.10.1109/ICSE.2019.00086 ↗
24. Tufano, M., Watson, C., Bavota, G., Di Penta, M., White, M., and Poshyvanyk, D. (June, January 27). Deep learning similarities from different representations of source code. Proceedings of the 15th International Conference on Mining Software Repositories (MSR), Gothenburg, Sweden.
25. Allamanis, M., Brockschmidt, M., and Khademi, M. (May, January 30). Learning to represent programs with graphs. Proceedings of the 6th International Conference on Learning Representations, Vancouver, BC, Canada.
26. Zhou, Y., Liu, S., Siow, J., Du, X., and Liu, Y. (2019, January 8–14). Devign: Eective vulnerability identification by learning comprehensive program semantics via graph neural networks. Proceedings of the Advances in Neural Information Processing Systems, Vancouver, BC, Canada.
27. Duan, X., Wu, J., Ji, S., Rui, Z., Luo, T., Yang, M., and Wu, Y. (2019, January 10–16). VulSniper: Focus Your Attention to Shoot Fine-Grained Vulnerabilities. Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence, Macao, China.10.24963/ijcai.2019/648 ↗
28. Ben-Nun, T., Jakobovits, A.S., and Hoefler, T. (2018, January 3–8). Neural code comprehension: A learnable representation of code semantics. Proceedings of the Advances in Neural Information Processing Systems, Montréal, QC, Canada.
29. Using complexity metrics to improve software security10.1016/S1361-3723(13)70045-9 ↗
30. Hovsepyan, A., Scandariato, R., and Joosen, W. (2016, January 8–9). Is Newer Always Better? The Case of Vulnerability Prediction Models. Proceedings of the 10th ACM/IEEE International Symposium on Empirical Software Engineering and Measurement, Ciudad Real, Spain.10.1145/2961111.2962612 ↗
31. Shin, Y., and Williams, L. (2011, January 22). An initial study on the use of execution complexity metrics as indicators of software vulnerabilities. Proceedings of the 7th International Workshop on Software Engineering for Secure Systems, Waikiki, Honolulu, HI, USA.10.1145/1988630.1988632 ↗
32. Du, X., Chen, B., Li, Y., Guo, J., Zhou, Y., Liu, Y., and Jiang, Y. (2019, January 25–31). Leopard: Identifying vulnerable code for vulnerability assessment through program metrics. Proceedings of the 2019 IEEE/ACM 41st International Conference on Software Engineering (ICSE), Montreal, QC, Canada.10.1109/ICSE.2019.00024 ↗
33. Yamaguchi, F., Maier, A., Gascon, H., and Rieck, K. (2015, January 17–21). Automatic inference of search patterns for taint-style vulnerabilities. Proceedings of the 2015 IEEE Symposium on Security and Privacy, San Jose, CA, USA.10.1109/SP.2015.54 ↗
34. Yamaguchi, F., Wressnegger, C., Gascon, H., and Rieck, K. (2013, January 4–8). Chucky: Exposing missing checks in source code for vulnerability discovery. Proceedings of the 2013 ACM SIGSAC Conference on Computer & Communications Security, Berlin, Germany.10.1145/2508859.2516665 ↗
35. Detecting bugs by discovering expectations and their violations10.1109/TSE.2018.2816639 ↗
36. Automatic feature learning for predicting vulnerable software components10.1109/TSE.2018.2881961 ↗
37. Wang, S., Liu, T., and Tan, L. (2016, January 18–20). Automatically learning semantic features for defect prediction. Proceedings of the 2016 IEEE/ACM 38th International Conference on Software Engineering (ICSE), Austin, TX, USA.10.1145/2884781.2884804 ↗
38. Liu, S., Lin, G., Qu, L., Zhang, J., De Vel, O., Montague, P., and Xiang, Y. (2020). CD-VulD: Cross-Domain Vulnerability Discovery based on Deep Domain Adaptation. IEEE Trans. Dependable Secure Comput., PrePrints.
39. Lin, G., Zhang, J., Luo, W., Pan, L., De Vel, O., Montague, P., and Xiang, Y. (2019). Software vulnerability discovery via learning multi-domain knowledge bases. IEEE Trans. Dependable Secure Comput., Early access.
40. A comparative study of deep learning-based vulnerability detection system10.1109/ACCESS.2019.2930578 ↗
41. Li, Z., Zou, D., Xu, S., Chen, Z., Zhu, Y., and Jin, H. (2020). Vuldeelocator: A deep learning-based fine-grained vulnerability detector. arXiv.
42. Cho, K., Merrienboer, B.V., Gulcehre, C., Ba Hdanau, D., Bougares, F., and Schwenk, H. (2014, January 26–28). Learning phrase representations using rnn encoder-decoder for statistical machine translation. Proceedings of the 2014 Conference on Empirical Methods on Natural Language Processing, Doha, Qatar.10.3115/v1/D14-1179 ↗
43. (2020, December 28). SARD Manual, Available online: https://samate.nist.gov/index.php/SARD.html.
44. (2020, December 28). Clang: A C Language Family Frontend for LLVM. Available online: https://clang.llvm.org/.
45. (2020, December 28). Introduction of DG. Available online: https://github.com/mchalupa/dg.
46. (2020, December 29). Flawfinder Software Official Website. Available online: https://www.dwheeler.com/flawfinder/.