Conversation
nginx 1.30.1 contains a fix for CVE-2026-42945, a heap buffer overflow in ngx_http_rewrite_module (CVSS v4.0: 9.2, Critical). When a rewrite replacement contains '?', ngx_http_script_start_args_code sets e->is_args = 1 on the main script engine and never clears it. A subsequent set or if directive sizes its buffer using a fresh sub-engine (no escaping), but copies using the main engine (NGX_ESCAPE_ARGS active), expanding '+', '%', '&' bytes by two each and overrunning the heap. Upstream fix: add e->is_args = 0 at the top of ngx_http_script_regex_end_code() (commit 524977e7c534). Also upgrade njs from v0.8.4 to v0.9.8. Reported-by: Leo Lin Fixes: https://nginx.org/en/security_advisories.html CVE: CVE-2026-42945 Signed-off-by: Daniel Casota <dcasota@gmail.com>
Owner
Author
|
Superseded. This proposed nginx 1.30.1 for CVE-2026-42945; vmware/5.0 now ships 1.30.4, and PRs vmware#1664/vmware#1665/vmware#1666 upstream are moving the remaining branches to 1.30.4 for CVE-2026-42533. Reopen or rebase onto 1.30.4 if that CVE turns out not to be covered there. |
This was referenced Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrade nginx from 1.27.1 to 1.30.1 and njs from 0.8.4 to 0.9.8 on
Photon OS master.
nginx 1.30.1 (released 2026-05-13) fixes six vulnerabilities in one
coordinated disclosure. The prior stable lines received no further
releases after the disclosure — moving to the 1.30 stable branch is
required to pick up all fixes:
CVE-2026-42945 heap buffer overflow in ngx_http_rewrite_module (CVSS 9.2)
CVE-2026-42926 proxy_set_body data injection
CVE-2026-42946 scgi/uwsgi buffer overread
CVE-2026-42934 charset_map buffer overread
CVE-2026-40460 HTTP/3 connection migration spoofing
CVE-2026-40701 use-after-free in DNS / ssl_ocsp
Root cause of CVE-2026-42945: in ngx_http_script_regex_end_code()
(src/http/ngx_http_script.c), a rewrite replacement containing '?' sets
e->is_args = 1 on the main script engine and never clears it. A subsequent
set/if directive sizes its buffer on a fresh sub-engine (no escaping), but
copies using the main engine (NGX_ESCAPE_ARGS active), expanding '+', '%',
'&' bytes by two each and overrunning the heap. Upstream fix: commit
524977e7c534.
Two sha512 checksums updated to match the nginx 1.30.1 and njs 0.9.8
source tarballs.
Downstream: Harbor goharbor/nginx-photon installs nginx via tdnf,
making every Harbor v2.x release on Photon master affected.
Fixes: CVE-2026-42945
CVE: CVE-2026-42945
Reported-by: DepthFirstDisclosures https://github.com/DepthFirstDisclosures/Nginx-Rift
Reported-by: Yaminyam vmware#1654
Signed-off-by: Daniel Casota dcasota@gmail.com
References
Test plan
tdnf install nginxinstalls 1.30.1-1nginx -vreportsnginx/1.30.1nginx -tpasses with default configOperator notes — behavioral changes
This version bump spans nginx 1.27.1 → 1.30.1 and njs 0.8.4 → 0.9.8.
The following silent behavioral changes may affect existing configurations.
nginx
proxy_http_versiondefault changed to1.1(nginx 1.29.7)The default
proxy_http_versionchanged from1.0to1.1, and theConnectionheader is no longer forwarded to upstream. Most backends handlethis transparently; HTTP/1.0-only backends require an explicit override:
Upstream keepalive enabled by default (nginx 1.29.7)
Keepalive connections to upstream servers are now enabled by default.
To restore the previous per-request connection behavior:
TLSv1 and TLSv1.1 removed from default
ssl_protocols(nginx 1.27.3)The default
ssl_protocolsvalue no longer includes TLSv1 and TLSv1.1.Configurations serving legacy TLS 1.0/1.1 clients must add an explicit
ssl_protocolsdirective.Chunked transfer encoding: bare
\nline endings rejected (nginx 1.29.4)Chunked requests using
\ninstead of\r\nas line terminators arerejected with 400. This is RFC 7230 compliant; non-conforming upstream
clients must be fixed.
RFC 3986
Hostheader validation (nginx 1.29.4)Invalid characters in the
Hostheader now result in a 400 response.TLSv1.3 certificate compression disabled by default (nginx 1.29.1)
To re-enable:
ssl_certificate_compression on;njs (0.8.4 → 0.9.8, dynamic module)
Binary data handling changed (njs 0.8.5)
Binary data is no longer transparently stored in JS strings. Scripts that
process binary response or request bodies must switch to
r.rawVariablesor
r.requestBuffer.Removed
Stringencoding methods (njs 0.9.0)String.bytesFrom(),fromBytes(),fromUTF8(),toBytes(),toUTF8(),and
toString(encoding)are removed. Scripts using these methods will failat load time. Because njs is a dynamic module on master, nginx continues
running — only the njs module fails to load, leaving js_* directives
non-functional.