Secure coding practices
The rules developers follow so code resists attack: validating input, encoding output, separating data from commands, safe error handling, avoiding unsafe functions and keeping secrets out of code.
Secure coding practices are the rules and habits that keep common weaknesses out of source code. NIST SP 800-218, the Secure Software Development Framework (version 1.1, with a revision in draft since December 2025), makes following them a task in its own right (PW.5.1); its examples include validating all inputs, validating and encoding all outputs, avoiding unsafe functions and calls, and detecting and handling errors gracefully. Other widely used sources are the SEI CERT coding standards, for languages such as C, C++ and Java, and OWASP’s secure coding checklist, now archived into the OWASP Developer Guide.
The core practices map onto weakness families: input validation against an allowlist, output encoding suited to the context, parameterised queries that keep data apart from commands, safe error handling, bounded memory operations or a memory-safe language, and credentials held in secrets management rather than embedded in code. An organisation adopts these as a coding standard and checks adherence through code review and static analysis. The OWASP Top 10 is an awareness list, not a coding standard.
Exam relevance: the ISC2 exam outline names secure coding practices under objective 8.5. A scenario is likely to describe a flaw and ask for the practice that prevents it, and candidates are expected to see that a coding standard needs review and testing behind it.