Bound request and job resources to prevent search-service DoS #20
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The search service has several unbounded or late-bound resource inputs.
Confirmed behavior:
POST /jobsaccepts an arbitrary JSON body and arbitrary-sizeargumentsmapping after only checking that it is a dictionary.POST /getobject/cachechecksContent-Lengthbefore reading when available, but otherwise callsrequest.get_data()and only then checks the payload size.svr/scv_cc4ail.pyservice stores job state in a process-globaljobsdictionary without retention cleanup.An authenticated or currently unauthenticated caller can consume memory, queue capacity, ClickHouse time, request-worker time, or disk cache space with oversized or repeated inputs.
Proposed approach
Add layered, configuration-backed resource controls at HTTP, queue, input, and cache boundaries. Reuse existing queue quotas, ClickHouse execution timeout, cache byte limit, and object-range validation. Values that need production sizing must be measured and documented as provisional during implementation.
The service should reject oversized requests before application-level parsing where the framework supports it, bound argument sizes and string lengths before queue insertion, and retain only a bounded/expiring set of legacy job records. Rate limiting or equivalent admission control should cover expensive compatibility routes.
This requires server code, configuration samples, tests, documentation, and deployment guidance. No database schema migration should be required unless the existing queue cleanup model cannot support retention.
Scope
Acceptance criteria
Content-Length.Dependencies
svr/scv_cc4ail.pyremains supported.