Cloudanix VulnDB

CVE-2023-45676

High · 7.8

CVSS

7.8

EPSS

0.5%

Published

Oct 21, 2023

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

A flaw in a popular audio library can let attackers take over a computer simply by tricking it into opening a specially made music file.

Exploitation
Requires User Interaction
Attacker needs
User Interaction
Complexity
Low
Impact
Full Compromise
Component
Library
Class
Memory Corruption
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

Integer overflow in setup_malloc allows a negative value to bypass buffer size checks, resulting in an out-of-bounds write when storing vendor metadata from a crafted Ogg Vorbis file, enabling arbitrary code execution.

Why it matters to the business

Applications that decode untrusted Ogg Vorbis audio using the affected library can be fully compromised, allowing attackers to execute arbitrary code on user systems or servers that process media files.

How an attack unfolds

An attacker crafts a malicious Ogg Vorbis file containing a specially chosen large value for the vendor metadata size. When the vulnerable stb_vorbis library parses the file, the integer overflow in setup_malloc produces a negative size that passes the allocation check, leading to an out-of-bounds write during metadata storage that can be leveraged for code execution.

How to fix it

Replace the vulnerable stb_vorbis implementation with a patched version from the upstream repository that corrects the integer overflow in setup_malloc. If a fixed release is unavailable, apply vendor-supplied patches or switch to an alternative Vorbis decoder. As a temporary mitigation, avoid processing untrusted Ogg Vorbis files in affected applications.

How to confirm the fix worked

Review the stb_vorbis.c source to confirm setup_malloc performs proper bounds checking on sz before adding offsets and that negative allocation sizes are rejected. Recompile dependent applications and test with known-good crafted files that previously triggered the overflow.

Typical attack path

  1. Attacker creates a malicious Ogg Vorbis file with oversized vendor metadata field
  2. Victim application opens or processes the crafted file using the vulnerable library
  3. setup_malloc computes sz+7 resulting in integer overflow to a negative value
  4. Negative size bypasses maximum buffer check and triggers out-of-bounds write
  5. Attacker-controlled data overwrites memory structures to achieve code execution

How to detect it

Examine application crash logs or memory dumps for segmentation faults or access violations occurring inside stb_vorbis metadata parsing routines when processing Ogg Vorbis files. Correlate file-open events with subsequent unexpected process behavior or code injection indicators.

What your security team should do

  • Inventory all products and dependencies that statically or dynamically link stb_vorbis.c
  • Prioritize patching or replacing the library in any media-processing pipelines that accept external files
  • Implement file-type sandboxing or content-disarmament for audio decoding until remediation is complete
  • Monitor upstream stb repository for official fixed releases and apply them promptly

The record

stb_vorbis is a single file MIT licensed library for processing ogg vorbis files. A crafted file may trigger out of bounds write in `f->vendor[i] = get8_packet(f);`. The root cause is an integer overflow in `setup_malloc`. A sufficiently large value in the variable `sz` overflows with `sz+7` in and the negative value passes the maximum available memory buffer check. This issue may lead to code execution.

Affected packages

Ecosystem Package Introduced Fixed
Debian:11 libstb 0 No fix
Debian:12 libstb 0 No fix
Debian:13 libstb 0 No fix
SUSE:Package Hub 15 SP6 SDL2_sound 0 2.0.4-bp156.2.3.1
Ubuntu:20.04:LTS libstb 0 No fix
Ubuntu:22.04:LTS libstb 0 No fix
Ubuntu:24.04:LTS libstb 0 No fix
Ubuntu:24.10 libstb 0 No fix
Ubuntu:25.04 libstb 0 No fix
Ubuntu:25.10 libstb 0 No fix
Ubuntu:Pro:20.04:LTS libstb 0 No fix
openSUSE:Leap 15.6 SDL2_sound 0 2.0.4-bp156.2.3.1
openSUSE:Tumbleweed SDL2_sound 0 2.0.4-1.1
openSUSE:Tumbleweed SDL3_sound 0 3.2.0-1.1

Related vulnerabilities