Category

Security & Privacy

Building production systems that hold up under hostile traffic, browser quirks, and regulator-grade scrutiny.

6 articles

The security gate that defaulted to off

Our docs called the bot challenge mandatory. The env flag behind it defaulted to false in the deploy config, so a routine deploy would ship the gate down.

Sep 02, 20264 min readSecurity
Security Gate that Defaulted Off

Our rate limits were bypassed by a trailing slash

Five tuned Rack::Attack throttles, all matching the path exactly. Rails normalised the path after they ran, so a dot-json or a trailing slash bypassed every one.

Sep 01, 20265 min readRails
A turnstile in an empty station with an open gap in the railing right beside it.

Treat model output like user input

When strangers write the prompt and the answer renders on your page, you have two untrusted boundaries back to back. The layered posture we settled on.

Sep 01, 20265 min readLlm
Two Trust Boundaries; One System.

Layered bot defense for a public form: honeypot, Turnstile, email verification, and the pieces between

A public, unauthenticated form that writes to the database and sends email is a bot's favorite denial-of-service target. No single control is enough. The point is layering honeypot, Turnstile, rate limiting, and email verification so one layer failing doesn't sink the rest.

Jul 30, 202617 min readrate-limiting
A medieval castle viewed from outside its outer wall. Multiple defensive layers visible in one frame.

Moving JWTs out of localStorage: the surprises waiting in ActionController::API

A JS-readable token in localStorage is one XSS away from account takeover. Moving it into an HttpOnly cookie is the well-known fix but ActionController::API has no cookies, no CSRF, and a few other surprises waiting on the first commit.

Jul 30, 202613 min readsecurity
An old key being lifted off a hook on the wall and locked into a wall safe.

CSP nonces vs. 'unsafe-inline': the silent override that broke our admin UI

A nonce and 'unsafe-inline' in the same CSP directive: the browser silently drops 'unsafe-inline' by spec. Debugging a policy that quietly broke production.

Jul 30, 202610 min readsecurity
Two locks side by side on a door, only one is actually engaged. The other is decorative.