The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-42945

CVE-2026-42945: NGINX Buffer Overflow Vulnerability

CVE-2026-42945 is a heap buffer overflow vulnerability in NGINX Plus and NGINX Open Source affecting the ngx_http_rewrite_module. This article covers technical details, affected versions, impact, and mitigation.

Published: May 17, 2026

CVE-2026-42945 Overview

CVE-2026-42945 is a heap buffer overflow [CWE-122] in the ngx_http_rewrite_module of NGINX Plus and NGINX Open Source. The flaw is triggered when a rewrite directive is followed by another rewrite, if, or set directive that uses an unnamed Perl-Compatible Regular Expression (PCRE) capture such as $1 or $2, with a replacement string containing a question mark (?). An unauthenticated remote attacker can send crafted HTTP requests to corrupt heap memory in the NGINX worker process. The condition causes a worker restart and, on systems with Address Space Layout Randomization (ASLR) disabled, can lead to arbitrary code execution.

Critical Impact

Unauthenticated remote attackers can crash NGINX worker processes and potentially achieve code execution against affected web servers and reverse proxies.

Affected Products

  • NGINX Plus (versions still under Technical Support)
  • NGINX Open Source (versions still under Technical Support)
  • Deployments using the ngx_http_rewrite_module with chained rewrite/if/set directives and unnamed PCRE captures

Discovery Timeline

  • 2026-05-13 - CVE-2026-42945 published to NVD
  • 2026-05-14 - Last updated in NVD database

Technical Details for CVE-2026-42945

Vulnerability Analysis

The vulnerability lives in NGINX's ngx_http_rewrite_module, which evaluates rewrite, conditional, and variable-assignment directives at request processing time. When a rewrite directive containing an unnamed PCRE capture group is followed by an additional rewrite, if, or set directive, and the replacement string includes a question mark, the module miscalculates the size of the destination buffer used to construct the rewritten value. The undersized allocation results in writes that exceed the heap chunk boundary.

The overflow occurs inside the NGINX worker process. At minimum, the corrupted memory causes the worker to abort and restart, producing a denial-of-service condition. On targets where ASLR is disabled, predictable heap layout makes arbitrary code execution feasible from a single crafted HTTP request.

Root Cause

The root cause is improper length calculation when expanding an unnamed PCRE capture into a replacement string that contains a literal ? character. The question mark interacts with NGINX's handling of the query-string boundary inside rewrite expressions, producing a buffer allocation smaller than the data subsequently written to it.

Attack Vector

Exploitation requires the target NGINX instance to be configured with the affected directive pattern. An unauthenticated attacker sends an HTTP request whose URI matches the vulnerable rewrite regular expression. The crafted path triggers the malformed replacement and overflows the heap buffer in the worker process. Conditions beyond attacker control, such as memory layout and configuration specifics, influence reliability. See the DepthFirst Nginx Rift Analysis and the GitHub Nginx Rift Disclosure Repository for technical details.

Detection Methods for CVE-2026-42945

Indicators of Compromise

  • Repeated NGINX worker process restarts logged in error.log with signal 11 (SIGSEGV) or worker process exited on signal entries
  • HTTP request URIs containing unusual sequences designed to match rewrite regular expressions and include question marks in capture-driven replacements
  • Sudden spikes in 5xx responses correlated with crashes of specific worker PIDs

Detection Strategies

  • Audit NGINX configuration files for rewrite directives that use unnamed PCRE captures ($1, $2) followed by rewrite, if, or set directives, with replacements containing ?
  • Parse error.log for repeated worker terminations and correlate with the source IP and URI of preceding requests in access.log
  • Inspect core dumps from NGINX workers, if enabled, for evidence of heap corruption inside ngx_http_script_regex_end_code

Monitoring Recommendations

  • Forward NGINX access and error logs into a central analytics platform and alert on worker crash patterns
  • Monitor request rates and URI entropy targeting endpoints governed by rewrite rules
  • Track process restart counts for nginx: worker process and alert on thresholds exceeding baseline

How to Mitigate CVE-2026-42945

Immediate Actions Required

  • Apply fixed NGINX Plus or NGINX Open Source versions as documented in F5 Security Article K000161019
  • Inventory all NGINX deployments and identify configurations matching the vulnerable directive pattern
  • Ensure ASLR is enabled at the operating system level to reduce the likelihood of code execution
  • Restrict external exposure of NGINX instances that cannot be patched immediately

Patch Information

F5 has published remediation guidance in F5 Security Article K000161019. Software versions that have reached End of Technical Support (EoTS) are not evaluated and should be upgraded to supported releases. Operators should verify the running version with nginx -v and update package sources accordingly.

Workarounds

  • Refactor affected configurations to remove unnamed PCRE captures from rewrite replacements that include ?, using named captures or static query strings instead
  • Remove or reorder rewrite, if, and set chains that follow the vulnerable rewrite directive
  • Place a web application firewall in front of NGINX to filter requests with URI patterns targeting the vulnerable rewrite expressions
  • Confirm ASLR is enabled by verifying /proc/sys/kernel/randomize_va_space returns 2
bash
# Configuration example
# Verify NGINX version
nginx -v

# Confirm ASLR is enabled on Linux hosts
cat /proc/sys/kernel/randomize_va_space

# Test configuration after refactoring rewrite rules
nginx -t && nginx -s reload

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeBuffer Overflow

  • Vendor/TechNginx

  • SeverityCRITICAL

  • CVSS Score9.2

  • EPSS Probability0.15%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV: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
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-122
  • Technical References
  • F5 Security Article K000161019

  • DepthFirst Nginx Rift Analysis

  • GitHub Nginx Rift Disclosure Repository
  • Related CVEs
  • CVE-2026-27654: F5 Nginx Plus Buffer Overflow Vulnerability

  • CVE-2021-46461: Nginx Njs Buffer Overflow Vulnerability

  • CVE-2021-23017: F5 Nginx Buffer Overflow Vulnerability

  • CVE-2026-44015: Nginxui Nginx UI SSRF Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English