Build without holes.
Security for people who build software: see each attack happen on a fake app, flip the switch to the secure version and understand why it works. Everything runs in your browser against simulated targets.
Everything here is for learning to defend your own software. Never test systems you don't own or aren't authorized to test.
Today
π₯ 0
day streak
β‘ 0
XP
Answer a quiz to start your streak.
Badges
Your XP, streak and badges are shared by every playbook.
Your learning path
Follow the modules in order, then study real breaches and practise on the labs. Each lesson ends with a quick quiz, and completed units turn green.
- 00
Unit 0 Β· 0/4 done
Fundamentals
How to think about security before writing code.
- 01
Unit 1 Β· 0/6 done
Web vulnerabilities
The classic web holes: injection, XSS, CSRF, SSRF, access control.
- 02
Unit 2 Β· 0/5 done
Authentication & sessions
Passwords, tokens, sessions and MFA done right.
- 03
Unit 3 Β· 0/3 done
Crypto for developers
Hashing, encryption, TLS and keeping secrets secret.
- 04
Unit 4 Β· 0/3 done
APIs & mobile
APIs, CORS and mobile apps you can't trust.
- 05
Unit 5 Β· 0/3 done
Cloud & supply chain
Buckets, dependencies and the pipeline that ships your code.
- 06
Unit 6 Β· 0/3 done
Operations
Seeing attacks, responding to them and recovering.
- 07
Unit 7 Β· 0/3 done
AI applications
Prompt injection and keeping AI agents on a leash.
- 08
Unit 8 Β· 0/6 done
Real breaches
Six public incidents broken into their attack chain.
- 09
Unit 9 Β· Ready
Hands-on practice
Attack a fake shop, review vulnerable code and threat-model real architectures.
- β
Learn by breaking (safely)
Each concept shows the attack on a simulated app and the defence that stops it.
Fundamentals
4 conceptsThreat modeling
Threat modeling is answering four questions: what are we building, what can go wrong, what are we going to do about it, and did we do a good job?
8 min read βAuthN vs AuthZ
Authentication answers *who are you?* Authorization answers *are you allowed to do this, to this thing, right now?* Most breaches of web apps are the second one missing.
6 min read βLeast privilege
Assume something will get hacked. Least privilege makes sure that when it does, the attacker gets the keys to one room, not the whole building.
6 min read βDefense in depth
Every control has holes. Line up several independent ones and the holes rarely align: the Swiss cheese model.
6 min read βWeb vulnerabilities
6 conceptsSQL injection
If user input is concatenated into a query, a single quote turns data into SQL. Parameterized queries keep data and code apart, so the attacker's text is only ever text.
8 min read βXSS
XSS is injection into HTML instead of SQL. Escape output by default, never inject raw HTML, and add a Content Security Policy as the safety net.
8 min read βCSRF
Cookies prove which browser sent a request, not which site asked for it. SameSite cookies and CSRF tokens tell your server the request really came from your own pages.
6 min read βSSRF
Your server sits inside your network. If a user picks the URL it fetches, they borrow that position. Allowlist destinations, block private addresses after DNS resolution, and lock down cloud metadata.
7 min read βAccess control & IDOR
If `/api/orders/1042` works for a user who doesn't own order 1042, that's an IDOR. Every query that loads a record by ID must also filter by who's asking.
7 min read βPath traversal
Never let user input decide a filesystem path. Map IDs to files, or resolve the full path and check it's still inside the allowed folder.
5 min read βAuthentication & sessions
5 conceptsPassword storage
Never store passwords, store slow, salted hashes made with Argon2id or bcrypt. MD5 and SHA-256 are built to be fast, and fast is exactly what an attacker with GPUs wants.
7 min read βJWT
A JWT is base64, not encryption: anyone can read it. Its signature only proves the server issued it, and only if you verify it with a fixed algorithm and check the expiry.
8 min read βSessions & cookies
A session cookie is as good as a password while it's valid. Ship it as HttpOnly; Secure; SameSite=Lax, keep it short-lived, and rotate it on login and privilege changes.
7 min read βBrute force & rate limits
Limit guesses per IP and per account, slow down rather than lock out, block known breached passwords, and require MFA so a correct guess still isn't enough.
6 min read βMFA & passkeys
Any MFA beats a password alone. But only phishing-resistant methods, passkeys and security keys, stop a real-time phishing proxy, because the browser checks the domain instead of trusting the human.
7 min read βCrypto for developers
3 conceptsHash vs encrypt vs encode
Encoding changes format and hides nothing. Hashing is one-way and proves integrity. Encryption is reversible with a key and provides confidentiality. Pick by the guarantee you need.
6 min read βTLS
TLS gives you confidentiality, integrity and server authentication. Without validating the certificate you get encryption with whoever is in the middle.
6 min read βSecrets management
A secret in a repo is leaked, even after you delete it. Keep secrets in a vault or the platform's secret store, scan before push, scope every key, and revoke first, investigate second.
6 min read βAPIs & mobile
3 conceptsAPI data exposure
Decide on the server which fields each audience may see and change, return only those, and authorize every object and every property.
6 min read βCORS
CORS decides which other websites can read your responses from a user's browser. Never reflect any Origin with Allow-Credentials: true, and remember CORS is not authentication.
6 min read βMobile secure storage
Keep user tokens in the Keychain / Keystore, never ship real secrets in the app (the binary is public), and treat every request from the app as untrusted input.
5 min read βCloud & supply chain
3 conceptsPublic buckets & IAM
Turn on Block Public Access for the whole account, share files with short-lived signed URLs, and give every workload an IAM role scoped to its own resources.
5 min read βSupply chain
Pin versions with a lockfile and npm ci, restrict install scripts, review new dependencies and updates, keep an SBOM, and give your build as few secrets as possible.
7 min read βCI/CD security
Treat PRs from forks as untrusted code, pin actions to a commit SHA, use OIDC instead of stored cloud keys, and gate deploys behind protected branches and reviewers.
6 min read βOperations
3 conceptsLogging & alerting
Log security events (auth, permission changes, exports), alert on a small set of high-signal patterns, and ship logs to an append-only store outside the servers they describe.
6 min read βIncident response
Declare early, contain first, preserve evidence, communicate honestly, learn without blame. And write it down before you need it.
6 min read βBackups & ransomware
Keep at least one backup that is immutable or offline under separate credentials (3-2-1), and test restores regularly so recovery is a procedure, not an experiment.
5 min read βAI applications
3 conceptsPrompt injection
To a language model, everything is instructions. Assume any text it reads can hijack it, and limit what a hijacked model is able to do.
8 min read βLLM data exfiltration
If your chat UI auto-loads images from any domain, an injected prompt can put private data in an image URL and the browser will deliver it to the attacker. Control the output channels and limit what data the model sees.
6 min read βAgent permissions
An agent's blast radius is its tools Γ their scopes Γ whether anyone approves. Grant the minimum for the task, scope tokens to the user, and confirm anything irreversible.
6 min read βLabs: attack a fake app, then fix it
A simulated browser with DevTools against an in-browser fake shop. Pull off the attack, deploy the patch, watch it fail.
Read someone else's order
Change one number in the URL and see a stranger's address and phone.
3 min βLog in as the admin without a password
A login form that builds its SQL by pasting strings together.
4 min βSteal the moderator's session
Reviews are rendered as raw HTML, and an admin reads every new one.
4 min βPromote yourself to admin
The profile form only has name and avatar. The API saves whatever it gets.
4 min βThreat modeling challenges
Real architectures from the System Design Playbook. Tap components and data flows, pick the STRIDE threat, then choose the mitigation.
Threat model a URL shortener
Anyone on the internet can create links and every redirect is public. Find 5 threats in this 1M-user design.
5 STRIDE βThreat model a file storage service
Users upload any file, sync it across devices and share it by link. Find 5 threats in this design.
5 STRIDE βThreat model a ride-hailing app
Riders, drivers and money meet in real time, and drivers' phones report their own location. Find 5 threats.
5 STRIDE βFind the bug
Short code reviews: spot the vulnerable line, name the problem and pick the fix.
const rows = await db.query( `SELECT id, hash FROM users WHERE email = '${email}'` );
Real breaches, step by step
Public incidents broken into their attack chain. Switch on the controls that were missing and see where the attack would have stopped.
Equifax: one unpatched server, 147 million people
A known vulnerability in Apache Struts, with a patch already available, gave attackers a foothold in a consumer dispute portal. From there they found credentials, reached dozens of databases and pulled data out for weeks without being noticed.
Break the chain βCapital One: SSRF to cloud credentials to S3
A misconfigured web application firewall could be tricked into making requests on the attacker's behalf. It fetched the cloud instance's metadata, which handed out temporary credentials for a role that could read far more storage than it needed.
Break the chain βSolarWinds: a backdoor shipped as a signed update
Attackers got into the build environment of the Orion IT monitoring product and inserted a backdoor during compilation. The resulting update was signed with the company's own certificate and installed by thousands of customers.
Break the chain βTest yourself
Did it stick?
Every concept and breach ends with 3 quick questions. When you've read them all, take the final lesson: new questions about every page, one after another, with hearts and streaks.
Let's talk
Got a project or an idea?
Products, teams, mentoring or collaborations: write to me and we'll take it from there.