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 — Local risk assessment script for CVE-2026-42945 (nginx-rift). Checks version, vulnerable rewrite+set config, ASLR status, and compile hardening to determine actual RCE vs. DoS risk. | Kitploit
Tools/GitHubGitHub/chenqin231/cve-2026-42945
Vulnerability ScannersVulnerability AnalysisExploitationConfiguration AuditingWeb SecurityBinary Analysis
GitHubchenqin231/cve-2026-42945

CVE-2026-42945

Local risk assessment script for CVE-2026-42945 (nginx-rift). Checks version, vulnerable rewrite+set config, ASLR status, and compile hardening to determine actual RCE vs. DoS risk.

View Repository
133 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 Practical Risk Assessment Script

A local risk assessment tool for CVE-2026-42945 (Nginx Rift). Unlike simply telling you "version is affected so it's dangerous", this script checks the three conditions that truly determine risk layer by layer and gives a conclusion tailored to your actual situation.


Background

CVE-2026-42945 is a heap buffer overflow vulnerability (CWE-122) in nginx's ngx_http_rewrite_module that existed for 18 years, with a CVSS 4.0 score of 9.2. However, the advisory contains a critical qualifier:

"Code execution possible on systems without ASLR protection"

RCE requires three conditions to be met simultaneously:

  1. nginx is configured with a specific combination of rewrite + set directives
  2. The system has ASLR disabled (modern Linux enables it by default)
  3. All heap address bytes of nginx happen to be URI-safe characters

If any condition is missing, the worst case is a worker process crash and automatic restart (DoS), not server takeover.

Detailed analysis: The 18-year-old bomb in nginx: Did the 9.2-score vulnerability actually blow up your server?


Quick Usage

root@kitploit:~
# Run (requires sudo to read full nginx config)
sudo bash check_cve_2026_42945.sh

Detection Items

The script checks the following items in order; it exits early with a conclusion if any condition is not met:

Check ItemDescription
nginx versionAffected range: 0.6.27 – 1.30.0
Vulnerability trigger configurationSimultaneous presence of rewrite containing ? and capture group set inside the same location block
ASLR statusRead /proc/sys/kernel/randomize_va_space
Compilation hardeningDetection of -fcf-protection / FORTIFY_SOURCE / Full RELRO / stack protection

Output Examples

Case 1: Version affected but no vulnerability trigger configuration (most common)

root@kitploit:~
[*] nginx version: 1.24.0
[!] Version 1.24.0 is within the affected range, continuing to check trigger conditions...
[*] Scanning nginx configuration (checking rewrite+set vulnerability configuration combination)...
[✓] No vulnerability trigger configuration found (rewrite+set combination)

  Conclusion: Version is affected but no trigger configuration exists, actual risk is extremely low
  Recommendation: Plan upgrade to 1.30.1 / 1.31.0, no emergency action needed

Case 2: Vulnerability configuration present, ASLR enabled, compilation hardening complete

root@kitploit:~
[!] Version 1.24.0 is within the affected range, continuing to check trigger conditions...
[!] Vulnerable trigger configuration found:
    → location ~ ^/api/(.*)$ {
[✓] ASLR is enabled (level 2, full randomization)
    → Prerequisites for reliable RCE exploitation not met, worst case is worker process crash (DoS)
[✓] Detected -fcf-protection (Intel CET control flow protection)
[✓] Detected FORTIFY_SOURCE=3
[✓] Detected Full RELRO (GOT read-only)
[✓] Detected stack protection (stack-protector)

  Risk Level: Low
  Recommendation: Upgrade to nginx 1.30.1 / 1.31.0 during next maintenance window

Case 3: Vulnerability configuration present, ASLR disabled

root@kitploit:~
[!] Vulnerable trigger configuration found:
    → location ~ ^/api/(.*)$ {
[✗] ASLR is disabled! RCE risk significantly increased

  Risk Level: High (DoS confirmed / RCE possible)

  Immediate Actions:
  1. Temporarily remove or modify the vulnerable rewrite+set configuration
  2. Confirm ASLR is enabled: echo 2 | sudo tee /proc/sys/kernel/randomize_va_space
  3. Upgrade nginx: apt install nginx   or   compile and install 1.30.1+

Risk Level Description

LevelMeaningRecommended Response Timeline
No Impactnginx not installed or version already fixedNo action needed
Extremely LowVersion affected but no trigger configurationUpgrade during next routine maintenance
LowTrigger configuration present, but ASLR + compilation hardening completeUpgrade at next maintenance window
MediumTrigger configuration present, protection gaps existUpgrade as soon as possible, availability at risk
HighTrigger configuration present + ASLR disabled + hardening missingImmediate action

Fixed Versions

ProductAffected VersionsFixed Versions
NGINX Open Source0.6.27 – 1.30.01.30.1 / 1.31.0
NGINX PlusR32 – R36R36 P4 / R35 P2 / R32 P6
root@kitploit:~
# Ubuntu / Debian
sudo apt update && sudo apt install nginx

# Verify version
nginx -v

Official announcement: https://my.f5.com/manage/s/article/K000161019


Test Coverage

The script has been verified in the following scenarios:

  • nginx not installed → exits directly
  • nginx version not in affected range (1.31.0) → not affected
  • Version affected, no trigger configuration → extremely low risk
  • Version affected, trigger configuration present, ASLR enabled, hardening complete → low risk
  • Version affected, trigger configuration present, ASLR disabled → medium/high risk

Test environment: Ubuntu 22.04 LTS, nginx 1.24.0 (Ubuntu official package)


Limitations

  • Configuration detection is based on regex matching; complex multi-level include structures may be missed (the script expands all includes via nginx -T, covering the vast majority of cases)
  • Does not detect OpenResty / Tengine or other nginx derivative versions
  • Only works on Linux systems

License

MIT

Download Tool