{"id":12850,"date":"2026-05-14T10:04:31","date_gmt":"2026-05-14T10:04:31","guid":{"rendered":"https:\/\/serisec.com\/index.php\/2026\/05\/14\/critical-18-year-old-nginx-vulnerability-enables-remote-code-execution-attacks\/"},"modified":"2026-05-14T10:04:31","modified_gmt":"2026-05-14T10:04:31","slug":"critical-18-year-old-nginx-vulnerability-enables-remote-code-execution-attacks","status":"publish","type":"post","link":"https:\/\/serisec.com\/index.php\/2026\/05\/14\/critical-18-year-old-nginx-vulnerability-enables-remote-code-execution-attacks\/","title":{"rendered":"Critical 18-Year-Old NGINX Vulnerability Enables Remote Code Execution Attacks"},"content":{"rendered":"<p>    Critical 18-Year-Old NGINX Vulnerability Enables Remote Code Execution Attacks<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n    <!-- no image --><br \/>\n \t<BR><br \/>\n<BR><\/BR><\/p>\n<div>\n<p>A critical heap buffer overflow vulnerability has been discovered in the source code of NGINX, present since 2008.<\/p>\n<p>This vulnerability has been publicly disclosed, along with a working proof-of-concept exploit that can enable unauthenticated remote code execution (RCE) against one of the most widely used web servers in the world.<\/p>\n<p>Assigned a CVSS score of 9.2,\u00a0CVE-2026-42945\u00a0resides in NGINX\u2019s\u00a0ngx_http_rewrite_module.<\/p>\n<p>This engine powers URL rewriting and variable assignment in virtually every modern NGINX deployment.<\/p>\n<p>The bug was first introduced in version 0.6.27, released in\u00a02008, and remained undetected for 18 years across all versions up to 1.30.0.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-18-year-old-nginx-rce-vulnerability\"><strong>18-Year-Old NGINX RCE Vulnerability<\/strong><\/h2>\n<p>The flaw is triggered when a configuration uses both\u00a0rewrite\u00a0and\u00a0set\u00a0directives together, a common pattern in API gateway setups.<\/p>\n<p><a href=\"https:\/\/cybersecuritynews.com\/threat-actors-hacking-nginx-servers\/\" target=\"_blank\" rel=\"noreferrer noopener\">NGINX\u2019s internal script engine<\/a> processes these directives using a\u00a0two-pass system: the first pass calculates memory length, and the second writes data into the allocated buffer.<\/p>\n<p>The critical flaw lies in a state mismatch between the two passes. When a\u00a0rewrite\u00a0directive contains a question mark (?), it permanently sets an\u00a0is_args = 1\u00a0flag on the main script engine.<\/p>\n<p>However, during the first (length calculation) pass, a zeroed-out sub-engine is used, meaning\u00a0is_args\u00a0is effectively zero. The length is calculated without accounting for URI escaping.<\/p>\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEgERSnm1wpSJLa9ZFL7IgwLKj1nLEkmwcRdmFe32pAExQLRcmpZD16oVbZkyDRI34dNzUjx-7q17ojIUV8wliw5ZTRnOAI62MlYWbdpn8oBWjoDCHXPWIiBZfeH5lblBFnH4GcGQaDhcowEcIdXE5wIy8BcMXOcgI7hRMa0CPoRkiPNBdhIiMlbliSd4J8\/s1600\/Screenshot%25202026-05-14%2520114347%2520%25281%2529.webp?ssl=1\" alt=\"NGINX Hit by 4 Memory Flaws (source :depthfirst)\"><figcaption class=\"wp-element-caption\">NGINX Hit by 4 Memory Flaws (source:depthfirst)<\/figcaption><\/figure>\n<p>In the second (copy) pass, the main engine runs with\u00a0is_args = 1, causing the\u00a0ngx_escape_uri\u00a0function to\u00a0expand each escapable byte from 1 to 3 bytes.<\/p>\n<p>The result: far more data is written to the buffer than was allocated, leading to a classic <a href=\"https:\/\/cybersecuritynews.com\/windows-heap-based-buffer-overflow-vulnerability\/\" target=\"_blank\" rel=\"noreferrer noopener\">heap buffer overflow.<\/a><\/p>\n<p>Researchers developed a working RCE exploit for systems with ASLR disabled.<\/p>\n<p>The <a href=\"https:\/\/depthfirst.com\/research\/nginx-rift-achieving-nginx-rce-via-an-18-year-old-vulnerability\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">security research firm depthfirst autonomously discovered the vulnerability<\/a>\u00a0during an April 2026 code audit that also uncovered three additional memory corruption bugs.<\/p>\n<p>The attack chains heap manipulation, fake cleanup structure spraying via POST bodies, and NGINX\u2019s deterministic multi-process architecture to achieve\u00a0reliable, repeatable code execution. A public PoC is now available on GitHub.<\/p>\n<figure class=\"wp-block-video\"><video controls src=\"https:\/\/depthfirst.com\/uploads\/editorial\/body\/nginx_rce.mov\"><\/video><\/figure>\n<p>Three additional CVEs were confirmed alongside the critical flaw:<\/p>\n<figure class=\"wp-block-table\">\n<table class=\"has-fixed-layout\">\n<thead>\n<tr>\n<th class=\"has-text-align-left\" data-align=\"left\">CVE<\/th>\n<th class=\"has-text-align-left\" data-align=\"left\">Severity<\/th>\n<th class=\"has-text-align-left\" data-align=\"left\">CVSS<\/th>\n<th class=\"has-text-align-left\" data-align=\"left\">Affected Module<\/th>\n<th class=\"has-text-align-left\" data-align=\"left\">Impact<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td class=\"has-text-align-left\" data-align=\"left\">CVE-2026-42945<\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">Critical<\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">9.2<\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">ngx_http_rewrite_module<\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">Heap buffer overflow \u2192 RCE<\/td>\n<\/tr>\n<tr>\n<td class=\"has-text-align-left\" data-align=\"left\">CVE-2026-42946<\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">High<\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">8.3<\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">ngx_http_scgi\/uwsgi_module<\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">~1 TB allocation \u2192 crash<\/td>\n<\/tr>\n<tr>\n<td class=\"has-text-align-left\" data-align=\"left\">CVE-2026-40701<\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">Medium<\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">6.3<\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">ngx_http_ssl_module<\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">Use-after-free via OCSP<\/td>\n<\/tr>\n<tr>\n<td class=\"has-text-align-left\" data-align=\"left\">CVE-2026-42934<\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">Medium<\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">6.3<\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">ngx_http_charset_module<\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">Out-of-bounds read<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>The vulnerability impacts a wide range of <a href=\"https:\/\/cybersecuritynews.com\/f5-patches-critical-vulnerabilities\/\" target=\"_blank\" rel=\"noreferrer noopener\">F5\/NGINX products<\/a>, including\u00a0NGINX Open Source 0.6.27\u20131.30.0, NGINX Plus R32\u2013R36, NGINX Instance Manager, NGINX App Protect WAF, NGINX Gateway Fabric, and NGINX Ingress Controller.<\/p>\n<figure class=\"wp-block-table\">\n<table class=\"has-fixed-layout\">\n<thead>\n<tr>\n<th class=\"has-text-align-left\" data-align=\"left\">Product<\/th>\n<th class=\"has-text-align-left\" data-align=\"left\">Affected Versions<\/th>\n<th class=\"has-text-align-left\" data-align=\"left\">Patched Version<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td class=\"has-text-align-left\" data-align=\"left\">NGINX Plus<\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">R32 \u2013 R36<\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">R36 P1+ \/ R37+<\/td>\n<\/tr>\n<tr>\n<td class=\"has-text-align-left\" data-align=\"left\">NGINX Instance Manager<\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">2.16.0 \u2013 2.21.1<\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">2.21.2+<\/td>\n<\/tr>\n<tr>\n<td class=\"has-text-align-left\" data-align=\"left\">F5 WAF for NGINX<\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">5.9.0 \u2013 5.12.1<\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">5.12.2+<\/td>\n<\/tr>\n<tr>\n<td class=\"has-text-align-left\" data-align=\"left\">NGINX App Protect WAF<\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">4.9.0 \u2013 4.16.0 and 5.1.0 \u2013 5.8.0<\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">4.16.1+ \/ 5.8.1+<\/td>\n<\/tr>\n<tr>\n<td class=\"has-text-align-left\" data-align=\"left\">F5 DoS for NGINX<\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">4.8.0<\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">4.8.1+<\/td>\n<\/tr>\n<tr>\n<td class=\"has-text-align-left\" data-align=\"left\">NGINX App Protect DoS<\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">4.3.0 \u2013 4.7.0<\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">4.7.1+<\/td>\n<\/tr>\n<tr>\n<td class=\"has-text-align-left\" data-align=\"left\">NGINX Gateway Fabric<\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">1.3.0 \u2013 1.6.2 and 2.0.0 \u2013 2.5.1<\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">1.6.3+ \/ 2.5.2+<\/td>\n<\/tr>\n<tr>\n<td class=\"has-text-align-left\" data-align=\"left\">NGINX Ingress Controller<\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">3.5.0 \u2013 3.7.2, 4.0.0 \u2013 4.0.1, 5.0.0 \u2013 5.4.1<\/td>\n<td class=\"has-text-align-left\" data-align=\"left\">3.7.3+ \/ 4.0.2+ \/ 5.4.2+<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p><a href=\"https:\/\/my.f5.com\/manage\/s\/article\/K000160932\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">F5 released its official security advisory<\/a> on\u00a0May 13, 2026. Administrators should\u00a0upgrade to NGINX 1.30.1 or 1.31.0\u00a0immediately.<\/p>\n<p>Organizations that cannot patch right away should audit configurations for combined\u00a0rewrite\u00a0+\u00a0set\u00a0directive usage and consider restricting exposed NGINX deployments behind an <span style=\"box-sizing: border-box; margin: 0px; padding: 0px;\">additional\u00a0WAF<\/span>layer until patching is complete.<\/p>\n<p class=\"has-text-align-center has-background\" style=\"background:linear-gradient(180deg,rgb(238,238,238) 91%,rgb(169,184,195) 100%)\"><strong>Follow us on\u00a0<a href=\"https:\/\/news.google.com\/publications\/CAAqMggKIixDQklTR3dnTWFoY0tGV041WW1WeWMyVmpkWEpwZEhsdVpYZHpMbU52YlNnQVAB?hl=en-IN&amp;gl=IN&amp;ceid=IN:en\" target=\"_blank\" rel=\"noreferrer noopener\">Google News<\/a>,\u00a0<a href=\"https:\/\/www.linkedin.com\/company\/cybersecurity-news\/\" target=\"_blank\" rel=\"noreferrer noopener\">LinkedIn<\/a>,\u00a0and\u00a0<a href=\"https:\/\/x.com\/cyber_press_org\" target=\"_blank\" rel=\"noreferrer noopener\">X<\/a>\u00a0to Get More Instant Updates.<\/strong><\/p>\n<p>The post <a href=\"https:\/\/cybersecuritynews.com\/18-year-old-nginx-rce-vulnerability\/\">Critical 18-Year-Old NGINX Vulnerability Enables Remote Code Execution Attacks<\/a> appeared first on <a href=\"https:\/\/cybersecuritynews.com\/\">Cyber Security News<\/a>.<\/p>\n<\/div>\n<p> \t<BR><br \/>\n <BR><\/BR><br \/>\n    Abinaya<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n<a href=\"https:\/\/cybersecuritynews.com\/18-year-old-nginx-rce-vulnerability\/\">Go to cyber-security-news<\/a><br \/>\n \t<BR><br \/>\n <BR><\/BR><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Critical 18-Year-Old NGINX Vulnerability Enables Remote Code Execution Attacks A critical heap buffer overflow vulnerability has been discovered in the source code of NGINX, present since 2008. This vulnerability has been publicly disclosed, along with a working proof-of-concept exploit that can enable unauthenticated remote code execution (RCE) against one of the most widely used web [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[129,63,648],"tags":[130],"class_list":["post-12850","post","type-post","status-publish","format-standard","hentry","category-cyber-security","category-cyber-security-news","category-vulnerability-news","tag-cyber-security-news"],"_links":{"self":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts\/12850"}],"collection":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/comments?post=12850"}],"version-history":[{"count":0,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts\/12850\/revisions"}],"wp:attachment":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/media?parent=12850"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/categories?post=12850"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/tags?post=12850"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}