]> git.kaiwu.me - nginx.git/commit
Range filter: reasonable limit on multiple ranges.
authorSergey Kandaurov <pluknet@nginx.com>
Tue, 13 Jan 2026 12:51:07 +0000 (16:51 +0400)
committerSergey Kandaurov <s.kandaurov@f5.com>
Wed, 21 Jan 2026 16:39:00 +0000 (20:39 +0400)
commitcb9252ae6537d8c24addcf0822267804fc73db43
tree26db85fed975f1c460f44813541531286086d357
parent7fa941a55e211ebd57f512fbfb24d59dbb97940d
Range filter: reasonable limit on multiple ranges.

A total response length with multiple ranges can be larger than the
source response size due to multipart boundary headers.  This change
extends max ranges limit imposed in c2c3e3105 (1.1.2) by accounting
boundary headers.  Notably, this covers suspicious requests with a
lot of small ranges that have an increased processing overhead and
are susceptible to range based amplification attacks.

The limit disables ranges as long as a total response length comes
close to the source size, additionally penalizing small size ranges
on a large source size where a processing overhead prevails, while
leaving a room for more ranges on a small source size, such that it
should not affect well-behaving applications.  The limit can be
altered with the "max_ranges" directive.

Closes #988 on GitHub.
src/http/modules/ngx_http_range_filter_module.c