Why Security Matters
Security Fundamentals · Security Fundamentals track
5 min read
In this module
More Than Just Passwords
Security is a way of thinking that runs through every design decision, from which bits live in memory to how a web server handles a malformed request. Bolting it onto a finished system rarely works. This module covers the foundational concepts that underpin all of computer security.
The CIA Triad
Security professionals organise their goals around three core properties:
- Confidentiality - only authorised parties can read the data. Encryption is the primary tool here.
- Integrity - data has not been altered, either in storage or in transit. Hash functions and digital signatures help verify this.
- Availability - systems and data are accessible when needed. Denial-of-service attacks target this property.
Every security decision involves trade-offs among these three. A system that encrypts everything heavily is confidential but may sacrifice availability if the decryption process is too slow.
Real incidents tend to hit one property hardest, which makes the triad a useful way to sort them:
- Heartbleed (CVE-2014-0160, 2014) was a confidentiality failure. A missing length check in OpenSSL's heartbeat feature let anyone ask a server to echo back up to 64 KB of its memory per request, and that memory could hold private keys, session cookies and passwords. Nothing was changed or taken offline; secrets simply leaked.
- Stuxnet (discovered in 2010) attacked integrity. It rewrote the code on industrial controllers driving uranium centrifuges so they spun at damaging speeds, while showing operators readings that looked normal.
- WannaCry (2017) went after availability. The ransomware encrypted files on hundreds of thousands of Windows machines and demanded payment for the key; hospitals in England's NHS cancelled appointments because their systems were unusable.
Predict: which property does each of these break? (a) A bug lets any logged-in user read other users' private messages. (b) A botnet floods a shop's website with traffic on its busiest day. (c) Someone edits a bank transfer in transit, changing the destination account. (d) A stolen laptop holds an unencrypted customer database.
(a) Confidentiality: data reached people who weren't authorised to read it. (b) Availability: the site works fine, it just can't answer real customers. (c) Integrity: the data arrived, but not as it was sent. (d) Confidentiality again, and a good example of a defence that's cheap to have in place before the incident: full-disk encryption would have turned the theft into a hardware loss.
Plenty of real attacks touch more than one. Ransomware gangs now often copy data before encrypting it, so a single incident is both an availability and a confidentiality breach.
A threat model is a structured way of thinking about what you are protecting, who might attack it, and how. Before choosing security measures, you need to understand your attack surface - every point where an attacker could interact with your system. A larger attack surface means more potential vulnerabilities.
Attack Surfaces
Consider a simple web application. Its attack surface spans the network connection, HTTP endpoints, database queries, login form, and the memory layout of the server process itself. Every one of those is a door an attacker might try.
Here's that app as a sketch of a threat model: each entry point, one classic attack against it, and the defence that narrows it.
Shrinking the attack surface is a foundational security strategy. Don't need a feature? Remove it. Port unused? Close it. Data you don't have to store? Don't store it.
Worked Example: Threat-Modelling a To-Do App
Take a small to-do list app: users sign up, log in, and keep private lists. A threat model starts with four questions.
- What are we protecting? Each user's lists, the stored password hashes, and the session cookies that prove who's logged in.
- Who might attack? A stranger on the internet, a logged-in user poking at other people's data, and someone with access to the server or its backups.
- Where can they get in? The entry points in the diagram above: the network, the login form, the HTTP endpoints, the database behind them.
- What stops them? One defence per threat, chosen because of a specific risk.
Now walk one threat through. Lists are fetched with GET /lists/1042. A logged-in user changes the number to 1043 and gets someone else's list back, because the server checked that the request had a valid session but never checked that list 1043 belonged to that session's user. That's a confidentiality failure, and its fix is a single server-side ownership check on every request. (It's common enough to have a name: broken object-level authorisation.) Questions 1 and 2 are what surface it: once "other logged-in users" is on the list of attackers, you go looking for places where one user's request can name another user's data.
Why Low-Level Knowledge Helps
Many of the most dangerous vulnerabilities - buffer overflows, use-after-free bugs, integer overflows - exist because programs interact with memory and hardware in unsafe ways. You have already learned about memory layout, the stack, and integer overflow. In the coming lessons, you will see how attackers exploit these low-level details and how understanding them makes you a better, more security-conscious developer.