PT-2026-40681 · F5+5 · Nginx Plus+6

CVE-2026-42945

·

Published

2026-05-13

·

Updated

2026-08-31

CVSS v4.0

9.2

Critical

VectorAV:N/AC:H/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Name of the Vulnerable Software and Affected Versions NGINX Plus and NGINX Open Source versions 0.6.27 through 1.30.0
Description A heap buffer overflow exists in the ngx http rewrite module module. The issue occurs when a rewrite directive is followed by a rewrite, if, or set directive and utilizes an unnamed Perl-Compatible Regular Expression (PCRE) capture (such as $1 or $2) with a replacement string containing a question mark (?). This is caused by inconsistent state management where an is args flag remains enabled during the data copy pass, leading the server to write escaped values that exceed the allocated buffer size.
An unauthenticated remote attacker can exploit this by sending crafted HTTP requests. This typically results in a denial of service due to the NGINX worker process crashing and restarting. However, remote code execution is possible on systems where Address Space Layout Randomization (ASLR), a security technique used to prevent exploitation by randomizing memory addresses, is disabled or bypassed. Approximately 18.9 million internet-facing NGINX servers were estimated to be potentially affected, and real-world exploitation has been observed.
Recommendations Update NGINX Open Source to version 1.30.1 or 1.31.0. Update NGINX Plus to version R32 P6 or R36 P4. As a temporary mitigation, replace all unnamed PCRE captures with named captures in the affected rewrite, if, or set directives.

Exploit

Fix

DoS

RCE

Heap Based Buffer Overflow

Found an issue in the description? Have something to add? Feel free to write us 👾

Weakness Enumeration

Related Identifiers

ALSA-2026:18029
ALSA-2026:18041
ALSA-2026:18063
ALSA-2026:19159
ALSA-2026:19371
ALSA-2026:19372
ALSA-2026:19374
AZL-86856
BDU:2026-06827
BIT-NGINX-2026-42945
BIT-NGINX-GATEWAY-2026-42945
CVE-2026-42945
ECHO-C2CF-7660-2DC1
OESA-2026-2405
OESA-2026-2406
OESA-2026-2407
OESA-2026-2408
OESA-2026-2510
OPENSUSE-SU-2026:10796-1
OPENSUSE-SU-2026:20796-1
RHSA-2026:17417
RHSA-2026:17751
RHSA-2026:17752
RHSA-2026:17753
RHSA-2026:17790
RHSA-2026:17791
RHSA-2026:17792
RHSA-2026:17793
RHSA-2026:17794
RHSA-2026:18029
RHSA-2026:18041
RHSA-2026:18063
RHSA-2026:19159
RHSA-2026:19371
RHSA-2026:19372
RHSA-2026:19374
SUSE-SU-2026:2050-1
SUSE-SU-2026:21832-1
SUSE-SU-2026:2370-1
USN-8271-1
USN-8375-1

Affected Products

Linuxmint
Nginx Open Source
Nginx Plus
Nginx
Red Os
Rocky Linux
Ubuntu