Build open-source affiliate software and learn what a security audit finds

A founder had Claude Code write most of OpenPromoter, a self-hostable SaaS affiliate app. An outside security audit then found four money-related holes that none of their tests caught.

Done withClaude Code· Nov 20, 2026

What they did

The poster, u/ItsYashKapoor, built OpenPromoter, open-source affiliate software for SaaS companies: partners get a referral link, sales through it become commissions, and the owner approves payouts. They wrote down what each part should do and made the design calls; Claude Code wrote the code, and they read and tested it. The project is AGPL and can be self-hosted, with a free hosted tier.

How it went

A contributor sent a pull request with fixes from a security audit, which they merged. It found that a partner could claim a customer's email before signup and get paid on their sales, that payout approval codes had no limit on wrong guesses, that a refund reported twice was counted twice, and that the partner data export leaked private notes and risk scores. Their test suite caught none of them because no test acted like a dishonest partner.

Worth knowing

Commenters suggested asking Claude to list every way a partner could get paid for a sale that is not theirs, turning each into a failing test before fixing, and cross-checking with a second model. Others criticised shipping payment code without a security review at all.

Try it

With Claude Code· 3 parts to fill in

Act as an attacker against [my app that moves money, e.g. affiliate payouts]. Read [the repo or modules] and list every way a [partner, customer or user role] could get paid, refunded or see data they should not: claiming others' records, replaying or duplicating events, brute-forcing codes, leaking fields in exports. For each one, write a failing test that proves it. Do not fix anything yet. Stop and show me the list and the failing tests so I can decide what to fix first.

Square brackets are the parts to fill in. The prompt is ours; the story is theirs.

Where they said it

Related