Lune

S&P2024Top-tier venue

Measuring the Effects of Stack Overflow Code Snippet Evolution on Open-Source Software Security

Alfusainey Jallow, Michael Schilling, Michael Backes, Sven Bugiel

Abstract

This paper assesses the effects of Stack Overflow code snippet evolution on the security of open-source projects. Users on Stack Overflow actively revise posted code snippets, sometimes addressing bugs and vulnerabilities. Accordingly, developers that reuse code from Stack Overflow should treat it like any other evolving code dependency and be vigilant about updates. It is unclear whether developers are doing so, to what extent outdated code snippets from Stack Overflow are present in GitHub projects, and whether developers miss security-relevant updates to reused snippets.To shed light on those questions, we devised a method to 1) detect outdated code snippets versions from 1.5M Stack Overflow snippets in 11,479 popular GitHub projects and 2) detect security-relevant updates to those Stack Overflow code snippets not reflected in those GitHub projects. Our results show that developers did not update dependent code snippets when those evolved on Stack Overflow. We found that 2,405 code snippet versions reused in 2,109 GitHub projects were outdated, with 43 projects missing fixes to bugs and vulnerabilities on Stack Overflow. Those 43 projects containing outdated, insecure snippets were forked on average 1,085 times (max. 16,121), indicating that our results are likely a lower bound for affected code bases. An important insight from our work is that treating Stack Overflow code as purely static code impedes holistic solutions to the problem of copying insecure code from Stack Overflow. Instead, our results suggest that developers need tools that continuously monitor Stack Overflow for security warnings and code fixes for reused code snippets and not only warn during copy-pasting.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

2 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Keep me Updated: An Empirical Study of Third-Party Library Updatability on Android cites Reliable Third-Party Library Detection in Android and its Security Applications
  • Keep me Updated: An Empirical Study of Third-Party Library Updatability on Android cites Thou Shalt Not Depend on Me: Analysing the Use of Outdated JavaScript Libraries on the Web
  • Stack Overflow Considered Harmful? The Impact of Copy&Paste on Android Application Security cites You Get Where You're Looking for: The Impact of Information Sources on Code Security
  • Stack Overflow Meets Replication: Security Research Amid Evolving Code Snippets cites Stack Overflow Considered Harmful? The Impact of Copy&Paste on Android Application Security
  • Stack Overflow Meets Replication: Security Research Amid Evolving Code Snippets cites You Get Where You're Looking for: The Impact of Information Sources on Code Security
  • Mapping the Cloud: A Mixed-Methods Study of Cloud Security and Privacy Configuration Challenges cites Stack Overflow Considered Harmful? The Impact of Copy&Paste on Android Application Security
  • Mapping the Cloud: A Mixed-Methods Study of Cloud Security and Privacy Configuration Challenges cites You Get Where You're Looking for: The Impact of Information Sources on Code Security
  • Thou Shalt Not Depend on Me: Analysing the Use of Outdated JavaScript Libraries on the Web cites Reliable Third-Party Library Detection in Android and its Security Applications
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers2

  1. Mapping the Cloud: A Mixed-Methods Study of Cloud Security and Privacy Configuration ChallengesSumair Ijaz Hashmi, Shafay Kashif, Lea Gröber, Katharina Krombholz et al.NDSS 2026 · 3 citations
  2. Stack Overflow Meets Replication: Security Research Amid Evolving Code SnippetsAlfusainey Jallow, Sven BugielUSENIX Security 2025

Builds on7

  1. Reliable Third-Party Library Detection in Android and its Security ApplicationsMichael Backes, Sven Bugiel, Erik DerrCCS 2016 · 345 citations
  2. You Get Where You're Looking for: The Impact of Information Sources on Code SecurityYasemin Acar, Michael Backes, Sascha Fahl, Doowon Kim et al.S&P 2016 · 325 citations
  3. Stack Overflow Considered Harmful? The Impact of Copy&Paste on Android Application SecurityFelix Fischer, Konstantin Böttinger, Huang Xiao, Christian Stransky et al.S&P 2017 · 293 citations
  4. Keep me Updated: An Empirical Study of Third-Party Library Updatability on AndroidErik Derr, Sven Bugiel, Sascha Fahl, Yasemin Acar et al.CCS 2017 · 196 citations
  5. Thou Shalt Not Depend on Me: Analysing the Use of Outdated JavaScript Libraries on the WebTobias Lauinger, Abdelberi Chaabane, Sajjad Arshad, William Robertson et al.NDSS 2017 · 183 citations

Related papers

  1. Unveiling the Characteristics and Impact of Security Patch EvolutionZifan Xie, Ming Wen, Zichao Wei, Hai JinASE 2024 · 2 citations
  2. The Effectiveness of Security Interventions on GitHubFelix Fischer, Jonas Höbenreich, Jens GrossklagsCCS 2023 · 4 citations
  3. How Bad Can It Git? Characterizing Secret Leakage in Public GitHub RepositoriesMichael Meli, Matthew R. McNiece, Bradley ReavesNDSS 2019 · 130 citations
  4. Centris: A Precise and Scalable Approach for Identifying Modified Open-Source Software ReuseSeunghoon Woo, Sunghan Park, Seulbae Kim, Heejo Lee et al.ICSE 2021 · 2 citations
  5. Code Cloning in Solidity Smart Contracts: Prevalence, Evolution, and Impact on DevelopmentRan Mo, Haopeng Song, Wei Ding, Chaochao WuICSE 2025 · 1 citation
Dusk over the sea between two cliffs drawn in fine vertical lines