Skip to content

fix: bound task listings and stored task data #284

Closed

Description

@uniqueg

Problem

Any user can fill MongoDB's storage or exhaust the memory of the API:

  • GET /tasks?view=FULL&page_size=2047 loads every matching document, with task_original, into memory (list(cursor)) before serializing. Tasks with large inline inputs (inputs[].content) can make a single listing larger than the memory limit of an app instance.
  • Each POST /tasks stores the task twice (task and task_original) before any backend accepts it. Tasks that fail validation, and tasks that no backend accepts, are kept (as SYSTEM_ERROR) together with their owner rules.
  • Inline input contents are limited only by the limit of the request size.

Found in the pre-release review of v0.3.0 (finding 6).

Proposed change

  • A much lower, configurable maximum page size for view=FULL (e.g., 64), and iterate the cursor instead of loading it as a whole.
  • Don't keep tasks that fail validation, or that no backend accepts: delete the document and its owner rules, and document the change in docs/upgrading.md. Tasks that a backend may have accepted (unknown outcome, fix: submit tasks to backends exactly once #274) are kept.
  • A separate, lower, configurable size limit for inline inputs[].content.
  • Docs: recommend rate limiting at the ingress for production (generic, e.g., the rate-limit annotations of the ingress controller; no deployment-specific values).

Per-user limits and retention of finished tasks are separate, opt-in features (follow-up issues).

Activity

  1. added
    priority: high
    status: triage
    type: bug
    type: security
    workload: days
    status: in progress
    and removed
    status: triage
    on Oct 24, 2026
  2. removed
    status: in progress
    on Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: hightype: bugtype: securityworkload: days

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions