Linora

0704. Query budgets, a wall-clock guard and search admission (SR-01)

Status: Accepted (2026-11-28). Amends 0702 (nameRegex). Doc side agreed with DC2 (FindBudget, checkNameRegex in packages/doc).

Context

Security finding SR-01 (HIGH): one nameRegex search could block a shared doc worker for tens of seconds. checkRegex only test-compiled the pattern with the linear engine’s l flag. find() then ran it on the backtracking engine, and V8’s “fallback on excessive backtracks” restarts each name only after it has already backtracked a lot. Measured on Node 26.4 (M4 Pro), ^(a+)+$ over 600K distinct 200-char names:

Pages are routed by rendezvous hash, so a worker is shared across tenants, and one user could stall search, outline, render and MCP reads for everyone. Linear time is necessary but not sufficient: about 20 µs per 256-char name still adds up to seconds on a big page.

Decision

Alternatives

Consequences