Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
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.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
NGINX_RIFT_SCAN_CVE_2026_42945 — Nginx Rewrite CVE Scan(CVE-2026-42945 nginx-rift CVE-2026-9256) | Kitploit
Tools/GitHubGitHub/friparia/nginx_rift_scan_cve_2026_42945
Static AnalysisVulnerability ScannersExploitationConfiguration AuditingWeb SecurityMisconfiguration
GitHubfriparia/nginx_rift_scan_cve_2026_42945

NGINX_RIFT_SCAN_CVE_2026_42945

Nginx Rewrite CVE Scan(CVE-2026-42945 nginx-rift CVE-2026-9256)

View Repository
349465 months agoReviewed by Kitploit
Share

NGINX Rift Config Scanner

Language: 中文 | English

This is a lightweight scanner for checking whether an NGINX configuration contains risky CVE-2026-42945, also known as NGINX Rift, and CVE-2026-9256 configuration patterns.

The issue was disclosed by depthfirst in NGINX Rift: Achieving NGINX RCE via an 18-Year-Old Vulnerability. Based on the article and F5/NVD descriptions, the risk depends on a specific ngx_http_rewrite_module configuration sequence: in the same configuration context, a rewrite replacement contains ?, and a following rewrite, if, or set references unnamed PCRE captures such as $1 or $2.

What It Checks

This tool looks for these high-risk patterns.

CVE-2026-42945

High-risk sequences like:

location ~ ^/api/(.*)$ {
    rewrite ^/api/(.*)$ /internal?migrated=true;
    set $original_endpoint $1;
}

The risk is not a standalone rewrite or set directive. The risky condition is the execution order inside the same context:

  1. rewrite uses a regex capture and its replacement contains ?
  2. A following rewrite, if, or set uses unnamed capture variables such as $1 or $2

This combination can cause inconsistent state between NGINX script length calculation and the actual copy phase, potentially leading to a heap buffer overflow.

CVE-2026-9256

High-risk rewrite directives like:

location / {
    rewrite /wengine-auth-static/((.*)) /?$1$2 break;
}

Risk conditions:

  1. The regex contains overlapping capture groups, for example $1 contains $2 in ^/((.*))$
  2. The replacement string references multiple overlapping capture groups in a redirect or arguments context, for example $1$2

Note that break does not exclude the risk. If multiple overlapping captures appear after ?, the replacement still enters the arguments context. A plain URI rewrite such as /$1$2 break is not a triggering condition for this CVE.

When this pattern is found, the scanner explicitly reports CVE-2026-9256.

Affected Range

The depthfirst article lists the affected range as:

  • NGINX Open Source 0.6.27 through 1.30.1
  • NGINX Plus R32 through R36
  • Some F5 / NGINX products based on NGINX

Use the official F5 advisory or your distribution security advisory as the source of truth for fixed versions and product-specific impact. Even when the version is in the affected range, the vulnerable configuration sequence is typically also required to trigger the issue.

The script prints both the current NGINX version and the configuration scan result:

  • Version is in 0.6.27 - 1.30.1 and vulnerable config is found: upgrade NGINX or adjust the config.
  • Version is in 0.6.27 - 1.30.1 but vulnerable config is not found: upgrade is recommended, but this scanner did not find the triggering config pattern.
  • Vulnerable config is found but the version is outside the affected range: review the config and keep the fixed version.

Usage

Scan the full NGINX configuration on the current host:

python3 scan_rift.py

The script runs:

nginx -T

If the current user cannot read the full configuration, run it with sudo:

sudo python3 scan_rift.py

You can also scan an exported configuration file:

python3 scan_rift.py /path/to/nginx-full.conf

For example:

sudo nginx -T > nginx-full.conf
python3 scan_rift.py nginx-full.conf

Output

When no vulnerable sequence is found:

--- NGINX Rift Config Scanner (CVE-2026-42945 / CVE-2026-9256) ---
Current NGINX Version: nginx version: nginx/1.23.3
Version Status: Affected version range for NGINX Open Source (0.6.27 - 1.30.1)

[+] No vulnerable CVE-2026-42945 sequences or CVE-2026-9256 patterns detected.

[Recommendation]: Current NGINX version is in the affected range, but no vulnerable config pattern was detected. Upgrade is recommended, but config risk was not found by this scanner.

When a suspicious sequence is found:

--- NGINX Rift Config Scanner (CVE-2026-42945 / CVE-2026-9256) ---
Current NGINX Version: nginx version: nginx/1.23.3
Version Status: Affected version range for NGINX Open Source (0.6.27 - 1.30.1)

[!] VULNERABLE SEQUENCE FOUND (CVE-2026-42945):
    Context: location ~ ^/api/(.*)$ {
    [1. Rewrite With ?] rewrite ^/api/(.*)$ /internal?migrated=true;
    [2. Follow-up $N]   set $original_endpoint $1;

[Action Required]: Current NGINX version is affected and vulnerable config was found. Upgrade NGINX or adjust the reported rewrite pattern.

When a suspicious CVE-2026-9256 pattern is found:

--- NGINX Rift Config Scanner (CVE-2026-42945 / CVE-2026-9256) ---
Current NGINX Version: nginx version: nginx/1.23.3
Version Status: Affected version range for NGINX Open Source (0.6.27 - 1.30.1)

[!] VULNERABLE PATTERN FOUND (CVE-2026-9256):
    Context: location ^~ /wengine-auth-static/ {
    [Rewrite Overlapping Captures] rewrite /wengine-auth-static/((.*)) /?$1$2 break;
    [Context] arguments; overlapping refs: $1/$2

[Action Required]: Current NGINX version is affected and vulnerable config was found. Upgrade NGINX or adjust the reported rewrite pattern.

If the scanner reports a match, manually verify whether that configuration context is reachable by external requests, then upgrade NGINX or adjust the configuration.

Remediation

  • Upgrade to a vendor-provided fixed version.
  • Review rewrite / set combinations in location, server, if, and related contexts.
  • Avoid using unnamed capture variables such as $1 or $2 after a rewrite that contains ?.
  • Avoid concatenating multiple overlapping capture groups in redirects or arguments, for example ^/((.*))$ with ?$1$2.
  • Do not treat break as a mitigation for CVE-2026-9256; /?$1$2 break still matches.
  • Consider named captures, saving variables before rewrite logic, splitting rewrite handling, or removing unnecessary query-string rewrites.
  • Prioritize internet-facing NGINX reverse proxies and entry points.
  • Do not rely on version checks alone; the triggering configuration sequence is also important.

Limitations

This is a static configuration scanner intended to quickly identify high-risk patterns. It is not an exploit validator.

  • False positives are possible and should be manually reviewed.
  • Complex multi-line directives, unusual include expansion, or dynamically generated configuration may affect scan quality.
  • A clean result from this scanner does not guarantee complete safety. Upgrading to the official fixed version is still recommended.

References

  • depthfirst: https://depthfirst.com/research/nginx-rift-achieving-nginx-rce-via-an-18-year-old-vulnerability
  • NVD CVE-2026-42945: https://nvd.nist.gov/vuln/detail/CVE-2026-42945
  • F5 Advisory K000161019: https://my.f5.com/manage/s/article/K000161019
Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    786
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    506
  • 3

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    429
  • 4

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    345
  • 5

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    262
  • 6

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    256

Explore all tools

Browse our collection of tools

View all tools →