You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PromQL query_range step-count guard is bypassed by long overflow, wedging an Undertow worker thread in an unbounded loop #6807
The PromQL query_range step-count guard is computed in signed 64-bit arithmetic. A span wider than Long.MAX_VALUE milliseconds makes endMs - startMs overflow negative, the guard passes, and the per-step loop then runs unbounded, wedging an Undertow worker thread for the life of the process.
Where (HEAD 9c9d024db)
server/src/main/java/com/arcadedb/server/http/handler/GetPromQLQueryRangeHandler.java:68 - no range check on the inputs:
PromQLEvaluator.java:161 - the loop it is supposed to bound:
for (longt = startMs; t <= endMs; t += stepMs)
Repro
GET /api/v1/ts/mydb/prom/api/v1/query_range?query=up&start=-9e15&end=9e15&step=60
startMs = -9e18, endMs = 9e18, the difference overflows, maxSteps comes out negative, the MAX_RANGE_STEPS (1,000,000) check passes, and the per-step loop begins. For a non-existent metric each step is cheap (evaluateVectorSelector returns new InstantVector(List.of()), PromQLEvaluator.java:201), so nothing throws and nothing bounds it: the request never returns and the worker thread is lost, since there is no query timeout or cancellation on this path. Repeat once per worker thread and the HTTP listener is down.
Reachable by any authenticated principal that passes checkAuthorizationOnDatabase for one time-series database. Note that endMs < startMs (:146) does not catch it (both operands are in order) and stepMs <= 0 is rejected earlier in the handler.
Suggested fix
Compute the span with Math.subtractExact/Math.floorDiv inside evaluateRange (or reject the request when the subtraction overflows), and additionally validate in the handler that start/end parse to a finite, sane epoch range before the multiplication by 1000 saturates.
Scope / confidence
High. Verified at HEAD, including that the missing-type fast path returns an empty vector rather than throwing, so the loop is not aborted on the first step.
A PromQL range query with an extremely wide time span (for example start=-9e15&end=9e15) overflowed the internal step counter, so the check that limits how many points a query may produce was bypassed and the query looped forever. The request never returned and the server thread handling it was lost; repeating the call enough times could make the HTTP interface stop answering.
The span and step count are now computed in a way that cannot overflow, and start, end, step and time are validated before the query runs: a value that is not a number, is infinite, or is outside a sensible date range is refused with 400 bad_data instead of a 500 or a hang. Both /query and /query_range behave the same way.
What you may notice: malformed time-range parameters now return a clear 400 error instead of failing later or hanging.
❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
Activity
review: close the HA half of the password-rotation revocation and ali…
Merge pull request #6866 from ArcadeData/fix/6805-6809-server-batch
lvca commentedon Aug 28, 2026
Fixed in #6866, milestone 26.9.1.
A PromQL range query with an extremely wide time span (for example
start=-9e15&end=9e15) overflowed the internal step counter, so the check that limits how many points a query may produce was bypassed and the query looped forever. The request never returned and the server thread handling it was lost; repeating the call enough times could make the HTTP interface stop answering.The span and step count are now computed in a way that cannot overflow, and
start,end,stepandtimeare validated before the query runs: a value that is not a number, is infinite, or is outside a sensible date range is refused with400 bad_datainstead of a 500 or a hang. Both/queryand/query_rangebehave the same way.What you may notice: malformed time-range parameters now return a clear
400error instead of failing later or hanging.❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
fix(ArcadeData#6805,ArcadeData#6806,ArcadeData#6807,ArcadeData#6808,A…
fix(ArcadeData#7709, ArcadeData#7705, ArcadeData#7704, ArcadeData#7703)…