Security
The security basics AI-built apps skip — secrets, logins, row-level security, bot abuse — and the isolation that keeps untrusted code contained.
140 posts · page 4 of 6
What Is an API Key? A Plain-English Guide (With Claude and ChatGPT Examples)
An API key is a password for software. What API keys are, how they're different from your login, how to get one for Claude or OpenAI, where to keep it, why it must never be in your frontend code, and what to do if one leaks.
What Is a DDoS Attack? A Plain-English Guide for Website Owners
A DDoS attack floods a website with traffic until real visitors can't get through. How DDoS attacks work, the main types, how likely a small site is to be hit, what DDoS protection actually does, and the cheap steps that protect a small app.
Two-Factor Authentication Explained (and How to Add It to Your App)
What two-factor authentication is, how authenticator-app codes (TOTP) work, why SMS codes are the weakest option, where passkeys fit, and how to add 2FA to your own app — including recovery codes and the mistakes to avoid.
Session Cookies vs JWTs: Which Should Your App Use for Authentication?
Server-side sessions and JWTs both keep users logged in, with very different trade-offs. How each works, revocation and logout, where to store tokens (cookies vs localStorage), the hybrid access/refresh pattern, and a clear default for web apps.
HTTP Security Headers Explained: HSTS, CSP, and the Rest (With a Copy-Paste Setup)
A practical guide to the HTTP security headers worth setting: Strict-Transport-Security, Content-Security-Policy, X-Content-Type-Options, frame protection, Referrer-Policy and Permissions-Policy — what each prevents, safe values, a Next.js and Nginx config, and which old headers to drop.
Role-Based Access Control (RBAC) for Your App: A Practical Guide
How to add roles and permissions to a web app without making a mess: roles vs permissions, a simple database schema, checking permissions on the server, multi-tenant roles per organisation, enforcing in the UI and the API, and testing it.
Password Reset and Email Verification Flows Done Right
Password resets are one of the most attacked parts of any app. How to build reset and email-verification flows securely: token generation and hashing, expiry, account enumeration, host header poisoning, invalidating sessions, and the UX details that reduce support tickets.
The OWASP Top 10 (2025) Explained for Beginners and App Builders
The OWASP Top 10 is the most widely used list of web application security risks. All ten 2025 categories in plain English — from broken access control to supply chain failures — with what each looks like in an AI-built app and how to prevent it.
npm audit Explained: What the Warnings Mean and What to Actually Do
"found 14 vulnerabilities (3 moderate, 2 high)" — should you panic? How npm audit works, what the severity levels mean, why npm audit fix sometimes does nothing, why --force is risky, and how to tell real risks from noise.
Mixed Content Errors: Why Your HTTPS Site Loads Things Over HTTP (and How to Fix It)
"Mixed Content: The page was loaded over HTTPS, but requested an insecure resource." What mixed content is, why browsers block it, how to find every http:// URL, and the fixes — including apps behind a proxy that generate http links.
Magic Link Login: How Passwordless Email Sign-In Works (and Its Pitfalls)
Magic links let people log in by clicking a link in their email — no password. How they work, when they're a good fit, the security details that matter (expiry, single use, token hashing), and the real-world problems: spam filters, email scanners and phones vs laptops.
Linux File Permissions Explained: chmod 755, 644, and "Permission Denied"
What rwxr-xr-x means, how chmod numbers like 755, 644 and 600 work, chmod +x for scripts, chown, the correct permissions for SSH keys, and why chmod 777 is never the right fix for "Permission denied".
What Is IDOR? The Security Bug Where Users Can See Each Other's Data
IDOR (insecure direct object reference) is when changing an ID in a URL shows you someone else's data. How it happens, why it's the most common serious bug in AI-built apps, how to test for it in five minutes, and the one-line habit that prevents it.
Encryption at Rest vs in Transit: What's the Difference?
Encryption in transit protects data moving across a network; encryption at rest protects data stored on disk. What each one protects against, what it doesn't, how HTTPS, disk encryption and field-level encryption fit together, and what a small app actually needs.
How to Add a Contact Form to Your Website (With or Without a Backend)
Four ways to make a contact form actually deliver messages — form services, your host's built-in forms, Google Forms, and your own backend route — plus how to stop spam and why you should never put an email API key in frontend code.
How to Add a CAPTCHA to Your Forms (Cloudflare Turnstile, reCAPTCHA, hCaptcha)
Stop bots spamming your signup, login and contact forms. How modern CAPTCHAs work, Turnstile vs reCAPTCHA vs hCaptcha, a working Cloudflare Turnstile example with the server-side check most tutorials forget, and when a CAPTCHA isn't the right tool.
How to Add an AI Chatbot to Your App (Without Leaking Your API Key)
A beginner-friendly guide to adding an AI chat feature: the safe architecture, a working Next.js backend route that streams Claude's replies, the frontend code to display them, and the limits, costs and abuse protection you need before launch.
What Is XSS? Cross-Site Scripting Explained for Beginners
Cross-site scripting lets an attacker run their JavaScript in your users' browsers — stealing sessions, changing pages, acting as the user. How XSS works, the three types, why React mostly protects you, the escape hatches that don't, and the defences that matter.
Where Should User Uploads Go? Object Storage Explained
Profile photos that vanish after a deploy, a database bloated with images, a public bucket full of private documents. Where uploaded files should live, how object storage works, and the three decisions — public or private, who uploads, and how files are served — that keep uploads fast and safe.
What Is Rate Limiting? Protecting Your App From Too Many Requests
Rate limiting caps how many requests someone can make in a period. Why every public app needs it — for login forms, sign-ups, AI features, and APIs — how it works, what a 429 response means, where to add limits, and what to do when you hit someone else's.
What Is HTTPS? The Padlock, Explained for Beginners
HTTPS is why the browser shows a padlock instead of 'Not secure'. What it protects, what it doesn't, what a certificate is, why your app needs it before launch, and how to fix the common 'mixed content' and certificate errors.
What Is a JWT? JSON Web Tokens Explained Simply
Supabase, Firebase, Auth0, and Clerk all hand your app JWTs. What a JSON Web Token is, its three parts, why anyone can read it but nobody can forge it, how apps use it for login, and the mistakes AI-generated code makes with tokens.
A Security Checklist for Vibe-Coded Apps
AI-built apps fail security in predictable ways: open databases, keys in the browser, authorization checked only in the UI. A practical checklist for non-security people — what to check, how to test it yourself, and what to fix before real users arrive.
Validating Input With Zod: One Schema for Forms, APIs, and Types
Every trust boundary — request bodies, query strings, webhooks, environment variables, AI output — needs runtime validation TypeScript can't provide. Using Zod schemas at each boundary, sharing them between client and server, stripping unknown keys, and useful errors.