“Should be secured in production” was in production
A Firestore rule written for a demo stayed live for almost a year, with a comment on the same line saying exactly what was wrong with it.
From building GitRoasted
GitRoasted has a public leaderboard, stored in Firestore. On 23 November 2025 I added the security rules, and the write rule looked like this:
allow write: if true; // Open for demo purposes, should be secured in productionThe comment is correct and it did nothing. The demo became the product, the rule stayed, and I stopped reading that file. It was still there on 5 November 2026, 347 days later.
Why it mattered
A Firebase web config isn't a secret. It ships to every browser, by design, and security rules are what stand between that config and your data. With this rule, anyone with the config could have edited or deleted any leaderboard entry from a browser console.
The fix
Writes moved to the server. The server action now saves entries through the Firebase Admin SDK, with a service account held in a server-only environment variable. The Admin SDK bypasses security rules, so the rules can refuse every client write and still leave reads public:
// Entries are written only by the server, through the Admin SDK, which bypasses these rules.
allow write: if false;I also added firebase.json and .firebaserc, so the rules deploy from the repository instead of living only in a console, and checked from outside that an anonymous write now gets a 403.
What I took from it
“Should be fixed later” comments aren't a plan, because nothing ever brings you back to them. If a shortcut only makes sense for a demo, the launch checklist has to name it, or it ships with the product.
