Skip to content

PW.5 Create Source Code by Adhering to Secure Coding Practices

Practice PW.5 of the Secure Software Development Framework (SSDF) version 1.1, in the group Produce Well-Secured Software (PW). The practice, task and example text and the SP 800-53 references are NIST’s, from the table published with SP 800-218 (February 2022, final).

Decrease the number of security vulnerabilities in the software, and reduce costs by minimizing vulnerabilities introduced during source code creation that meet or exceed organization-defined vulnerability severity criteria.

NIST lists one task for this practice. The examples under each are notional: no example or combination of examples is required, and they are not the only feasible options (SP 800-218, section 2).

Follow all secure coding practices that are appropriate to the development languages and environment to meet the organization’s requirements.

Notional implementation examples for PW.5.1
  • Example 1: Validate all inputs, and validate and properly encode all outputs.
  • Example 2: Avoid using unsafe functions and calls.
  • Example 3: Detect errors, and handle them gracefully.
  • Example 4: Provide logging and tracing capabilities.
  • Example 5: Use development environments with automated features that encourage or require the use of secure coding practices with just-in-time training-in-place.
  • Example 6: Follow procedures for manually ensuring compliance with secure coding practices when automated methods are insufficient or unavailable.
  • Example 7: Use tools (e.g., linters, formatters) to standardize the style and formatting of the source code.
  • Example 8: Check for other vulnerabilities that are common to the development languages and environment.
  • Example 9: Have the developer review their own human-readable code to complement (not replace) code review performed by other people or tools. See PW.7.

NIST’s table maps each task to SP 800-53 controls in the “SP80053” entries of its References column, which also maps tasks to other secure development documents (not listed here). Each control’s page lists the tasks that cite it under Methods.

TaskSP 800-53 references
PW.5.1None in NIST’s table

Independent guidance, not an official NIST publication. Control text is from NIST SP 800-53 Rev. 5 and SP 800-53A (public domain). Original content is licensed CC BY 4.0; program templates and the downloadable kit are dedicated to the public domain under CC0 1.0.