arrow
返回

A Study of C/C plus plus Code Weaknesses on Stack Overflow

delete2022-07-01
delete19
PRE
AI
H
Haoxiang Zhang
S
Shaowei Wang *
H
Heng Li
T
Tse-Hsun Chen
A
Ahmed E. Hassan
DOI:10.1109/TSE.2021.3058985delete
delete原文链接
delete原文求助
delete分享
delete收藏
摘要

摘要

En 中文
Stack Overflow hosts millions of solutions that aim to solve developers' programming issues. In this crowdsourced question answering process, Stack Overflow becomes a code hosting website where developers actively share its code. However, code snippets on Stack Overflow may contain security vulnerabilities, and if shared carelessly, such snippets can introduce security problems in software systems. In this paper, we empirically study the prevalence of the Common Weakness Enumeration- CWE, in code snippets of C/C++ related answers. We explore the characteristics of Code(w) , i.e., code snippets that have CWE instances, in terms of the types of weaknesses, the evolution of Code(w), and who contributed such code snippets. We find that: 1) 36 percent (i.e., 32 out of 89) CWE types are detected in Code(w) on Stack Overflow. Particularly, CWE-119, i.e., improper restriction of operations within the bounds of a memory buffer, is common in both answer code snippets and real-world software systems. Furthermore, the proportion of Code(w )doubled from 2008 to 2018 after normalizing by the total number of C/C++ snippets in each year. 2) In general, code revisions are associated with a reduction in the number of code weaknesses. However, the majority of Code(w) had weaknesses introduced in the first version of the code, and these Code(w) were never revised since then. Only 7.5 percent of users who contributed C/C++ code snippets posted or edited code with weaknesses. Users contributed less code with CWE weakness when they were more active (i.e., they either revised more code snippets or had a higher reputation). We also find that some users tended to have the same CWE type repeatedly in their various code snippets. Our empirical study provides insights to users who share code snippets on Stack Overflow so that they are aware of the potential security issues. To understand the community feedback about improving code weaknesses by answer revisions, we also conduct a qualitative study and find that 62.5 percent of our suggested revisions are adopted by the community. Stack Overflow can perform CWE scanning for all the code that is hosted on its platform. Further research is needed to improve the quality of the crowdsourced knowledge on Stack Overflow.
Keyword:
Code security
C/C plus
empirical software engineering
crowdsourced knowledge sharing and management
stack overflow
AI总结

AI总结

对已上传原文的论文进行重点信息的提取,主要内容包括:简要概述、研究摘要、背景介绍、关键亮点、图文解析、展望与总结。

期刊

IEEE Transactions on Software Engineering 封面图
IEEE Transactions on Software Engineering
IF:
5.6
论文数:
2.9K
被引数:
1.1W

机构

H
huawei technologies
学者数:
3.3K
论文数: 2.9K
被引数: 1
U
universite de montreal
学者数:
4.6W
论文数: 3.8W
被引数: 46
U
University of Manitoba
学者数:
1.9W
论文数: 1.7W
被引数: 18
C
concordia university - canada
学者数:
8.0K
论文数: 8.9K
被引数: 4
P
Polytechnique Montreal
学者数:
3.7K
论文数: 3.4K
被引数: 42
学者 查看更多机构
引用论文

引用论文

err分享
err收藏
The substrate specificity of SARS coronavirus 3C-like proteinase
err2005-04-01
err0
errOAAI
errKeqiang Fan; Liang Ma; Xiaofeng Han; Huanhuan Liang; Ping Wei; Ying Liu; Luhua Lai
err分享
err收藏
学者 查看更多内容