This is a game without an authoritative server (for now): matches run 100% in the player's browser. This means that the client is, by definition, untrusted — an attacker with a trainer (memory/JS editing, like the one in the pentester's screenshot) can get god mode, speed, autoshot, etc. in their OWN game. No client-side anti-cheat can stop this — it is obfuscation theater, and we do not do theater.
What we can genuinely defend today is ranking integrity — and that is where we focus everything: statistical validation and server-side moderation.
The real fix is authoritative multiplayer (a future phase), where the server witnesses kills. Until then, we use the layers below.
- Token per nickname (UUID in the browser) — prevents theft of other players' nicknames/stats.
- Rate limit per nickname (90s) and per IP (60s + 200 matches/day, via
submit_log) — protects against floods and nick-hopping. - Absolute caps — 150 kills/deaths, streak of 30, 1,500s per match.
- Physical consistency (anti-trainer):
- kills ≤ 45 per round (the 2.2s respawn makes anything higher impossible);
- ≥ 80s per round (a speed hack cannot produce an instant match).
- Automatic flags — an implausible attempt = +1 flag; 3 flags = automatic
removal from the ranking (
players.hidden). - Rate-limited registration (10/min per IP) against nick-farming.
- RLS on every table; writes only through validated RPCs; the
service_rolekey exists only in Vercel environment variables. - No secrets in the client — the anon key is public by design. But RLS alone
was not enough: it filters ROWS, not COLUMNS, and does not cover function
execute. See 9 and 10. players.tokenrestricted by column privilege (migration 011 §1). Until v2, the anon key could readselect=nick,tokenfor the entire ranking — which is exactly the pair thatsubmit_matchvalidates. The ranking could be forged with a singlecurl.- No RPC is callable by the anon key (migration 011 §4). Every Postgres
function is created with
executefor PUBLIC, and PostgREST publishes each one at/rest/v1/rpc/<nome>: anyone could call_flagthree times and hide any player from the ranking, without any token. - Durable rate limiting in Postgres (migration 011 §3). A limit stored in a
lambda's in-memory
Mapdoes not survive a cold start — seedocs/seguranca.md§3. - Anti-SSRF on every URL fetched by the server (
src/lib/safe-url.ts). - Security headers sourced from
borda.json: CSP, nosniff, Referrer-Policy, Permissions-Policy, HSTS.
submit_logstores IP + nickname + timestamp only for operational security (anti-abuse), with a maximum retention of 7 days. This promise now has a job:public.purge_submit_log(7), scheduled daily inpg_cron(migration 011 §2). Until v2, nothing enforced this retention.- Map geolocation is city-level (Vercel header); the IP is never persisted for it.
-- esconder um jogador do ranking
update players set hidden = true where nick = 'NICK';
-- desbanir + zerar flags
update players set hidden = false, flagged_count = 0 where nick = 'NICK';
-- suspeitos acumulando flags
select nick, flagged_count, hidden from players where flagged_count > 0 order by flagged_count desc;
-- submits recentes de um IP
select * from submit_log where ip = '1.2.3.4' order by created_at desc limit 50;- Payload signing/HMAC in the client — stops naive
curlscripts, but any trainer can extract the secret from the JS. Cost without real benefit. - Client-side anti-cheat (devtools detection, debugger traps) — bypassed in minutes by anyone using a trainer. Not worth the maintenance.
- Authoritative multiplayer (future phase): the server validates kills/damage — the only complete fix against trainers.
- Server-signed match sessions (a match only counts if started and ended with the server observing).
docs/seguranca.md documents, for each vulnerability closed in this release:
where it was (arquivo:linha), what closes it, how to test it, and what has not
been resolved.
Do not open a public issue. Email the maintainer at the address on their GitHub profile (https://github.com/rubenmarcus) with: what an attacker can do, the minimum steps to reproduce it, and the impact you see. Unless a disclosure timeline has been agreed upon, please do not publish before the fix.
This is a fan project with no bug bounty program — but every valid report will be included in the credits, if you wish.