CVE-2022-34029
📋 TL;DR
CVE-2022-34029 is an out-of-bounds read vulnerability in Nginx NJS (JavaScript engine) that could allow attackers to read sensitive memory contents or cause denial of service. This affects systems running Nginx with NJS module enabled. The vulnerability is in the njs_scope_value function and has a high CVSS score of 9.1.
💻 Affected Systems
- Nginx NJS (JavaScript engine for Nginx)
📦 What is this software?
⚠️ Risk & Real-World Impact
Worst Case
Remote code execution leading to complete system compromise if combined with other vulnerabilities, or sensitive information disclosure from memory.
Likely Case
Denial of service causing Nginx worker processes to crash, potentially disrupting web services.
If Mitigated
Limited impact with proper network segmentation and minimal NJS usage, though still presents availability risk.
🎯 Exploit Status
Proof of concept demonstrates triggering the out-of-bounds read. Full weaponization for RCE would require additional exploitation techniques.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: NJS version 0.7.5 and later
Vendor Advisory: https://github.com/nginx/njs/issues/506
Restart Required: Yes
Instructions:
1. Update NJS to version 0.7.5 or later. 2. Recompile Nginx with updated NJS module if using source build. 3. Restart Nginx service. 4. For package managers: use appropriate update command (apt-get upgrade nginx-module-njs, yum update nginx-module-njs, etc.)
🔧 Temporary Workarounds
Disable NJS Module
linuxTemporarily disable NJS functionality if not required
Comment out or remove 'js_include' and 'js_content' directives in nginx.conf
Reload nginx: nginx -s reload
🧯 If You Can't Patch
- Implement strict network access controls to limit exposure to Nginx services
- Deploy web application firewall (WAF) rules to detect and block exploitation attempts
🔍 How to Verify
Check if Vulnerable:
Check NJS version: nginx -V 2>&1 | grep njs or check nginx configuration for js_* directives
Check Version:
nginx -V 2>&1 | grep njs
Verify Fix Applied:
Verify NJS version is 0.7.5 or higher: nginx -V 2>&1 | grep njs
📡 Detection & Monitoring
Log Indicators:
- Nginx worker process crashes
- Segmentation fault errors in error.log
- Unusual memory access patterns
Network Indicators:
- HTTP requests triggering NJS functionality followed by service disruption
SIEM Query:
source="nginx_error.log" AND ("segmentation fault" OR "SIGSEGV" OR "worker process")