SoundAdvice is a music advice forum where anyone can post a question and an admin approves it before it goes public. The forum itself is mostly a pretext: it needs accounts, roles, sessions, user-submitted HTML and file uploads, which makes it a realistic thing to attack. Every security control in it is hand-written. The platform runs on four packages, express, pg, bcrypt and dotenv, with sessions, CSRF tokens, the HTML sanitiser, the multipart file parser, rate limiting, password screening, encrypted email storage and a hash-chained audit log all built on Node's standard library. In a real product most of that would come from a library, but the point was to build each control and then try to break it, which is hard to do when the mechanism is hidden behind someone else's API.
This page is only an introduction. The README is where the project is actually documented with all the security implementations.
Read the full write-up on GitHub


