Dev.to Security 🔐 Cybersecurity 👁 0 📖 2 min read

What a single report button implies about governance in an accountless system

The report button on /custom isn't decoration. It states a fact: even if the main flow is stateless, as soon as content can travel through links, you need an asynchronous, stateful governance layer. My design principle:

The report button on /custom isn't decoration. It states a fact: even if the main flow is stateless, as soon as content can travel through links, you need an asynchronous, stateful governance layer.

My design principle: the main flow never slows down for governance; governance intervenes only when triggered.

Report events go to an independent lightweight endpoint:

async function report(deckHash, reason) {
  await fetch('/api/report', {
    method: 'POST',
    headers: { 'content-type': 'application/json' },
    body: JSON.stringify({ deckHash, reason, ts: Date.now() })
  });
}

deckHash is a hash of deck content, not a user ID — because there are no accounts. The server puts it into a pending queue. There has to be storage here, even if it's a ring buffer of "last N reports." So my earlier "no backend" claim needs an asterisk: the main game loop has no backend; the governance layer has a thin KV.

Three levels of moderation, in order of cost

  1. Rule hits block immediately: if the report contains obvious slur keywords, the deckHash goes to a blacklist; next load is rejected.
  2. Same deckHash reported by multiple people: over threshold → manual queue.
  3. Manual review: low volume, no auto-classification, a human looks at it.

What I'd tell you not to do

Don't try to build "user reputation scores" in a system with no accounts. Without an identity anchor, reputation is trivially gamed. The honest boundary of a report button: it's a signal, not a verdict. It tells operators "there's a problem here," not "this will be handled instantly."

The trap I hit: early on I put the report endpoint and deck decoding in the same client bundle, and someone reverse-engineered the endpoint and spammed it. I added basic rate limiting (per IP + deckHash combo) and a request body size cap. These are mandatory in any accountless system, unrelated to the feature itself.

How to verify: generate a deck and inspect the URL structure. If there's a short ID, server-side storage exists and the report button has real meaning. If it's pure fragment, the report button can only tell you "this link was shared somewhere," which is much coarser — and honestly, that's one of the unstated reasons I'd consider adding short links someday.

The custom deck feature is at sketchwordgen.com/custom.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.