Back to blog
founders-diarysecurityauditstartup

Founder's Diary #5: The Week I Broke Things

28 March 20267 min readKansei TeamCzechEnglish

March 28, 2026 — Saturday morning. I have the audit log open on my monitor. Scrolling through hundreds of rows, looking for patterns. Not because something happened. But so I know what will happen when something does.

The Week I Stopped Building and Started Breaking

I didn't write a single new feature all week. Instead, I tried to break everything I'd built over the past months. I opened every public endpoint and tried to make it return data it shouldn't. I sent requests with missing headers. I tested race conditions. And I found more problems than I'd like to admit.

Code you wrote in a month can be audited in a week. But that week is worth more than the entire month — because in it you discover what you don't know.

What I Broke

I started with the public access points — portal links and intake forms we launched last week. And on the very first day, I found an IDOR vulnerability. A valid portal token for one task allowed downloading files from a different task if you knew its ID. The fix was simple — verify the file belongs to the task the token grants access to. But the feeling that this was in production for a week made me rethink my entire approach.

Then a timing attack on secret comparison. Standard string comparison (===) leaks secret length through response time. I replaced it with crypto.timingSafeEqual() everywhere secrets are compared — CRON_SECRET, SETUP_SECRET, CSRF tokens.

🐛 Bug hunt: what we found in a week

Click to reveal findings (0/5)

The Armored Castle

After the audit week, I wrote down 14 security rules. Not as documentation, but as law. Every new piece of code must pass these checks. A few examples:

  • Never raw ownership checks — always getEntityAccess() + withEntityScope()
  • Never z.any() — always typed Zod schemas
  • Atomic operations over check-then-act — DELETE...RETURNING instead of SELECT + UPDATE
  • Normalize emails before rate-limit checks — .toLowerCase().trim()

And then I added Row-Level Security to every financial table. The database now enforces that one tenant can't see another's data — even if there's a bug in the application layer. Belt and suspenders.

🛡️ Kansei security layers

Click layers to see what protects your data

Two-factor auth (TOTP), bcrypt password hashing, lockout after 10 failed attempts. JWT tokens with 24h expiry.
14
Security rules
5
Vulnerabilities fixed
26
Tables with RLS
0
New features

Small Thing, Big Impact

Between auditing sessions, I fixed a small thing that had been bugging me for months: Vojta Vlasak appeared twice in the task filter. Once as a worker, once as a team member. Duplicate entry because deduplication compared worker name but not nickname. Five-minute fix, but it improves the daily experience of everyone who filters tasks.

And I added a task time log to worker profiles — an overview of which tasks a person worked on each month and how much time they spent. Managers need it for reporting, workers need it for visibility. A collapsible section that only loads when expanded.

Invisible work

None of this looks sexy in a changelog. No new feature, no wow effect. But this is exactly what separates a product people trust from a product that looks great in a demo. Security is trust.

Chat With My Mentor

Me: I spent an entire week without writing a single new feature. I feel like I'm wasting time.

Mentor: How many vulnerabilities did you find?

Me: Five. Two critical.

Mentor: So in one week you prevented two potential incidents. Do you know what a security incident costs? Not money — trust. And trust takes months to build and a second to lose. Every startup wants to build new features. The ones that survive are the ones that know when to stop building and start fortifying. This was your most productive week.

What I Learned

The most productive week in a product's life is the one where you don't write a single new feature. Where instead you sit down, take your own code, and try to break it. Because if you don't, someone else will. And that someone won't have your best interests at heart.

Related posts

Read enough? Try it on your next job.