Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-42945 | Kitploit
Tools/GitHubGitHub/imsre9/cve-2026-42945
Vulnerability AnalysisExploitationWeb SecurityPenetration TestingLearning & EducationBinary Exploitation
GitHubimsre9/cve-2026-42945

CVE-2026-42945

View Repository
3 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2026-42945: NGINX Rift Heap Buffer Overflow Vulnerability

Overview

CVE-2026-42945 is a critical heap buffer overflow vulnerability in the NGINX server, known as "NGINX Rift". The vulnerability exists in the processing logic of the rewrite and set directives in NGINX. When specific configuration conditions are met, an attacker can trigger a heap overflow by crafting a malicious request, leading to denial of service (DoS) and potentially remote code execution (RCE).

Vulnerability Type: Heap Buffer Overflow Risk Level: High CVE ID: CVE-2026-42945


Affected Versions

  • Affected Versions: NGINX 0.6.27 ~ 1.30.0
  • Unaffected Versions: NGINX 1.31.0 and later

Fixed Versions

It is recommended to upgrade immediately to one of the following versions:

  • NGINX 1.31.0 or later stable version
  • Security patch versions provided by distribution vendors

Trigger Conditions

The vulnerability is triggered by simultaneously satisfying the following two conditions:

  1. Configuration Condition: NGINX configuration uses both:

    • rewrite directive (the replacement string contains the ? character)
    • set directive (references rewrite regex capture groups like $1, $2)
  2. Request Condition: The request URI contains escapable characters (such as +, &, %, etc.)

Principle Explanation:

  • The rewrite directive sets e->is_args = 1 (never reset)
  • The length calculation stage of the set directive uses a zeroed sub-engine (le.is_args = 0)
  • NGINX decodes %25 to %, but ngx_escape_uri re-encodes it as %25 (3 bytes)
  • Each %25 character expands from 1 byte to 3 bytes, causing writes beyond the buffer boundary

Exploitation

PoC Testing

root@kitploit:~
# 使用项目中的测试脚本
python3 CVE-2026-42945/CVE-2026-42945-test.py --host cve.test.com --port 80

Vulnerability Verification Process

  1. Send a normal request to confirm the server's running status.
  2. Send a request containing a small number of %25 characters for a small-scale test.
  3. Send a large number of %25 characters (e.g., 2000) to trigger the buffer overflow.
  4. Check whether the server crashes or returns an abnormal response (500/502 error).
  5. Check whether the server automatically recovers (master process forks a new worker).

Test Results Analysis

Single-Layer Architecture POC Results

In a single-layer NGINX configuration, the test results will trigger the vulnerability:

Crash Log Analysis:

  • The worker process crashes due to SIGSEGV (signal).
  • The crash occurs in the ngx_http_script_flush_no_cacheable_variables function.
  • Crash phase: ngx_http_core_rewrite_phase.

Double-Layer Architecture POC Results

In a double-layer NGINX configuration (layer1 forwarding + layer2 service), the test results are as follows:


File Descriptions


References

  • NGINX Official Security Advisory
  • CVE-2026-42945 MITRE Details
  • NVD - CVE-2026-42945

Disclaimer

This project is for security research and educational purposes only. Users must comply with the laws and regulations of their respective countries and regions. The authors are not responsible for any unauthorized misuse.

Prohibited for illegal attacks!


Last Updated: 2026-05-19

Download Tool
Configuration Scenariolayer1 Resultlayer2 ResultCause Analysis
rewrite without break + proxy_pass❌ Triggered vulnerability (404)❌ No request reachesAfter rewrite, set continues executing, triggers heap overflow, worker crashes.
rewrite with break + proxy_pass✅ Normal (200)⚠️ May trigger vulnerabilitybreak terminates set execution, request is forwarded normally to the backend.
FileDescription
CVE-2026-42945/CVE-2026-42945-test.pyVulnerability testing PoC script, used to verify if the target is vulnerable.
single_layer_test/single_layer_nginx.confExample NGINX configuration vulnerable under single-layer architecture.
single_layer_test/image.pngVulnerability principle diagram.
single_layer_test/test.logTest log file.
double_layer_test/layer1_nginx.confNGINX configuration for the first layer (forwarding layer) of double-layer architecture.
double_layer_test/layer2_nginx.confNGINX configuration for the second layer (service layer) of double-layer architecture.