CVE-2026-45536: Netty Unix Domain Socket File Descriptor Leak in DomainSocketChannel
Netty, a widely-used Java network framework, has a file descriptor leak in its Unix domain socket implementation when handling multi-fd messages. When a peer sends a crafted control message carrying multiple file descriptors via SCM_RIGHTS, Netty's receiver allocates a fixed buffer that happens to fit the kernel's response exactly. The code then performs a validation check that fails due to the unexpected message format, causing the installed file descriptors to never be closed. Applications using DomainSocketChannel with FILE_DESCRIPTORS read mode—a non-default opt-in feature—can leak two file descriptors per malicious message received from a peer on the same host. This degrades availability by exhausting the process's file descriptor limit.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 4.0 MEDIUM · CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
- Weaknesses (CWE)
- CWE-200, CWE-772
- Affected products
- 1 configuration(s)
- Published / Modified
- 2026-06-12 / 2026-06-17
NVD description (verbatim)
Netty is a network application framework for development of protocol servers and clients. Prior to versions 4.1.135.Final and 4.2.15.Final, netty_unix_socket_recvFd sets msg_control to `char control[CMSG_SPACE(sizeof(int))]` (line 940) — 24 bytes on 64-bit Linux. A peer-sent SCM_RIGHTS cmsg carrying two ints has cmsg_len = CMSG_LEN(8) = 24, which fits exactly with no MSG_CTRUNC, so the kernel installs both fds in the receiving process. The subsequent check `cmsg->cmsg_len == CMSG_LEN(sizeof(int))` (line 972, expected 20) fails, the branch that would read the fd is skipped, and neither installed fd is closed. The for(;;) loop calls recvmsg again (non-blocking → EAGAIN → Java maps to 0 → read loop exits normally), leaving two leaked fds per message. There is no MSG_CTRUNC handling. Reachable via Epoll/KQueue DomainSocketChannel when the application opts into DomainSocketReadMode.FILE_DESCRIPTORS (non-default). Versions 4.1.135.Final and 4.2.15.Final patch the issue.
3 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
The vulnerability exists in netty_unix_socket_recvFd, which allocates a 24-byte control buffer (char control[CMSG_SPACE(sizeof(int))]) to receive ancillary data from recvmsg. A peer-sent SCM_RIGHTS cmsg containing two integers has a cmsg_len of 24 bytes, fitting exactly without truncation. The code validates received cmsg_len against CMSG_LEN(sizeof(int)) (20 bytes), expecting a single fd; when this check fails for a two-fd message, the branch that would read and close the file descriptors is skipped. The non-blocking recvmsg returns EAGAIN, the Java read loop exits, and both installed file descriptors remain open but orphaned. There is no MSG_CTRUNC detection to handle intentionally overflowed messages. Affected versions prior to 4.1.135.Final and 4.2.15.Final are vulnerable.
Business impact
For applications using Netty's DomainSocketChannel with FILE_DESCRIPTORS mode enabled, a local attacker (peer on the same host) can repeatedly send crafted messages to exhaust the application process's file descriptor limit. Once FD exhaustion occurs, the application cannot accept new connections, open files, or perform network operations, resulting in denial of service. The attack requires local access and knowledge that the target uses this non-default feature, but the exploit is trivial to execute. In containerized or shared-tenant environments, this risk is elevated.
Affected systems
Netty versions prior to 4.1.135.Final (4.1.x branch) and prior to 4.2.15.Final (4.2.x branch) are affected. Only applications that explicitly opt into DomainSocketReadMode.FILE_DESCRIPTORS when configuring DomainSocketChannel are vulnerable; this is not the default behavior. Affected deployments are typically those running on Linux with Epoll or macOS with KQueue event loops and passing multi-fd Unix socket messages between processes.
Exploitability
Exploitability is straightforward for a local attacker with the ability to establish a Unix domain socket connection to the vulnerable process. No privilege escalation or network capability is required. The attack is not in CISA's Known Exploited Vulnerabilities catalog and has not been widely published, but the mechanics are elementary: send a two-fd SCM_RIGHTS message repeatedly. Exploitation is limited to local peers, reducing widespread risk, but is reliable and requires minimal effort once the target application is identified.
Remediation
Upgrade affected Netty deployments to version 4.1.135.Final or later for the 4.1.x series, or 4.2.15.Final or later for the 4.2.x series. These versions correct the control buffer size and add proper MSG_CTRUNC handling to detect oversized messages. Patched releases ensure that either the correct number of file descriptors are read and managed, or that truncation is detected and the message is rejected. No workarounds short of upgrading are available for applications requiring FILE_DESCRIPTORS mode.
Patch guidance
Verify the exact version deployed in your build or dependency manifest (e.g., Maven pom.xml, Gradle build.gradle, or equivalent). Consult the Netty project's official release notes to confirm that versions 4.1.135.Final, 4.2.15.Final, or later appear in your dependency tree. If using a transitive dependency, ensure the resolved version meets the patched threshold; force resolution if necessary. Test in a staging environment to confirm the patch does not introduce regressions, then schedule a rolling deployment to minimize downtime.
Detection guidance
Monitor application logs and system metrics for signs of file descriptor exhaustion: check /proc/[pid]/fd count, observe warnings about 'too many open files' or 'permission denied' errors on socket or file operations, and correlate with local network traffic or connections. If FILE_DESCRIPTORS mode is in use, enable debug logging on Netty's epoll or KQueue channel implementations to capture cmsg validation failures. Network-level detection is difficult because the attack occurs entirely over Unix domain sockets, but endpoint monitoring of syscall patterns (repeated recvmsg on AF_UNIX followed by fd exhaustion) can provide signals.
Why prioritize this
This vulnerability should be prioritized for patching in the following order: (1) immediately, if your Netty deployment uses DomainSocketReadMode.FILE_DESCRIPTORS and receives untrusted Unix socket connections from other local processes, (2) within a standard patching cycle (e.g., next maintenance window), if FILE_DESCRIPTORS mode is enabled but connections are restricted to trusted local processes, and (3) at normal schedule if FILE_DESCRIPTORS mode is not in use. The CVSS score of 4.0 reflects the local-only attack vector and requirement for a non-default configuration, but in permissive local environments, availability impact can be severe.
Risk score, explained
The CVSS 3.1 score of 4.0 (MEDIUM) is derived from: Attack Vector Local (AV:L)—requires local presence, Complexity Low (AC:L)—straightforward to execute, Privileges None (PR:N)—no authentication required, User Interaction None (UI:N)—immediate upon receipt, Scope Unchanged (S:U)—impact is limited to the affected process, and Availability impact Low (A:L)—resource exhaustion occurs incrementally. Confidentiality and Integrity are not affected. The score reflects low likelihood in general deployments but does not account for elevated risk in environments where local privilege boundaries are weak or where process restarts are costly.
Frequently asked questions
Do I need to patch if I am not using DomainSocketReadMode.FILE_DESCRIPTORS?
No. The vulnerability is only reachable if your application explicitly calls setReadMode(DomainSocketReadMode.FILE_DESCRIPTORS) on DomainSocketChannel. This is a non-default opt-in feature. If you do not use this mode, you are not affected.
Can an attacker on the network exploit this vulnerability?
No. The attack is limited to local peers that can establish a connection to the Unix domain socket endpoint. Network-based attackers cannot exploit this issue. Only processes running on the same host with access to the socket path are able to trigger the leak.
What happens after file descriptors are exhausted?
Once the process exhausts its file descriptor limit, it can no longer open new files, accept network connections, or establish new sockets. The application typically fails with 'too many open files' errors and enters a degraded state. For long-running services, a restart may be required to recover.
Are there any signs in logs that this vulnerability has been exploited?
You may observe repeated 'too many open files' errors or warnings about FD exhaustion in application or system logs. Monitoring /proc/[pid]/fd or using lsof can reveal an unusually high open FD count over time. However, legitimate high-FD usage can also trigger these patterns, so correlation with network events or socket traffic is important.
This analysis is derived from official CVE and vendor information available as of the publication date. CVSS scores and affected product versions reflect data published by the National Vulnerability Database and Netty project. Organizations should verify patch availability and compatibility with their specific Netty version and Java environment before deployment. No proof-of-concept or weaponized code is provided. For the most current patch status and detailed remediation instructions, refer to the official Netty project repository and security advisories. Source: NVD (public-domain), retrieved 2026-07-20. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2026-48043MEDIUMNetty HTTP/2 Decompression Memory Leak DoS Vulnerability
- CVE-2026-50009MEDIUMNetty QUIC Stateless Reset Token Disclosure (CVSS 4.8)
- CVE-2026-48006HIGHNetty Redis Memory Leak – Direct Memory Exhaustion DoS
- CVE-2026-10254MEDIUMUnauthenticated Information Disclosure in SourceCodester Pet Grooming Software
- CVE-2026-10854MEDIUMMISP Galaxy Visibility Control Bypass – Unauthorized Private Metadata Access
- CVE-2026-10864MEDIUMMISP Dashboard Widget Field Filtering Bypass (Medium)
- CVE-2026-11162MEDIUMChrome CSS Cross-Origin Data Leak Vulnerability
- CVE-2026-11168MEDIUMChrome Extension Memory Disclosure Vulnerability