SECURE-SOFTWARE-DESIGN practice question 3 of 25

What is a best practice of secure coding?

Full set: 118 questions

Domain Secure Software Design Principles and Practices

Answer options
A: Planning
B: Session management Correct answer
C: User acceptance testing
D: Microservices
Correct Answer:
B. Session management
Explanation

Secure session management is a critical best practice of secure coding. It involves the correct implementation of mechanisms to handle the life cycle of a user's session, from login to logout. Developers must write code that generates strong, unpredictable session identifiers, protects them in transit and at rest, and properly invalidates them upon termination. Failure to implement secure session management can lead to severe vulnerabilities such as session hijacking, session fixation, and cross-site request forgery (CSRF), allowing attackers to impersonate legitimate users and gain unauthorized access to the system.

Why Incorrect

A. Planning is a high-level phase in the software development lifecycle (SDLC) that precedes coding; it is not a coding practice itself.
C. User acceptance testing is a validation phase that occurs after coding is complete to ensure the software meets business requirements.
D. Microservices is an architectural style for structuring an application. While it has security implications, it is not a specific coding practice.

References

1. OWASP Application Security Verification Standard (ASVS) v4.0.3, Section V3: Session Management Verification Requirements. The standard dedicates an entire section to the requirements for securely implementing session management at the application level, establishing it as a core secure development practice.

2. OWASP Top 10: 2021, A07:2021-Identification and Authentication Failures. This category explicitly states that weaknesses related to session management, such as session identifiers not being invalidated after logout, are a primary cause of authentication failures. This highlights its importance in secure coding.

3. NIST Special Publication 800-218, Secure Software Development Framework (SSDF) Version 1.1, Section 4, Practice PW.8: "Conform to secure coding practices." The details of this practice include following standards for specific security concerns, of which session management is a well-established example.

4. Saltzer, J. H., & Schroeder, M. D. (1975). The Protection of Information in Computer Systems. Communications of the ACM, 18(7), 387-408. While a foundational text, its principles, such as complete mediation and least privilege, directly inform modern secure coding practices like validating session state on every request (a key part of secure session management). (DOI: https://doi.org/10.1145/360813.360818)

Scroll to Top