CVE-2021-40426
High · 8.8CVSS
8.8
EPSS
2.2%
Published
Apr 14, 2022
CISA due date
—
Cloudanix analysis
A problem in audio software can let someone take control of a computer just by getting it to open a specially made sound file.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Remote Code Execution
- Component
- Library
- Class
- Buffer Overflow
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Heap-based buffer overflow in sphere.c start_read() allows out-of-bounds writes when parsing a malformed audio file, enabling arbitrary code execution or process crash.
Why it matters to the business
Systems that process untrusted audio files with libsox face risk of remote code execution or denial of service, potentially disrupting media workflows and requiring emergency patching.
How an attack unfolds
An attacker crafts a malicious sphere audio file that triggers the vulnerable start_read function during parsing; when the victim application opens the file, the overflow occurs and the attacker-supplied payload executes.
How to fix it
Upgrade libsox to a version containing the fix for the sphere.c start_read buffer handling; rebuild any dependent applications against the patched library; disable processing of untrusted sphere files until updated.
How to confirm the fix worked
Confirm the installed libsox version is newer than 14.4.2 and does not contain commit 42b3557e; run regression tests with known-good and known-bad sphere files; verify no crash or unexpected memory writes occur on malformed input.
Typical attack path
- Craft a specially-formed sphere-format audio file containing oversized data for the header fields
- Deliver the file to the target via email, web download, or shared storage
- Victim application invokes libsox to read the file and reaches start_read()
- Heap buffer overflow occurs, corrupting memory structures to achieve code execution or crash
How to detect it
Search application and system logs for crashes or segmentation faults during audio file processing; inspect file upload or processing pipelines for sphere-format files; review process memory dumps for heap corruption indicators around libsox parsing routines.
What your security team should do
- Immediately inventory all systems using libsox and schedule upgrades
- Block or sandbox processing of untrusted audio files until patched
- Add file-type filtering rules to prevent sphere-format files from reaching vulnerable parsers
- Monitor for new fixed releases and test in staging before production rollout
The record
A heap-based buffer overflow vulnerability exists in the sphere.c start_read() functionality of Sound Exchange libsox 14.4.2 and master commit 42b3557e. A specially-crafted file can lead to a heap buffer overflow. An attacker can provide a malicious file to trigger this vulnerability.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:10 | sox | 0 | 14.4.2+git20190427-1+deb10u1 |
| Debian:11 | sox | 0 | 14.4.2+git20190427-2+deb11u1 |
| Debian:12 | sox | 0 | 14.4.2+git20190427-3.1 |
| Debian:13 | sox | 0 | 14.4.2+git20190427-3.1 |
| Mageia:8 | sox | 0 | 14.4.3-0.git20200117.3.1.mga8 |
| SUSE:Package Hub 15 SP4 | sox | 0 | 14.4.2-bp154.2.3.1 |
| SUSE:Package Hub 15 SP5 | sox | 0 | 14.4.2-bp155.3.3.1 |
| Ubuntu:18.04:LTS | sox | 0 | 14.4.2-3ubuntu0.18.04.2 |
| Ubuntu:20.04:LTS | sox | 0 | 14.4.2+git20190427-2+deb11u1build0.20.04.1 |
| Ubuntu:22.04:LTS | sox | 0 | 14.4.2+git20190427-2+deb11u1build0.22.04.1 |
| Ubuntu:24.04:LTS | sox | 0 | No fix |
| Ubuntu:24.10 | sox | 0 | No fix |
| Ubuntu:Pro:14.04:LTS | sox | 0 | 14.4.1-3ubuntu1.1+esm2 |
| Ubuntu:Pro:16.04:LTS | sox | 0 | 14.4.1-5+deb8u4ubuntu0.1+esm1 |
| openSUSE:Leap 15.4 | sox | 0 | 14.4.2-bp154.2.3.1 |
| openSUSE:Leap 15.5 | sox | 0 | 14.4.2-bp155.3.3.1 |
| openSUSE:Tumbleweed | sox | 0 | 14.4.2-8.1 |
Related vulnerabilities
- CVE-2023-32627 A floating point exception vulnerability was found in sox, in the read_samples function… Also affects sox
- CVE-2021-33844 A floating point exception (divide-by-zero) issue was discovered in SoX in functon… Also affects sox
- CVE-2022-31651 In SoX 14.4.2, there is an assertion failure in rate_init in rate.c in libsox.a. Also affects sox
- CVE-2022-31650 In SoX 14.4.2, there is a floating-point exception in lsx_aiffstartwrite in aiff.c in… Also affects sox
- CVE-2023-26590 A floating point exception vulnerability was found in sox, in the lsx_aiffstartwrite… Also affects sox
- CVE-2019-8354 An issue was discovered in SoX 14.4.2. Also affects sox
- CVE-2004-0557 Multiple buffer overflows in the st_wavstartread function in wav.c for Sound eXchange… Also affects sox
- CVE-2026-112403 Pillow is a Python imaging library. CWE-122