CVE-2026-40200: CWE-670 Always-Incorrect Control Flow Implementation in musl-libc musl
An issue was discovered in musl libc 0.7.10 through 1.2.6. Stack-based memory corruption can occur during qsort of very large arrays, due to incorrectly implemented double-word primitives. The number of elements must exceed about seven million, i.e., the 32nd Leonardo number on 32-bit platforms (or the 64th Leonardo number on 64-bit platforms, which is not practical).
AI Analysis
Technical Summary
This vulnerability affects musl libc versions 0.7.10 through 1.2.6 and is caused by an incorrect control flow implementation (CWE-670) in the qsort function. Specifically, the issue arises from the handling of double-word primitives during sorting, which can lead to stack-based memory corruption when sorting very large arrays. The triggering condition requires arrays larger than approximately seven million elements on 32-bit systems, making exploitation on 64-bit systems impractical due to the even larger required array size. The CVSS v3.1 score is 8.1, indicating high severity, with attack vector local, high attack complexity, no privileges required, no user interaction, and impacts on confidentiality, integrity, and availability.
Potential Impact
Successful exploitation can cause stack-based memory corruption, potentially leading to arbitrary code execution or denial of service. However, the exploitability is constrained by the requirement to sort extremely large arrays, which limits practical attack scenarios. The vulnerability impacts confidentiality, integrity, and availability as per the CVSS assessment.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. No official fix or temporary workaround is currently documented. Users should monitor musl-libc project communications for updates and consider avoiding sorting extremely large arrays with affected versions until a fix is available.
CVE-2026-40200: CWE-670 Always-Incorrect Control Flow Implementation in musl-libc musl
Description
An issue was discovered in musl libc 0.7.10 through 1.2.6. Stack-based memory corruption can occur during qsort of very large arrays, due to incorrectly implemented double-word primitives. The number of elements must exceed about seven million, i.e., the 32nd Leonardo number on 32-bit platforms (or the 64th Leonardo number on 64-bit platforms, which is not practical).
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
This vulnerability affects musl libc versions 0.7.10 through 1.2.6 and is caused by an incorrect control flow implementation (CWE-670) in the qsort function. Specifically, the issue arises from the handling of double-word primitives during sorting, which can lead to stack-based memory corruption when sorting very large arrays. The triggering condition requires arrays larger than approximately seven million elements on 32-bit systems, making exploitation on 64-bit systems impractical due to the even larger required array size. The CVSS v3.1 score is 8.1, indicating high severity, with attack vector local, high attack complexity, no privileges required, no user interaction, and impacts on confidentiality, integrity, and availability.
Potential Impact
Successful exploitation can cause stack-based memory corruption, potentially leading to arbitrary code execution or denial of service. However, the exploitability is constrained by the requirement to sort extremely large arrays, which limits practical attack scenarios. The vulnerability impacts confidentiality, integrity, and availability as per the CVSS assessment.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. No official fix or temporary workaround is currently documented. Users should monitor musl-libc project communications for updates and consider avoiding sorting extremely large arrays with affected versions until a fix is available.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- mitre
- Date Reserved
- 2026-04-10T00:00:00.000Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 69d934f31cc7ad14dad772cf
Added to database: 4/10/2026, 5:35:47 PM
Last enriched: 4/18/2026, 2:21:10 PM
Last updated: 5/26/2026, 7:56:50 AM
Views: 282
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.