An Empirical Study of C++ Vulnerabilities in Crowd-Sourced Code Examples
Not on the map. Why?
Abstract (arXiv)
Software developers share programming solutions in Q&A sites like Stack Overflow. The reuse of crowd-sourced code snippets can facilitate rapid prototyping. However, recent research shows that the shared code snippets may be of low quality and can even contain vulnerabilities. This paper aims to understand the nature and the prevalence of security vulnerabilities in crowd-sourced code examples. To achieve this goal, we investigate security vulnerabilities in the C++ code snippets shared on Stack Overflow over a period of 10 years. In collaborative sessions involving multiple human coders, we manually assessed each code snippet for security vulnerabilities following CWE (Common Weakness Enumeration) guidelines. From the 72,483 reviewed code snippets used in at least one project hosted on GitHub, we found a total of 69 vulnerable code snippets categorized into 29 types. Many of the investigated code snippets are still not corrected on Stack Overflow. The 69 vulnerable code snippets found in Stack Overflow were reused in a total of 2859 GitHub projects. To help improve the quality of code snippets shared on Stack Overflow, we developed a browser extension that allow Stack Overflow users to check for vulnerabilities in code snippets when they upload them on the platform.
Key facts. Cited by 7 papers in the map (data through 7 Oct 2026). First posted on arXiv 3 Oct 2019.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2022: 3; 2023: 0; 2024: 2; 2025: 1; 2026: 1.
7 papers.
- 2022A Systematic Evaluation of Large Language Models of Codecited by 360
- 2022Execution-Based Evaluation for Open-Domain Code Generationcited by 89
- 2024Bugs in Large Language Models Generated Code: An Empirical Studycited by 59
- 2022MCoNaLa: A Benchmark for Code Generation from Multiple Natural Languagescited by 41
- 2025Why Attention Fails: A Taxonomy of Faults in Attention-Based Neural Networkscited by 1
- 2024Ocassionally Secure: A Comparative Analysis of Code Generation Assistantscited by 0
- 2026AdaptAgent: A Multi-agent, Domain-Guided Reasoning Framework for Code Adaptationcited by 0
- 2026AdaptAgent: A Multi-agent, Domain-Guided Reasoning Framework for Code Adaptation5 Aug 2026
- 2025Why Attention Fails: A Taxonomy of Faults in Attention-Based Neural Networks6 Aug 2025
- 2024Bugs in Large Language Models Generated Code: An Empirical Study13 Mar 2024
- 2024Ocassionally Secure: A Comparative Analysis of Code Generation Assistants1 Feb 2024
- 2022Execution-Based Evaluation for Open-Domain Code Generation20 Dec 2022
- 2022MCoNaLa: A Benchmark for Code Generation from Multiple Natural Languages16 Mar 2022
- 2022A Systematic Evaluation of Large Language Models of Code26 Feb 2022