CVE-2025-40331
sctp: Prevent TOCTOU out-of-bounds write
Mitigation
- Upgrade Linux to 95aef86ab231f047bb8085c70666059b58f53c09 or later.
Who should check
- Anyone running Linux >= 8f840e47f190cbe61a96945c13e9551048d42cef, < b106a68df0650b694b254427cd9250c04500edd3; >= 8f840e47f190cbe61a96945c13e9551048d42cef, < 3006959371007fc2eae4a078f823c680fa52de1a; >= 8f840e47f190cbe61a96945c13e9551048d42cef, < 72e3fea68eac8d088e44c3dd954e843478e9240e; >= 8f840e47f190cbe61a96945c13e9551048d42cef, < 584307275b2048991b2e8984962189b6cc0a9b85; >= 8f840e47f190cbe61a96945c13e9551048d42cef, < c9119f243d9c0da3c3b5f577a328de3e7ffd1b42; >= 8f840e47f190cbe61a96945c13e9551048d42cef, < 2fe08fcaacb7eb019fa9c81db39b2214de216677; >= 8f840e47f190cbe61a96945c13e9551048d42cef, < 89eac1e150dbd42963e13d23828cb8c4e0763196; >= 8f840e47f190cbe61a96945c13e9551048d42cef, < 95aef86ab231f047bb8085c70666059b58f53c09
- Anyone running Linux 4.7
Vulnerability facts
- Affected
- Linux >= 8f840e47f190cbe61a96945c13e9551048d42cef, < b106a68df0650b694b254427cd9250c04500edd3; >= 8f840e47f190cbe61a96945c13e9551048d42cef, < 3006959371007fc2eae4a078f823c680fa52de1a; >= 8f840e47f190cbe61a96945c13e9551048d42cef, < 72e3fea68eac8d088e44c3dd954e843478e9240e; >= 8f840e47f190cbe61a96945c13e9551048d42cef, < 584307275b2048991b2e8984962189b6cc0a9b85; >= 8f840e47f190cbe61a96945c13e9551048d42cef, < c9119f243d9c0da3c3b5f577a328de3e7ffd1b42; >= 8f840e47f190cbe61a96945c13e9551048d42cef, < 2fe08fcaacb7eb019fa9c81db39b2214de216677; >= 8f840e47f190cbe61a96945c13e9551048d42cef, < 89eac1e150dbd42963e13d23828cb8c4e0763196; >= 8f840e47f190cbe61a96945c13e9551048d42cef, < 95aef86ab231f047bb8085c70666059b58f53c09; Linux 4.7
- Fixed in
- Linux 3006959371007fc2eae4a078f823c680fa52de1a, Linux 72e3fea68eac8d088e44c3dd954e843478e9240e, Linux 584307275b2048991b2e8984962189b6cc0a9b85, Linux 2fe08fcaacb7eb019fa9c81db39b2214de216677, Linux 89eac1e150dbd42963e13d23828cb8c4e0763196, Linux 95aef86ab231f047bb8085c70666059b58f53c09
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Not remotely exploitable (local or adjacent access needed)
- CVSS
- 7.8 (v3.1, CNA)CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Local
- Attack complexity: Low
- Privileges required: Low
- User interaction: None
- Scope: Unchanged
- Confidentiality impact: High
- Integrity impact: High
- Availability impact: High
- EPSS
- 0.23% chance of exploitation in 30 days (percentile 9, 2026-11-26)
- Modified
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).
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| Linux | >= 8f840e47f190cbe61a96945c13e9551048d42cef, < b106a68df0650b694b254427cd9250c04500edd3; >= 8f840e47f190cbe61a96945c13e9551048d42cef, < 3006959371007fc2eae4a078f823c680fa52de1a; >= 8f840e47f190cbe61a96945c13e9551048d42cef, < 72e3fea68eac8d088e44c3dd954e843478e9240e; >= 8f840e47f190cbe61a96945c13e9551048d42cef, < 584307275b2048991b2e8984962189b6cc0a9b85; >= 8f840e47f190cbe61a96945c13e9551048d42cef, < c9119f243d9c0da3c3b5f577a328de3e7ffd1b42; >= 8f840e47f190cbe61a96945c13e9551048d42cef, < 2fe08fcaacb7eb019fa9c81db39b2214de216677; >= 8f840e47f190cbe61a96945c13e9551048d42cef, < 89eac1e150dbd42963e13d23828cb8c4e0763196; >= 8f840e47f190cbe61a96945c13e9551048d42cef, < 95aef86ab231f047bb8085c70666059b58f53c09 | — | cvelist |
| Linux | 4.7 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2025-40331. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2025-40331.md Affected: Linux >= 8f840e47f190cbe61a96945c13e9551048d42cef, < b106a68df0650b694b254427cd9250c04500edd3; >= 8f840e47f190cbe61a96945c13e9551048d42cef, < 3006959371007fc2eae4a078f823c680fa52de1a; >= 8f840e47f190cbe61a96945c13e9551048d42cef, < 72e3fea68eac8d088e44c3dd954e843478e9240e; >= 8f840e47f190cbe61a96945… Fixed in: Linux 3006959371007fc2eae4a078f823c680fa52de1a, Linux 72e3fea68eac8d088e44c3dd954e843478e9240e, Linux 584307275b2048991b2e8984962189b6cc0a9b85, Linux 2fe08fcaacb7eb019fa9c81db39b2214de216677, Linux 89eac1e150dbd42963e13d23828cb8c4e0763196, Linux 95aef86ab231f047bb8085c70666059b58f53c09 Steps: 1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Other
- https://git.kernel.org/stable/c/b106a68df0650b694b254427cd9250c04500edd3
- https://git.kernel.org/stable/c/3006959371007fc2eae4a078f823c680fa52de1a
- https://git.kernel.org/stable/c/72e3fea68eac8d088e44c3dd954e843478e9240e
- https://git.kernel.org/stable/c/584307275b2048991b2e8984962189b6cc0a9b85
- https://git.kernel.org/stable/c/c9119f243d9c0da3c3b5f577a328de3e7ffd1b42
- https://git.kernel.org/stable/c/2fe08fcaacb7eb019fa9c81db39b2214de216677
- https://git.kernel.org/stable/c/89eac1e150dbd42963e13d23828cb8c4e0763196
- https://git.kernel.org/stable/c/95aef86ab231f047bb8085c70666059b58f53c09
FAQ
Is CVE-2025-40331 being exploited?
There is no confirmed exploitation: CVE-2025-40331 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.23% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2025-40331?
High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).
Which versions are affected by CVE-2025-40331?
Linux >= 8f840e47f190cbe61a96945c13e9551048d42cef, < b106a68df0650b694b254427cd9250c04500edd3; >= 8f840e47f190cbe61a96945c13e9551048d42cef, < 3006959371007fc2eae4a078f823c680fa52de1a; >= 8f840e47f190cbe61a96945c13e9551048d42cef, < 72e3fea68eac8d088e44c3dd954e843478e9240e; >= 8f840e47f190cbe61a96945c13e9551048d42cef, < 584307275b2048991b2e8984962189b6cc0a9b85; >= 8f840e47f190cbe61a96945c13e9551048d42cef, < c9119f243d9c0da3c3b5f577a328de3e7ffd1b42; >= 8f840e47f190cbe61a96945c13e9551048d42cef, < 2fe08fcaacb7eb019fa9c81db39b2214de216677; >= 8f840e47f190cbe61a96945c13e9551048d42cef, < 89eac1e150dbd42963e13d23828cb8c4e0763196; >= 8f840e47f190cbe61a96945c13e9551048d42cef, < 95aef86ab231f047bb8085c70666059b58f53c09; Linux 4.7.
Is there a fix for CVE-2025-40331?
Yes. Fixed in Linux 3006959371007fc2eae4a078f823c680fa52de1a, Linux 72e3fea68eac8d088e44c3dd954e843478e9240e, Linux 584307275b2048991b2e8984962189b6cc0a9b85, Linux 2fe08fcaacb7eb019fa9c81db39b2214de216677, Linux 89eac1e150dbd42963e13d23828cb8c4e0763196, Linux 95aef86ab231f047bb8085c70666059b58f53c09. Upgrade Linux to 95aef86ab231f047bb8085c70666059b58f53c09 or later.
How do I check if I'm affected by CVE-2025-40331?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.