Cloudanix VulnDB

CVE-2026-40200

High · 8.1

CVSS

8.1

EPSS

0.2%

Published

Apr 10, 2026

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

Some systems using a lightweight C library can crash, and may possibly be compromised, if they are made to sort an unusually huge amount of data.

Exploitation
Local Privilege
Attacker needs
Local User
Complexity
High
Impact
Privilege Gain
Component
Library
Class
Memory Corruption
Remediation
Upgrade
Effort
Medium
Patch risk
Medium

What it actually does

This vulnerability is a stack-based memory corruption flaw in musl libc's qsort implementation affecting versions 0.7.10 through 1.2.6. When sorting extremely large arrays, musl's incorrectly implemented double-word primitives can corrupt stack memory. On 32-bit platforms, the practical trigger threshold is roughly more than seven million elements; on 64-bit platforms, the required array size is so large that exploitation is generally impractical. Successful exploitation could crash the affected process and, depending on compiler protections, architecture, memory layout, and how qsort is reached, may potentially allow arbitrary code execution in the context of the vulnerable process.

Why it matters to the business

Systems and applications built against affected musl libc versions may be exposed to process crashes or possible compromise if an attacker can cause them to sort very large attacker-influenced datasets. The most realistic operational risk is denial of service in musl-based Linux environments, especially embedded systems, containers, appliances, and 32-bit deployments. The vulnerability has a high CVSS score, but current exploitation likelihood appears low: EPSS is approximately 0.00166, the 30-day trend is flat, it is not in CISA KEV, it is not associated with ransomware campaigns, and no public exploit maturity is reported.

How an attack unfolds

An attacker first needs access to an execution path in an application or service that uses musl libc's qsort and allows attacker-controlled or attacker-influenced input to determine the number of elements being sorted. The attacker then supplies or causes creation of a very large array that crosses the vulnerable threshold, which is practical primarily on 32-bit platforms. During qsort processing, musl's faulty double-word primitive handling can corrupt stack memory. The likely immediate result is a process crash; in more favorable circumstances for the attacker, memory corruption could be shaped toward control-flow hijacking and code execution within the privileges of the affected process. Exploitation is constrained by the need for a very large sort operation, local/process-level triggering conditions, memory availability, and platform architecture, making opportunistic exploitation less likely than targeted abuse of exposed application logic that performs large untrusted sorts.

How to fix it

Upgrade musl libc to a vendor-provided fixed release once available, and rebuild or redeploy statically linked applications and container images that include affected musl versions. Because fixed versions were not provided in the input, track advisories from musl, Linux distributions, container base image maintainers, embedded firmware vendors, and appliance vendors for the specific patched package versions. Prioritize 32-bit musl-based systems and applications that sort large untrusted datasets. Where immediate patching is not possible, mitigate by limiting maximum sortable input sizes, rejecting untrusted inputs that can create multi-million-element arrays, applying memory and CPU resource limits, isolating affected workloads, enabling compiler/runtime hardening such as stack canaries, PIE, ASLR, RELRO, and non-executable stacks, and reducing process privileges. Static binaries must be inventoried and rebuilt; updating the system shared library alone will not remediate statically linked software.

How to confirm the fix worked

Confirm the deployed musl version is outside the affected range or matches the fixed version specified by the relevant vendor advisory. For dynamically linked binaries, validate the runtime libc package version in the operating system or container image. For statically linked binaries, rebuild from a patched toolchain/base image and verify the binary no longer embeds the vulnerable musl version. Review software bill of materials, container image manifests, package manager output, and firmware/vendor release notes for musl libc 0.7.10 through 1.2.6. Perform targeted functional testing of application paths that sort large datasets and confirm they either no longer crash or enforce safe input-size limits. Validate that resource controls and input limits prevent attacker-supplied data from reaching the vulnerable threshold.

Typical attack path

  1. Identify an application, service, command-line tool, embedded component, or container image built against affected musl libc versions 0.7.10 through 1.2.6.
  2. Determine whether the target invokes qsort on data whose size or contents can be influenced by an untrusted user, file, request, dataset, or local input.
  3. Craft input that causes the application to allocate and sort an extremely large array, exceeding the practical vulnerable threshold on 32-bit platforms.
  4. Trigger the vulnerable qsort code path and cause stack memory corruption during sorting.
  5. Observe process instability, crash, or abnormal termination; in advanced scenarios, attempt to shape the corruption into control-flow hijacking.
  6. Use any achieved code execution or service disruption to impact availability, access sensitive process data, or pivot within the process's privilege boundary.

How to detect it

There are no known public exploitation artifacts or unique network indicators for this issue. Retrospective detection should focus on evidence that affected musl-linked processes crashed or behaved abnormally while processing unusually large datasets. Review kernel logs, systemd journals, container runtime logs, application logs, crash reporters, EDR telemetry, and core dump repositories for SIGSEGV, SIGABRT, stack corruption, or segmentation fault events where the call stack includes qsort or musl libc sorting routines. Correlate crashes with requests, jobs, uploaded files, batch imports, local inputs, or command invocations that produced very large element counts. For containerized workloads, inspect restarted containers, OOM-adjacent events, and application-level retries around large sort operations. For forensic analysis, preserve core dumps and examine backtraces for qsort frames, stack corruption, unexpected return addresses, or overwritten stack data. Absence of these artifacts does not prove absence of exposure, because failed exploitation may appear only as a generic crash and successful exploitation may leave no musl-specific indicator.

What your security team should do

  • Inventory musl-based assets, container images, embedded devices, appliances, and statically linked binaries, with special focus on 32-bit platforms.
  • Identify applications that call qsort or perform large sorts on untrusted or externally supplied data, and prioritize those for remediation or compensating controls.
  • Track musl and downstream vendor advisories for the first fixed version and update package baselines, build images, and CI/CD dependencies accordingly.
  • Rebuild and redeploy statically linked applications after the patched musl version is available; do not assume host library updates fix static binaries.
  • Implement temporary input-size, request-size, file-size, record-count, memory, and CPU limits for application features that can trigger large sorting operations.
  • Monitor crash telemetry, kernel logs, core dumps, and application logs for abnormal crashes during large sorting operations, especially SIGSEGV or SIGABRT events associated with qsort call stacks.
  • Because EPSS is low, flat, not KEV-listed, and no exploit maturity is reported, handle through risk-based patch management, but accelerate remediation for internet-facing, multi-tenant, safety-critical, or embedded 32-bit deployments.

The record

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

Affected packages

Ecosystem Package Introduced Fixed

Related vulnerabilities