Secure App 5
Here is your Teaching Note, Quiz, and Answer Key for Section 5: Detailed Design for Secure Systems from the Fundamentals of Secure Application Development course.
🧑‍🏫 Teaching Note – Section 5: Detailed Design for Secure Systems
🎯 Learning Objectives
By the end of this section, students should be able to:
- Understand how insecure detailed design decisions lead to vulnerabilities.
- Apply 8 classic secure design principles to software design.
- Mitigate known issues such as TOCTOU and input validation flaws.
- Recognize the value of security-focused design reviews.
đź§ Lesson Plan Outline (60 minutes)
1. Kick-off Discussion (5 min)
- Ask: "What’s more dangerous: a coding error or a design flaw?"
- Explain: Many vulnerabilities originate from how the design was conceived, not just coding mistakes.
2. 8 Secure Design Principles (15 min)
3. Wrappers & Handling Unsafe Components (10 min)
- Define “wrappers” for unsafe legacy or third-party components.
- Emphasize risk mitigation when ideal secure components aren’t available.
4. Input Validation Design (10 min)
- Four steps: canonicalization → normalization → sanitization → validation.
- Teach whitelisting > blacklisting.
- đź’¬ Activity: Show an example of insecure and secure input design.
5. TOCTOU and Related Timing Vulnerabilities (10 min)
- Define TOCTOU, TOATOU, TORTOU.
- Demonstrate how these non-atomic operations create race conditions.
- Explain real-world security incidents caused by these bugs.
6. Secure Design Reviews (10 min)
- Discuss peer reviews, architecture review, QA checks, and why they're worth the cost.
📝 Quiz – Section 5: Detailed Secure Design
đź§ Multiple Choice
Which principle advises that systems should grant no access by default?
A. Open design
B. Fail-safe defaults
C. Least privilege
D. Separation of privilege
A wrapper program is used to:
A. Improve UI design
B. Log user activity
C. Block unwanted cookies
D. Protect against flaws in known-vulnerable components
Canonicalization in input validation refers to:
A. Logging input sources
B. Reducing input to a standard known form
C. Encrypting user input
D. Blocking all special characters
TOCTOU is a type of vulnerability caused by:
A. Improper password storage
B. Weak encryption algorithms
C. Timing issues between a check and a use
D. Buffer overflows in runtime libraries
Which principle emphasizes designing software so users can use it securely without effort?
A. Separation of privilege
B. Economy of mechanism
C. Psychological acceptability
D. Open design
âś… True/False
- ___ The “Open Design” principle suggests that keeping design secret improves security.
- ___ TOCTOU can allow attackers to modify objects between validation and use.
- ___ Whitelisting is generally preferred over blacklisting in input validation.
- ___ Design flaws are usually easier to fix than coding bugs.
- ___ Design reviews should be conducted only by the original developer.
✏️ Short Answer
- Name two secure design principles and explain how they help avoid vulnerabilities.
- Give one real-world example where a wrapper could help protect a system.
- What’s the danger of non-atomic operations in security-sensitive designs?
- Describe a simple input validation strategy that incorporates canonicalization and whitelisting.
- Why are secure design reviews considered a good investment?
✅ Answer Key – Section 5 Quiz
Multiple Choice
- B
- D
- B
- C
- C
True/False
- False
- True
- True
- False
- False
Short Answer – Sample Answers
11.
- Least Privilege: Limits access to only what’s necessary, reducing risk of misuse.
- Fail-Safe Defaults: Denies access unless explicitly allowed, minimizing unintentional exposure.
12.
Wrapping a legacy file-upload component to check file types, sizes, and sanitize filenames before the upload is processed.
13.
Because a malicious actor can change the object after the system checks it but before it uses it—leading to unauthorized actions.
14.
Take input, convert to standard form (e.g., file path without ..), check only allowed characters (e.g., letters, numbers), reject anything else.
15.
Because design-level changes prevent classes of vulnerabilities early—fixing them later is much more expensive and risky.
Would you like a visual classroom handout or checklist version of the 8 design principles or input validation flow?