summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)AuthorFilesLines
2026-04-07nginx-1.29.8-RELEASErelease-1.29.8Sergey Kandaurov1-0/+56
2026-04-06Upstream: reset early_hints_length on upstream reinit.David Carlier1-0/+1
When a request was retried to a new upstream after receiving 103 Early Hints from the previous one, the accumulated early_hints_length was not reset, causing valid early hints from the next upstream to be incorrectly rejected as "too big".
2026-04-06Fix $request_port and $is_request_port in subrequestsZoey1-0/+2
Closes #1247.
2026-04-06Added max_headers directive.Maxim Dounin6-0/+40
The directive limits the number of request headers accepted from clients. While the total amount of headers is believed to be sufficiently limited by the existing buffer size limits (client_header_buffer_size and large_client_header_buffers), the additional limit on the number of headers might be beneficial to better protect backend servers. Requested by Maksim Yevmenkin. Signed-off-by: Elijah Zupancic <e.zupancic@f5.com> Origin: <https://freenginx.org/hg/nginx/rev/199dc0d6b05be814b5c811876c20af58cd361fea>
2026-04-06Upstream: fix integer underflow in charset parsingDavid Korczynski1-1/+1
The issue described below was only reproducible prior to https://github.com/nginx/nginx/commit/7924a4ec6cb35291ea60a5f2a70ac0a034d94ff7 When parsing the `charset` parameter in the `Content-Type` header within `ngx_http_upstream_copy_content_type`, an input such as `charset="` resulted in an integer underflow. In this scenario, both `p` and `last` point to the position immediately following the opening quote. The logic to strip a trailing quote checked `*(last - 1)` without verifying that `last > p`. This caused `last` to be decremented to point to the opening quote itself, making `last < p`. The subsequent length calculation `r->headers_out.charset.len = last - p` resulted in -1, which wrapped to `SIZE_MAX` as `len` is a `size_t`. This invalid length was later passed to `ngx_cpymem` in `ngx_http_header_filter`, leading to an out-of-bounds memory access (detected as `negative-size-param` by AddressSanitizer). The fix ensures `last > p` before attempting to strip a trailing quote, correctly resulting in a zero-length charset for malformed input. The oss-fuzz payload that triggers this issue holds multiple 103 status lines, and it's a sequence of 2 of those Content-Type headers that trigger the ASAN report. Co-authored-by: CodeMender <codemender-patching@google.com> Fixes: https://issues.oss-fuzz.com/issues/486561029 Signed-off-by: David Korczynski <david@adalogics.com>
2026-04-03Removed CLOCK_MONOTONIC_FAST support.Eugene Grebenschikov1-4/+0
CLOCK_MONOTONIC_FAST, like CLOCK_MONOTONIC_COARSE, has low accuracy. It shows noticeable timing variation for short intervals, which is visible in metrics like $upstream_response_time for fast upstream responses. This change complements the work started in commit f29d7ade5. In addition to the reasons described in f29d7ade5, the performance of CLOCK_MONOTONIC is good enough on modern hardware when using a TSC timecounter. This is especially true when it is accessed through a shared page, as implemented in FreeBSD 10.0 (see git commits 869fd80fd449 and aea810386d8e for details). Co-authored-by: Sergey Kandaurov <pluknet@nginx.com>
2026-04-02Upstream: fixed processing multiple 103 (early hints) responses.Sergey Kandaurov1-5/+3
The second 103 response in a row was treated as the final response header.
2026-03-31Update CONTRIBUTING.mdxuruidong1-3/+8
2026-03-31SSL: compatibility with OpenSSL 4.0.Sergey Kandaurov3-9/+36
X509_get_issuer_name() and X509_get_subject_name() were changed to return a const value. Since it is passed to functions with a non const argument in older versions, the const modifier is conditionally compiled as needed. ASN1_INTEGER was made opaque. ASN1_STRING accessors are used to preserve the behaviour. ASN1_STRING_get0_data() compat shim is provided for OpenSSL < 1.1.0 where it does not exist.
2026-03-31Version bump.Sergey Kandaurov1-2/+2
2026-03-24Fixed the "include" directive inside the "geo" block.Eugene Grebenschikov2-2/+12
The "include" directive should be able to include multiple files if given a filename mask. Completes remaining changes introduced in da4ffd8. Closes: https://github.com/nginx/nginx/issues/1165
2026-03-24nginx-1.29.7-RELEASErelease-1.29.7Roman Arutyunyan1-0/+153
2026-03-24Stream: fixed client certificate validation with OCSP.Sergey Kandaurov1-0/+10
Check for OCSP status was missed in 581cf2267, resulting in a broken validation. Reported by Mufeed VH of Winfunc Research.
2026-03-24Mail: fixed clearing s->passwd in auth http requests.Sergey Kandaurov1-1/+1
Previously, it was not properly cleared retaining length as part of authenticating with CRAM-MD5 and APOP methods that expect to receive password in auth response. This resulted in null pointer dereference and worker process crash in subsequent auth attempts with CRAM-MD5. Reported by Arkadi Vainbrand.
2026-03-24Mail: host validation.Roman Arutyunyan1-0/+45
Now host name resolved from client address is validated to only contain the characters specified in RFC 1034, Section 3.5. The validation allows to avoid injections when using the resolved host name in auth_http and smtp proxy. Reported by Asim Viladi Oglu Manizada, Colin Warren, Xiao Liu (Yunnan University), Yuan Tan (UC Riverside), and Bird Liu (Lanzhou University).
2026-03-24Dav: destination length validation for COPY and MOVE.Roman Arutyunyan1-13/+26
Previously, when alias was used in a location with Dav COPY or MOVE enabled, and the destination URI was shorter than the alias, integer underflow could happen in ngx_http_map_uri_to_path(), which could result in heap buffer overwrite, followed by a possible segfault. With some implementations of memcpy(), the segfault could be avoided and the overwrite could result in a change of the source or destination file names to be outside of the location root. Reported by Calif.io in collaboration with Claude and Anthropic Research.
2026-03-24Mp4: fixed possible integer overflow on 32-bit platforms.Roman Arutyunyan1-7/+7
Previously, a 32-bit overflow could happen while validating atom entries count. This allowed processing of an invalid atom with entrires beyond its boundaries with reads and writes outside of the allocated mp4 buffer. Reported by Prabhav Srinath (sprabhav7).
2026-03-24Mp4: avoid zero size buffers in output.Roman Arutyunyan1-6/+9
Previously, data validation checks did not cover the cases when the output contained empty buffers. Such buffers are considered illegal and produce "zero size buf in output" alerts. The change rejects the mp4 files which produce such alerts. Also, the change fixes possible buffer overread and overwrite that could happen while processing empty stco and co64 atoms, as reported by Pavel Kohout (Aisle Research) and Tim Becker.
2026-03-24Upstream keepalive: fixed parameter parsing.Roman Arutyunyan1-1/+1
2026-03-24Proxy: enabled HTTP/1.1 by default for upstream connections.Roman Semenov1-33/+3
Updates the proxy module to use HTTP/1.1 as the default protocol when communicating with upstream servers. This change unlocks features such as persistent connections and chunked transfer encoding. Configurations that require HTTP/1.0 can still override the protocol explicitly.
2026-03-24Upstream: enabled keepalive by default for explicit upstreams.Roman Semenov1-63/+67
Keepalive is now automatically enabled in the "local" mode for upstreams defined in configuration files. Cached keepalive connections are no longer shared between different locations referencing the same explicit upstream unless keepalive is explicitly configured without the "local" parameter. To disable keepalive entirely, use keepalive 0; inside the upstream block. To allow sharing cached connections between locations, configure keepalive <max_cached>; without the "local" parameter.
2026-03-24Upstream keepalive: distinguish cached connections by location.Roman Semenov1-1/+22
The new "local" parameter prevents sharing cached keepalive connections between location blocks. Connections are now reused only within the same location.
2026-03-23Added COMPAT section to ngx_log_t.Dmitry Plotnikov1-0/+3
2026-03-19The "multipath" parameter of the "listen" directive.Sergey Kandaurov13-11/+104
When configured, it enables Multipath TCP support on a listen socket. As of now it works on Linux starting with Linux 5.6 and glibc 2.32, where it is enabled with an IPPROTO_MPTCP socket(2) protocol. To avoid EADDRINUSE errors in bind() and listen() when transitioning between sockets with different protocols, SO_REUSEPORT is set on both sockets. See f7f1607bf for potential implications. Based on previous work by Maxime Dourov and Anthony Doeraene.
2026-03-16gRPC: reset buffer chains on upstream reinit.David Carlier1-0/+3
Previously, ctx->out was not cleared in ngx_http_grpc_reinit_request(), which could cause queued HTTP/2 control frames (SETTINGS ACK, PING ACK, WINDOW_UPDATE) to be sent on next upstream. Additionally, ctx->in and ctx->busy needs to be cleared to avoid similar problems with buffered request body fixed in cd12dc4f1.
2026-03-16Proxy: reset pending control frames on HTTP/2 upstream reinit.David Carlier1-0/+1
Previously, ctx->out was not cleared in ngx_http_proxy_v2_reinit_request(), which could cause stale HTTP/2 control frames (SETTINGS ACK, PING ACK, WINDOW_UPDATE) queued for the old upstream connection to be sent to a new upstream connection during a retry.
2026-03-11Proxy authentication definitions.Roman Arutyunyan4-2/+17
2026-03-11Version bump.Roman Arutyunyan1-2/+2
2026-03-10nginx-1.29.6-RELEASErelease-1.29.6Sergey Kandaurov1-0/+96
2026-03-10Fixed typos.Sergey Kandaurov1-5/+5
2026-03-10Updated zlib used for win32 builds.Sergey Kandaurov1-1/+1
2026-03-09Sticky: fixed expiration of learned sessions after reload.Aleksei Bavshin1-2/+57
Previously, the expiration timer for learned session was not started until a new session is created. This could lead to the sessions being active past the expiration time.
2026-03-09Sticky: samesite=<strict|lax|none> cookie flags.Vladimir Kokshenev1-1/+89
Adds new options for the "sticky cookie" directive to set samesite=<strict|lax|none> cookie flags.
2026-03-09Sticky: added the "header" parameter in the learn mode.Vladimir Homutov4-15/+84
With this parameter set, sessions are learned after receiving upstream headers.
2026-03-09Sticky: added the "max-age" attribute to cookie.Vladimir Homutov1-4/+6
RFC 6265 defines "Max-Age" cookie attribute in section 5.2.2. If the "expires" option is passed to the "sticky" directive, "max-age" attribute will appear in cookies set by the module with corresponding value in seconds. For the special "max" value of the "expires" option, corresponding "max-age" attribute value will be set to 315360000 seconds (10 years, similar to how its done in headers_filter module for the "Cache-Control" header).
2026-03-09Sticky: added variables support to cookie domain.Vladimir Homutov1-18/+38
2026-03-09Sticky: added "httponly" and "secure" attributes.Vladimir Homutov1-0/+39
The attributes are described in RFC6265, sections 4.1.2.5 and 4.1.2.6 respectively.
2026-03-09Sticky: added "draining" peer state.Vladimir Homutov3-7/+36
While peer is draining, only sticky requests are served and the peer is never selected to process new requests. Co-authored-by: Ruslan Ermilov <ru@nginx.com>
2026-03-09Upstream: introduced a new macro for down value.Aleksei Bavshin4-2/+7
2026-03-09Sticky: added the "learn" mode.Vladimir Homutov1-92/+767
In this mode, nginx "learns" which client uses which proxied server by analyzing headers of client requests and proxied server responses. For example, a proxied server may start sessions by issuing the "Set-Cookie" header field to set cookie 'sid' and returning clients will bring the cookie with the same name. The following configuration may be used to handle this case: upstream u1 { server 127.0.0.1:8080; server 127.0.0.1:8081; sticky learn timeout=10m zone=sess:1m create=$upstream_cookie_sid lookup=$cookie_sid; } Co-authored-by: Ruslan Ermilov <ru@nginx.com> Co-authored-by: Maxim Dounin <mdounin@mdounin.ru>
2026-03-09Upstream: added sticky sessions support for upstreams.Vladimir Homutov13-9/+1028
Sticky sessions allow to route the same client to the same upstream server. - upstream structures are extended to keep session-related information - existing balancing modules are updated to provide an id of the selected server (SID) in pc->sid, and to select the server, given it's SID. - other balancing modules are allowed to set the pc->hint value to choose the desired peer. The sticky module will not change the hint if it's already set. - the feature is enabled by default and can be disabled with the "--without-http_upstream_sticky" switch of the configure script. The following configuration can be used to enable sticky sessions for supported balancing modules: upstream u1 { server 127.0.0.1:8080; server 127.0.0.1:8081; sticky cookie server_id expires=1h domain=.example.com path=/; } Co-authored-by: Ruslan Ermilov <ru@nginx.com> Co-authored-by: Roman Arutyunyan <arut@nginx.com> Co-authored-by: Maxim Dounin <mdounin@mdounin.ru>
2026-03-04Mail: fixed type overflow in IMAP literal length parser.Sergey Kandaurov1-0/+3
The overflow is safe, because the maximum length of literals is limited with the "imap_client_buffer" directive. Reported by Bartłomiej Dmitruk.
2026-03-04Mail: stricter IMAP literals validation.Sergey Kandaurov1-8/+4
As clarified in RFC 3501, Section 7.5, literals are followed either by SP, for additional command arguments, or CRLF.
2026-02-27Added an option to skip the F5 CLA workflow.Alessandro Fael Garcia1-6/+42
There are some scenarios where the F5 CLA workflow should not run. This commit adds the ability to skip the F5 CLA by using the "skip-cla" label.
2026-02-27QUIC: improved error handling in OpenSSL compat layer.user.email1-2/+10
Previously ngx_quic_compat_create_record() could try to encrypt a TLS record even if encryption context was missing, which resulted in a NULL pointer dereference. The context is created by ngx_quic_compat_set_encryption_secret() called from the OpenSSL keylog callback. If an error occurred in that function, the context could remain missing. This could happen under memory pressure, if an allocation failed inside this function. The fix is to handle errors from ngx_quic_compat_set_encryption_secret() and set qc->error to trigger an error after SSL_do_handshake() return. Also, a check for context is added to ngx_quic_compat_create_record() to avoid other similar issues.
2026-02-27QUIC: worker-bound stateless reset tokens.Roman Arutyunyan1-2/+6
Previously, it was possible to obtain a stateless reset token for a connection by routing its packet to a wrong worker. This allowed to terminate the connection. The fix is to bind stateless reset token to the worker number.
2026-02-26Updating welcome page with links and more details.buulam1-5/+9
2026-02-26QUIC: fixed bpf compilation with newer Linux kernels.Roman Arutyunyan2-22/+27
QUIC bpf program previously used struct bpf_map_def which was deprecated in [1] (kernel version 5.18) and removed in [2] (kernel 6.1). New-style BTF map definitions were added in [3] (linux kernel 5.3). Switching the program to BTF is however not necessary since nginx has its own relocation procedure which allows referencing the real map structure by its file descriptor allocated earlier. In particular, bpf instruction BPF_LD_IMM64 (0x18/0x0) is substituted with instruction BPF_LD_MAP_FD (0x18/0x1) and map_fd is stored in the imm field, see [4] and [5] for details. To fix compilation, struct bpf_map_def is changed to a known type (int) and "extern" is added to indicate external linkage and reduce object file size. [1] https://github.com/torvalds/linux/commit/93b8952d223af03c51fba0c6258173d2ffbd2cb7 [2] https://github.com/torvalds/linux/commit/dc567045f1590f6460d3e9a6ea6ad5e600b58b84 [3] https://github.com/torvalds/linux/commit/abd29c9314595b1ee5ec6c61d7c49a497ffb30a3 [4] https://github.com/torvalds/linux/blob/master/include/linux/filter.h [5] https://datatracker.ietf.org/doc/rfc9669/
2026-02-26QUIC: Stateless Reset rate limiting.Sergey Kandaurov1-4/+61
It uses a bloom filter to limit sending Stateless Reset packets no more than once per second in average for the given address. This allows to address resource asymmetry from precomputed packets, as well as to limit potential Stateless Reset exchange.
2026-02-26QUIC: refactored ngx_quic_address_hash().Sergey Kandaurov3-4/+9
Now it accepts an optional salt, to be used in a subsequent change.