Remote / foldkit-remote-server

Hardening

The handler applies bounded, protocol-level safeguards before or around Sources:

  • a read batch may name at most maxIdsPerEntity distinct ids for one Entity (default 1000); oversized client batches fail rather than loading unbounded rows;
  • nested resolution is bounded by maxDepth (default 8);
  • the wire decoder also rejects a selection deeper than MAX_RELATION_DEPTH (8) or more than MAX_FIELDS_PER_REQUEST (256) fields for one Entity;
  • returned field names are copied with Object.hasOwn into null-prototype objects, so names such as __proto__ or toString cannot reach prototypes;
  • Source errors are remapped to protocol error types without echoing application internals.

A liveHub applies the same id bound to a subscription. A hand-written live Source is responsible for any additional bounds appropriate to its backend.