CVE-2025-40331
Linux Kernel vulnerability analysis and mitigation

Overview

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).

Technical details

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).

Impact

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).

Mitigation and workarounds

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).

Additional resources


SourceThis report was generated using AI

Related Linux Kernel vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-64557NONEN/A
  • Linux Kernel logoLinux Kernel
  • kernel-rt-selftests-internal
NoNoJul 29, 2026
CVE-2026-64556NONEN/A
  • Linux Kernel logoLinux Kernel
  • kernel-64k-devel
NoNoJul 29, 2026
CVE-2026-64555NONEN/A
  • Linux Kernel logoLinux Kernel
  • linux-azure-fde-6.14
NoNoJul 27, 2026
CVE-2026-64554NONEN/A
  • Linux Kernel logoLinux Kernel
  • linux-gcp-6.14
NoYesJul 27, 2026
CVE-2026-64553NONEN/A
  • Linux Kernel logoLinux Kernel
  • kernel-rt-64k-debug-modules-internal
NoYesJul 27, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management