CVE-2025-40331 sctp: Prevent TOCTOU out-of-bounds write
A time-of-check to time-of-use race condition in the Linux kernel SCTP subsystem allows out-of-bounds writes, potentially leading to code execution or privilege escalation.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2025-40331?
CVE-2025-40331 is a high-severity vulnerability in Linux, published on 9 Dec 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
In the Linux kernel, the following vulnerability has been resolved:
sctp: Prevent TOCTOU out-of-bounds write
For the following path not holding the sock lock,
sctp_diag_dump() -> sctp_for_each_endpoint() -> sctp_ep_dump()
make sure not to exceed bounds in case the address list has grown between buffer allocation (time-of-check) and write (time-of-use).
Which versions are affected by CVE-2025-40331?
How do I fix CVE-2025-40331?
Apply the vendor's patch.
Is CVE-2025-40331 being exploited?
There is no known exploitation of CVE-2025-40331 in the wild and no public exploit code.
Sources
Also known as BELL-CVE-2025-40331, DEBIAN-CVE-2025-40331, GHSA-c4fm-qmm5-xqx8, ROOT-OS-DEBIAN-12-CVE-2025-40331, ROOT-OS-DEBIAN-13-CVE-2025-40331, ROOT-OS-UBUNTU-2204-CVE-2025-40331 and 2 more.