Small Mistakes with Big Impacts: A Study on Secure Coding Practices in Java Open Source Projects
摘要
Programmers often reuse code, enhancing their efficiency but also potentially introducing security risks, especially when sourced from online forums or open-source projects. By deploying secure coding best practices the aim is to minimize in-code vulnerabilities, yet their adoption remains inconsistent. This paper investigates the prevalence of key Java secure coding best practices—securing PRNG seeds, using secure PRNGs, and handling passwords securely—in open-source projects. We propose a scoring and penalty model to evaluate repositories based on these practices and provide a comprehensive analysis of their real-world adoption. Our findings are supported by statistical correlation and regression analysis, linking best practices adherence to GitHub repository meta-data. Our study reveals significant gaps in secure coding practices and underscores the need for improved security awareness and implementation among developers, hence we propose a set of recommendations to mitigate these risks. By addressing these issues, we aim to enhance the predictability and security of Java development projects.