Secure coding is a critical yet often overlooked practice in software development. Despite extensive awareness efforts, real-world adoption remains inconsistent due to organizational, educational, and technical barriers. This paper provides a comprehensive review of secure coding practices across major frameworks and domains, including web development, DevSecOps, and cloud security. It introduces a structured framework comparison and categorizes threats aligned with the OWASP Top 10. Additionally, we explore the rising role of Large Language Models (LLMs) in evaluating and recommending secure code, presenting a reproducible case study across four major vulnerability types. This paper offers practical insights for researchers, developers, and educators on integrating secure coding into real-world development processes.
翻译:安全编码是软件开发中至关重要却常被忽视的实践。尽管已有广泛的意识提升努力,但由于组织、教育和技术层面的障碍,其在现实应用中的采纳仍不均衡。本文全面综述了主流框架和领域(包括Web开发、DevSecOps与云安全)中的安全编码实践,提出了结构化框架对比方法,并依据OWASP Top 10对威胁进行分类。此外,我们探讨了大语言模型在评估和推荐安全代码方面日益重要的作用,通过涵盖四种主要漏洞类型的可复现案例研究进行实证分析。本文为研究人员、开发者和教育工作者提供了将安全编码整合到实际开发流程中的实践洞见。