Junglewise Threat Intelligence

CVE-2025-40331: Linux Kernel out-of-bounds write in SCTP diag component

CVE-2025-40331 · Severity: high · CVSS 7.8 · Published 2025-12-09

Technologies: Linux Kernel. Vendors: Linux.

Executive brief

A vulnerability was identified in the Linux kernel's networking component responsible for the SCTP protocol. A local attacker could potentially cause a system crash or gain unauthorized access to memory by exploiting a timing issue when the system reports network diagnostic information. This occurs because the system does not properly lock data while measuring and then writing address information, leading to a memory corruption scenario.

Technical details

A TOCTOU (Time-of-Check to Time-of-Use) vulnerability exists in net/sctp/diag.c within the Linux kernel. The functions sctp_diag_dump(), sctp_for_each_endpoint(), and sctp_ep_dump() do not hold the socket lock during execution. This allows the address list to grow between the initial buffer allocation (check) and the subsequent write operation (use), resulting in an out-of-bounds write. A local user with sufficient privileges to invoke SCTP diagnostics can exploit this to corrupt kernel memory. The issue has been resolved by adding a check to ensure the address count does not exceed the allocated buffer size during the fill operation.

Affected products

  • Linux Linux Kernel 4.7 to 5.4.302, 5.10.247, 5.15.197, 6.1.159, 6.6.76, 6.12.4, 6.13-rc1

Timeline

  • 2025-12-09: disclosed
  • 2025-12-09: advisory

References

Related threats