Field notes — essays & research notes

Things I've written down.

Ruby, Rails, performance, security and applied machine learning. Updated when something feels finished.

10 posts in Security
SECURITY 08 / 08 / 26

A CSP that actually stops XSS

Most content security policies are decorative. The directive that matters is script-src, and 'unsafe-inline' undoes the whole thing.

3 min
SECURITY 08 / 01 / 26

Authenticated is not authorised

The most common real-world web vulnerability isn't injection. It's an endpoint that checks who you are and forgets to check what you may touch.

3 min
SECURITY 07 / 25 / 26

Prompt injection isn't XSS, but it rhymes

Both come from mixing instructions with data. The difference is that there is no escaping function for English.

3 min
SECURITY 07 / 18 / 26

What's actually in your session cookie

Rails signs the session cookie, so users can read it but not forge it. That distinction decides what may go in it.

2 min
SECURITY 07 / 04 / 26

Your dependencies are your attack surface

A modest Rails app pulls in a hundred-odd gems and several hundred transitive ones. Almost none were chosen by anyone.

2 min
SECURITY 06 / 17 / 26

Where SQL injection still lives in Rails

Active Record parameterises almost everything. The gaps are specific, well known, and exactly where people write raw fragments.

3 min
SECURITY 06 / 03 / 26

Rate limiting the endpoints that actually get abused

Blanket limits annoy real users and barely inconvenience attackers. The endpoints worth protecting are a short, specific list.

2 min
SECURITY 05 / 06 / 26

Secrets that stay secret

The dangerous part is not storage. It's that a secret in git history is still there after you delete the file — and .gitignore won't save you.

3 min
SECURITY 04 / 15 / 26

Your logs are a database nobody secured

Logs are copied to aggregators, retained for months and read by people who would never be granted access to the production database.

2 min