summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)AuthorFilesLines
2026-03-24nginx-1.28.3-RELEASErelease-1.28.3Roman Arutyunyan1-0/+131
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-24QUIC: 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-03-24QUIC: 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-03-24QUIC: 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-03-24QUIC: refactored ngx_quic_address_hash().Sergey Kandaurov3-4/+9
Now it accepts an optional salt, to be used in a subsequent change.
2026-03-24QUIC: moved ngx_quic_address_hash().Sergey Kandaurov3-49/+48
2026-03-24QUIC: limited size of generated Stateless Reset packets.Sergey Kandaurov1-2/+2
Made sure to send packets smaller than the triggering packet, following RFC 9000, Section 10.3.3. Reported-by: cyberspace61
2026-03-24QUIC: adjusted minimum packet size to send Stateless Reset.Sergey Kandaurov1-1/+1
Now to be valid, it also assumes the Connection ID we require from a client.
2026-03-24Resolver: fixed off-by-one read in ngx_resolver_copy().Roman Arutyunyan1-1/+1
It is believed to be harmless, see a similar change 077a890a76ff. Reported-by: geeknik <geeknik@protonmail.ch>
2026-03-24Mp4: validate sync sample values in stss atom.CodeByMoriarty1-13/+25
Per ISO 14496-12 Section 8.6.2, sync sample numbers must be 1-based. A zero-valued stss entry caused ngx_http_mp4_seek_key_frame() to return a key_prefix exceeding the samples consumed in the forward stts pass, which led the backward loop in ngx_http_mp4_crop_stts_data() to walk past the beginning of the stts data buffer. The fix validates each stss entry in ngx_http_mp4_seek_key_frame() and returns an error if a zero sync sample is encountered. The function signature is changed to return ngx_int_t so it can signal errors to the caller.
2026-03-24Updated zlib used for win32 builds.Sergey Kandaurov1-1/+1
2026-03-24Updated OpenSSL and PCRE used for win32 builds.Roman Arutyunyan1-2/+2
2026-03-24Version bump.Roman Arutyunyan1-2/+2
2026-02-04nginx-1.28.2-RELEASErelease-1.28.2Roman Arutyunyan1-0/+36
2026-02-04Upstream: reinit upstream after reading bad response.Roman Arutyunyan2-1/+5
Previously, when connecting to a backend, if the read event handler was called before the write event handler, and the received response triggered a next upstream condition, then ngx_http_upstream_reinit() was not called to clean up the old upstream context. This had multiple implications. For all proxy modules, since the last upstream response was not cleaned up, it was mixed with the next upstream response. This could result in ignoring the second response status code, duplicate response headers or reporting old upstream header errors. With ngx_http_grpc_module and ngx_http_proxy_v2_module, ctx->connection was left dangling since the object it referenced was allocated from the last upstream connection pool, which was deleted when freeing last upstream. This lead to use-after-free when trying to reuse this object for the next upstream.
2026-02-04Upstream: detect premature plain text response from SSL backend.Roman Arutyunyan1-0/+9
When connecting to a backend, the connection write event is triggered first in most cases. However if a response arrives quickly enough, both read and write events can be triggered together within the same event loop iteration. In this case the read event handler is called first and the write event handler is called after it. SSL initialization for backend connections happens only in the write event handler since SSL handshake starts with sending Client Hello. Previously, if a backend sent a quick plain text response, it could be parsed by the read event handler prior to starting SSL handshake on the connection. The change adds protection against parsing such responses on SSL-enabled connections.
2026-02-04Win32: fixed C4319 warning with MSVC 2022 x86.Aleksei Bavshin1-1/+1
The warning started to appear in Visual Studio 2022 version 17.14.21, which corresponds to the C/C++ compiler version 19.44.35221. The appropriate fix is to avoid mixing uint64_t and ngx_uint_t in an expression with bitwise operations. We can do that here because both the original shm->size value and the result of the expression are 32-bit platform words.
2026-02-04Version bump.Roman Arutyunyan1-2/+2
2025-12-23nginx-1.28.1-RELEASErelease-1.28.1Sergey Kandaurov1-0/+113
2025-12-23Proxy: fixed segfault in URI change.Sergey Kandaurov1-3/+4
If request URI was shorter than location prefix, as after replacement with try_files, location length was used to copy the remaining URI part leading to buffer overread. The fix is to replace full request URI in this case. In the following configuration, request "/123" is changed to "/" when sent to backend. location /1234 { try_files /123 =404; proxy_pass http://127.0.0.1:8080/; } Closes #983 on GitHub.
2025-12-23HTTP/2: extended guard for NULL buffer and zero length.Sergey Kandaurov1-6/+5
In addition to moving memcpy() under the length condition in 15bf6d8cc, which addressed a reported UB due to string function conventions, this is repeated for advancing an input buffer, to make the resulting code more clean and readable. Additionally, although considered harmless for both string functions and additive operators, as previously discussed in GitHub PR 866, this fixes the main source of annoying sanitizer reports in the module. Prodded by UndefinedBehaviorSanitizer (pointer-overflow).
2025-12-23Configure: MSVC compatibility with PCRE2 10.47.Thierry Bastian1-0/+1
2025-12-23OCSP: fixed invalid type for the 'ssl_ocsp' directive.Roman Semenov2-2/+2
2025-12-23Updated OpenSSL and PCRE used for win32 builds.Sergey Kandaurov1-2/+2
2025-12-23SSL: fixed "key values mismatch" with object cache inheritance.Sergey Kandaurov2-12/+63
In rare cases, it was possible to get into this error state on reload with improperly updated file timestamps for certificate and key pairs. The fix is to retry on X509_R_KEY_VALUES_MISMATCH, similar to 5d5d9adcc. Additionally, loading SSL certificate is updated to avoid certificates discarded on retry to appear in ssl->certs and in extra chain.
2025-12-23Mail: xtext encoding (RFC 3461) in XCLIENT LOGIN.Sergey Kandaurov3-4/+43
The XCLIENT command uses xtext encoding for attribute values, as specified in https://www.postfix.org/XCLIENT_README.html. Reported by Igor Morgenstern of Aisle Research.
2025-12-23Upstream: overflow detection in Cache-Control delta-seconds.Sergey Kandaurov1-34/+47
Overflowing calculations are now aligned to the greatest positive integer as specified in RFC 9111, Section 1.2.2.
2025-12-23Fixed inaccurate index directive error report.willmafh1-1/+1
2025-12-23Updated link to xslscript.Sergey Kandaurov1-1/+1
2025-12-23Updated OpenSSL used for win32 builds.Sergey Kandaurov1-1/+1
2025-12-23Mail: reset stale auth credentials with "smtp_auth none;".Sergey Kandaurov2-1/+7
They might be reused in a session if an SMTP client proceeded unauthenticated after previous invalid authentication attempts. This could confuse an authentication server when passing stale credentials along with "Auth-Method: none". The condition to send the "Auth-Salt" header is similarly refined.
2025-12-23Mail: improved error handling in plain/login/cram-md5 auth methods.Sergey Kandaurov1-16/+22
Previously, login and password storage could be left in inconsistent state in a session after decoding errors.
2025-12-23Auth basic: fixed file descriptor leak on memory allocation error.Sergey Kandaurov1-1/+2
Found by Coverity (CID 1662016).
2025-12-23HTTP/2: fixed handling of the ":authority" header.Sergey Kandaurov1-15/+105
Previously, it misused the Host header processing resulting in 400 (Bad Request) errors for a valid request that contains both ":authority" and Host headers with the same value, treating it after 37984f0be as if client sent more than one Host header. Such an overly strict handling violates RFC 9113. The fix is to process ":authority" as a distinct header, similarly to processing an authority component in the HTTP/1.x request line. This allows to disambiguate and compare Host and ":authority" values after all headers were processed. With this change, the ngx_http_process_request_header() function can no longer be used here, certain parts were inlined similar to the HTTP/3 module. To provide compatibility for misconfigurations that use $http_host to return the value of the ":authority" header, the Host header, if missing, is now reconstructed from ":authority".
2025-12-23HTTP/2: factored out constructing the Host header.Sergey Kandaurov1-39/+48
No functional changes.
2025-12-23HTTP/3: fixed handling of :authority and Host with port.Roman Arutyunyan1-5/+8
RFC 9114, Section 4.3.1. specifies a restriction for :authority and Host coexistence in an HTTP/3 request: : If both fields are present, they MUST contain the same value. Previously, this restriction was correctly enforced only for portless values. When Host contained a port, the request failed as if :authority and Host were different, regardless of :authority presence. This happens because the value of r->headers_in.server used for :authority has port stripped. The fix is to use r->host_start / r->host_end instead.
2025-12-23HTTP/3: fixed potential type overflow in string literal parser.Sergey Kandaurov1-0/+6
This might happen for Huffman encoded string literals as the result of length expansion. Notably, the maximum length of string literals is already limited with the "large_client_header_buffers" directive, so this was only possible with nonsensically large configured limits.
2025-12-23Events: compatibility with NetBSD 10.0 in kqueue.Sergey Kandaurov1-2/+2
The kevent udata field was changed from intptr_t to "void *", similar to other BSDs and Darwin. The NGX_KQUEUE_UDATA_T macro is adjusted to reflect that change, fixing -Werror=int-conversion errors.
2025-12-23Configure: set NGX_KQUEUE_UDATA_T at compile time.Sergey Kandaurov2-20/+9
The NGX_KQUEUE_UDATA_T macro is used to compensate the incompatible kqueue() API in NetBSD, it doesn't really belong to feature tests. The change limits the macro visibility to the kqueue event module. Moving from autotests also simplifies testing a particular NetBSD version as seen in a subsequent change.
2025-12-23Events: fixed -Wzero-as-null-pointer-constant warnings in kqueue.Sergey Kandaurov1-2/+2
The kevent udata field is special in that we maintain compatibility with NetBSD versions that predate using the "void *" type. The fix is to cast to intermediate uintptr_t that is casted back to "void *" where appropriate.
2025-12-23SSL: fixed testing OPENSSL_VERSION_NUMBER for OpenSSL 3.0+.Sergey Kandaurov2-2/+2
Prior to OpenSSL 3.0, OPENSSL_VERSION_NUMBER used the following format: MNNFFPPS: major minor fix patch status Where the status nibble (S) has 0+ for development and f for release. The format was changed in OpenSSL 3.0.0, where it is always zero: MNN00PP0: major minor patch
2025-12-23SSL: SSL_group_to_name() compatibility macro.Sergey Kandaurov2-12/+5
No functional changes.
2025-12-23Win32: fixed PCRE license for nginx/Windows zip.Sergey Kandaurov1-1/+1
2025-12-23Updated OpenSSL and PCRE used for win32 builds.Sergey Kandaurov1-2/+2