Skip to content

HTTP query endpoint: no hard ceiling on the rows a single response materializes #5719

Closed

Description

@lvca

Follow-up to #5711 / #5716, filed on the code review's recommendation so the decision does not get lost.

Context

#5716 made the HTTP query and command endpoints honor a limit the caller stated - the request's limit field, or the LIMIT the query carries - and cap only the callers that state none, with arcadedb.server.httpQueryDefaultLimit (default 20000).

The consequence is that the default cap now protects only queries that state no limit of their own. An authenticated caller who writes SELECT FROM HugeType LIMIT 100000000 (or sends "limit": -1) makes the server serialize an arbitrarily large result into a single JSON response.

This is not a new capability: "limit": -1 has always been an unbounded escape hatch for the same actor, so no privilege boundary moved. What changed is the bar - a large LIMIT in the query text is easier to reach accidentally (e.g. an application that builds LIMIT n from user input) than an explicit limit: -1 in the request body. In a multi-tenant deployment the previous implicit 20,000 cap was doing real protective work.

Proposal

Mirror what the gRPC path already does. arcadedb.server.grpcQueryMaxResultRows is documented as:

Hard ceiling on the number of rows the gRPC unary ExecuteQuery materializes. A request limit at or below this cap is honored; a result that would exceed it fails the call with RESOURCE_EXHAUSTED (consistent with the StreamQuery MATERIALIZE_ALL path) rather than silently truncating, and a client cannot bypass it with a larger limit.

An HTTP equivalent - arcadedb.server.httpQueryMaxResultRows - would answer 413 (or 400) naming the setting when the requested cap exceeds it, and would never truncate silently, which keeps the invariant #5711 established.

The decision this needs

Any finite default is a breaking change for deployments that send limit: -1 today and get everything. So the options are:

  1. Default -1 (disabled): fully backward compatible, but provides no protection out of the box - an operator has to know the setting exists.
  2. A finite default (e.g. 1,000,000): protects by default, breaks existing unbounded callers at the next upgrade, and needs a release note under Breaking Changes.
  3. Finite default only in the production server mode, unlimited in development.

Option 3 is arguably the best of the three but adds mode-dependent behaviour to a data path, which has its own cost.

Notes

Activity

  1. added
    enhancement
    on Aug 1, 2026
  2. modified the milestones: 26.8.1, 26.9.1 on Aug 1, 2026
  3. self-assigned this
    on Aug 16, 2026
  4. added
    in progress
    on Aug 16, 2026
  5. added a commit that references this issue on Aug 17, 2026
  6. removed
    in progress
    on Aug 19, 2026
  7. added
    server
    on Sep 2, 2026
  8. added a commit that references this issue on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementserver

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions