🚀 Submit a Challenge — SecDim AppSec Village CTF at DEF CON 34 and Win a ROG Xbox Ally

Defensive Programming 4th Core Principle

50mBeginnerSecure Design

The fourth principle of defensive programming addresses a common issue: the mutability of a program's states, which can lead to unforeseen security bugs. Often, a program's state is mutable due to coding convenience. However, this convenience comes at the heavy cost of security vulnerabilities. We will first formalise this issue, then define the principle, followed by two implementation techniques.

Topics

  1. Anti patterns

    Lesson15m

    Mutable objects and non-atomic operations can result in security vulnerabilities. Mutable variables can lead to unexpected changes in the state and race conditions, let's explore how to resolve this.

  2. Principle

    Lesson5m

    Lets look at some ways to implement immutability and ensuring data integrity, availability, and thread safety.

  3. First Implementation Technique

    Lesson15m

    Let's explore a technique for ensuring an object remains unchanged within the code and protect it against unexpected state changes in multi-threaded environments.

  4. Second Implementation Technique

    Lesson15m

    Let's discuss a concept which can be context-dependent.