CVE-2025-1695
Executive Summary
CVE-2025-1695 is a denial-of-service (DoS) vulnerability affecting NGINX Unit when the Java Language Module is in use. An attacker can send undisclosed, specially crafted requests that cause an infinite loop within the Java module, leading to excessive CPU consumption and a limited denial-of-service condition. This is a data-plane-only issue, meaning the control plane (management API) is not exposed to the attack. The vulnerability has a CVSS score of 5.3 (Medium) and an EPSS score of 0.0%, indicating low exploitation likelihood at this time. No public proof-of-concept (PoC) or exploit code is available. The patch is available in NGINX Unit version 1.34.2.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability is not related to a package registry (NPM, PyPI, Go, Ruby). It affects the NGINX Unit application server, which is typically distributed via official package repositories or compiled from source. Organizations should verify the integrity of their NGINX Unit binaries and ensure they are sourced from trusted channels.
CVSS Breakdown & Threat Level
- CVSS Score: 5.3 (Medium)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
- Attack Vector (AV): Network – The vulnerability can be exploited remotely over the network.
- Attack Complexity (AC): Low – No special conditions are required for exploitation.
- Privileges Required (PR): None – No authentication is needed.
- User Interaction (UI): None – No user action is required.
- Scope (S): Unchanged – The vulnerable component is the only one affected.
- Confidentiality (C): None – No data is exposed.
- Integrity (I): None – No data is modified.
- Availability (A): Low – The attack causes a degradation of service (CPU exhaustion) but not a complete outage.
- Threat Level: Medium – The vulnerability is remotely exploitable with low complexity, but the impact is limited to availability degradation. No public exploit exists.
Deep Dive & Mechanics
The vulnerability resides in the Java Language Module of NGINX Unit. When NGINX Unit processes a request that is routed to a Java application, the module enters a specific code path that, under certain undisclosed conditions, fails to terminate correctly. This leads to an infinite loop, consuming CPU resources indefinitely.
The root cause is likely a missing or incorrect termination condition in a loop that processes request data or handles a specific state within the Java module. The exact trigger is not publicly documented, but it involves sending a crafted request that causes the module to enter a state where it repeatedly attempts to process the same data without making progress.
Because the control plane (the API used to configure NGINX Unit) is separate from the data plane (the request processing), the attack cannot affect the management interface. The impact is limited to the worker processes handling the malicious requests, which will consume 100% CPU until the process is killed or the service is restarted.
Vulnerable vs. Patched Code
The patch in version 1.34.2 addresses the infinite loop by adding a proper exit condition or by validating the request data before entering the loop. The exact code change is not publicly available, but the fix likely involves:
- Adding a counter or timeout to break out of the loop after a certain number of iterations.
- Validating the request structure to prevent the loop from being entered with malformed data.
- Correcting the logic that determines when the loop should terminate.
Vulnerable Code (Conceptual):
while (hasMoreData()) {
processNextChunk();
// Missing: check for loop termination condition
}
Patched Code (Conceptual):
int maxIterations = 10000;
int iteration = 0;
while (hasMoreData() && iteration < maxIterations) {
processNextChunk();
iteration++;
}
if (iteration >= maxIterations) {
// Log error and break out
}
Exploitation & Lab Setup
Red Team
No public exploit code is available. To simulate the attack in a lab environment:
- Setup: Deploy NGINX Unit version 1.34.1 or earlier with the Java module enabled and a simple Java application.
- Craft Request: Based on the undisclosed trigger, an attacker would need to reverse-engineer the vulnerability or wait for a PoC. For lab testing, you can attempt to send malformed HTTP requests (e.g., with unusual headers, chunked encoding, or specific URI patterns) to the Java application endpoint.
- Monitor: Use
toporhtopto observe CPU usage on the NGINX Unit worker processes. - Impact: A successful attack will cause one or more worker processes to consume 100% CPU, degrading service performance.
Blue Team
To detect and mitigate this vulnerability:
- Patch: Immediately upgrade to NGINX Unit version 1.34.2 or later.
- Monitor: Set up alerts for high CPU usage on NGINX Unit worker processes.
- Rate Limiting: Implement rate limiting on the data plane to reduce the impact of repeated malicious requests.
- WAF: Use a Web Application Firewall (WAF) to filter requests with unusual patterns (e.g., excessive chunked encoding, malformed headers).
- Logging: Enable detailed request logging for the Java module and monitor for repeated requests from the same source.
Indicators of Compromise (IOCs)
- Network: Repeated requests from a single IP address to a Java application endpoint on NGINX Unit.
- System: High CPU usage (near 100%) on NGINX Unit worker processes.
- Logs: No specific log entries are documented, but the worker process may log errors related to timeouts or resource exhaustion.
- File: No files are created or modified by the exploit.
Detection Engineering
YARA Rule
rule CVE_2025_1695_NGINX_Unit_Java_DoS {
meta:
description = "Detects NGINX Unit Java module infinite loop behavior"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-1695"
strings:
$cpu_spike = "CPU usage" ascii wide nocase
$unit_worker = "unit: main" ascii wide nocase
$java_thread = "java" ascii wide nocase
condition:
$cpu_spike and $unit_worker and $java_thread
}
Sigma Rule
title: CVE-2025-1695 NGINX Unit Java Module DoS
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects high CPU usage from NGINX Unit worker processes, indicating potential exploitation of CVE-2025-1695.
author: Valters IT
date: 2025-04-10
references:
- https://nvd.nist.gov/vuln/detail/CVE-2025-1695
logsource:
category: process_creation
product: linux
detection:
selection:
Image|endswith: '/unitd'
CommandLine|contains: 'unit: main'
condition: selection
falsepositives:
- Legitimate high load on the server
level: medium
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-1695 NGINX Unit Java Module DoS Attempt"; flow:to_server; content:"POST"; http_method; content:"/java"; http_uri; pcre:"/^[a-zA-Z0-9\/]{100,}$/"; classtype:attempted-dos; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate Patch: Upgrade NGINX Unit to version 1.34.2 or later. This is the only definitive fix.
- Workaround: If patching is not immediately possible, consider disabling the Java Language Module if it is not required.
- Network Controls: Use a WAF or reverse proxy to filter requests to Java endpoints. Implement rate limiting to reduce the impact of repeated attacks.
- Monitoring: Set up alerts for abnormal CPU usage on NGINX Unit worker processes.
- Incident Response: If exploitation is suspected, isolate the affected server, collect logs, and restart the NGINX Unit service.
Valters IT
DevSecOps & Cyber Threat Intelligence
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.