Cloudanix VulnDB

CVE-2021-40426

High · 8.8

CVSS

8.8

EPSS

2.2%

Published

Apr 14, 2022

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

A problem in audio software can let someone take control of a computer just by getting it to open a specially made sound file.

Exploit Available
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

  1. Craft a specially-formed sphere-format audio file containing oversized data for the header fields
  2. Deliver the file to the target via email, web download, or shared storage
  3. Victim application invokes libsox to read the file and reaches start_read()
  4. 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