Fix review findings: proto smuggling, trade-leg recall, escrow cap, static headers, rate limits, rankings DoS
Fixed: validator rejects __proto__/constructor keys at any depth (transport capacity bypass); trade and site shipments cannot be recalled; trade escrow refund capped by Rack hall; CSP/nosniff on static files and connect-src 'self'; IPv6 /64 limiter keys + LRU eviction + per-username login bucket + scrypt concurrency cap; 5 s footprint cache for rankings; rename uses text.cleanText; 429s no longer pinned in the idempotency store; 30-day notification prune; units_offline notification on first offline. Accepted items listed in docs/DECISIONS.md R1. Tested: npm test 182/182 incl. test/review-fixes.test.js (regression tests). Not re-reviewed after the fixes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Q2MJaQ5LXAHzGnTDgceT14
This commit is contained in:
parent
b18645dca1
commit
d84b0c9d12
11 changed files with 190 additions and 17 deletions
|
|
@ -210,3 +210,23 @@ cannot undo exploit-kit damage; a building knocked to 0 comes back at 1. The not
|
|||
## G2 — Allied incoming is a separate list
|
||||
`GET /movements` keeps `incoming` as "heading for YOUR POPs" and adds `alliedIncoming` for partners' POPs (own alliance + confederations),
|
||||
each entry with `ally: true` and `toOperator`. Mixing them would make clients count allies' attacks as their own.
|
||||
|
||||
## R1 — Review round 1 (time model + security): what was fixed and what was accepted
|
||||
Fixed (each with a regression test in `test/review-fixes.test.js`): `__proto__`/`constructor` keys smuggling cargo past the transport
|
||||
capacity check (validator now rejects them at any depth); trade legs recallable so one side kept both halves of a deal (trade/site legs
|
||||
are no longer recallable); trade escrow refunds lifting stock above the Rack hall cap; static files served without CSP/nosniff/
|
||||
no-referrer and a `connect-src` that allowed any `ws:`/`wss:` host (now `'self'`); IPv6 clients minting unlimited rate-limit buckets
|
||||
(one bucket per /64), the limiter forgetting throttled keys when full (LRU eviction), no per-username login throttle (added), scrypt CPU DoS
|
||||
(max 4 concurrent hashes, username checked before hashing); rankings/alliance reads scanning the whole world per request (5 s footprint
|
||||
cache per world); weaker town-name sanitiser (now `text.cleanText`); rejected 429s pinned into the idempotency store (no longer);
|
||||
notifications never pruned (30 days); `units_offline` warning missing when units went offline through an arrival.
|
||||
Accepted for now, written down so nobody is surprised:
|
||||
- Escrowed trade stock is not lootable, so an unattractive offer is a hiding place for up to 250-500 of one resource per link (48 h
|
||||
offers, cancellable). Revisit if bots or players abuse it.
|
||||
- Leaving/being kicked from an alliance drops pact protection at once (pacts bind alliances, not people). Revisit: track `left_at`.
|
||||
- A battery above a lowered Battery bank cap is clamped immediately, while stock above a lowered Rack hall cap is kept. Intentional:
|
||||
power is a live balance, stock is a physical pile.
|
||||
- If an `arrive`/`return` handler ever throws, the event is marked failed and the movement stays `out` (units lost). No trigger found by
|
||||
the reviewer or ~70 fuzz seeds; a recovery sweeper is a stage-7 item.
|
||||
- HTTP connections per IP are not capped (only WebSockets are); behind nginx Proxy Manager the per-IP request limiter applies.
|
||||
- Tokens do not expire and there is no change-password route yet (revoke from Settings works).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue