
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2025-40331 is a time-of-check to time-of-use (TOCTOU) out-of-bounds write vulnerability in the Linux kernel's SCTP (Stream Control Transmission Protocol) implementation. The flaw exists in the call path sctp_diag_dump() -> sctp_for_each_endpoint() -> sctp_ep_dump(), where the sock lock is not held, allowing the SCTP endpoint address list to grow between buffer allocation and the subsequent write operation. It affects Linux kernel versions from 4.7 onward (introduced at commit 8f840e47f190cbe61a96945c13e9551048d42cef) across multiple stable branches. The vulnerability was published on December 9, 2025, and carries a CVSS v3.1 base score of 7.0 (High) (Microsoft MSRC, ENISA EUVD).
The root cause is a classic TOCTOU race condition (CWE-367) in the SCTP diagnostics subsystem. When sctp_diag_dump() iterates over endpoints via sctp_for_each_endpoint() and calls sctp_ep_dump(), it does not hold the socket lock. This means the endpoint's address list can be concurrently modified by another thread between the time the buffer size is calculated (time-of-check) and the time data is written into that buffer (time-of-use). If the address list grows during this window, the write operation can exceed the allocated buffer bounds, resulting in an out-of-bounds write in kernel memory. Exploitation requires local access with low privileges and high attack complexity due to the race condition timing requirement (Microsoft MSRC, ENISA EUVD).
Successful exploitation can result in kernel memory corruption, potentially leading to arbitrary code execution in kernel context, privilege escalation, information disclosure, or system crash. The CVSS assessment rates confidentiality, integrity, and availability impacts all as High, meaning a successful exploit could fully compromise the affected system. The attack is confined to the local system (no network-based exploitation), but a compromised kernel context could enable lateral movement within a multi-tenant or containerized environment (Microsoft MSRC, ENISA EUVD).
Patches have been backported to multiple stable Linux kernel branches. Administrators should update to the following fixed versions or later: 5.4.302, 5.10.247, 5.15.197, 6.1.159, 6.6.117, 6.12.58, 6.17.8, or 6.18. Downstream distributions including Ubuntu (USN-8096-1/2/3/5), Debian (DLA-4436-1), Amazon Linux 2 (ALAS2KERNEL-5.15-2025-096, ALAS2KERNEL-5.10-2026-112), Oracle Linux, and SUSE have also released updated kernel packages. As a workaround where patching is not immediately possible, restricting local user access and disabling SCTP if not required (modprobe -r sctp) can reduce exposure (Microsoft MSRC, Ubuntu Advisory, Debian LTS).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."