CVE-2023-45677
High · 7.8CVSS
7.8
EPSS
0.5%
Published
Oct 21, 2023
CISA due date
—
Cloudanix analysis
A bug in a common tool for reading music files can let attackers take control of a computer simply by getting it to open a specially made audio 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
Out-of-bounds write triggered by negative length value or integer overflow during vendor string allocation and null-termination in start_decoder when parsing a crafted OGG Vorbis file, enabling potential arbitrary code execution.
Why it matters to the business
Applications that process untrusted audio files using this library face risk of remote compromise on end-user systems, potentially leading to malware deployment or data theft with high urgency for any widely distributed media-handling software.
How an attack unfolds
An attacker creates a malicious OGG Vorbis file containing a negative or INT_MAX length value for the vendor string. When a vulnerable application invokes stb_vorbis to decode the file, setup_malloc succeeds but the subsequent write uses a negative index or overflows, corrupting memory to achieve code execution.
How to fix it
Replace the vulnerable stb_vorbis implementation with a patched version that correctly validates length values before allocation and indexing in start_decoder; apply input sanitization and bounds checks around vendor and comment list handling.
How to confirm the fix worked
Re-test parsing of previously triggering crafted OGG files after the update and confirm that negative-length and INT_MAX cases are rejected or safely handled without memory corruption; use memory-safety tools during regression testing.
Typical attack path
- Craft malicious OGG Vorbis file with manipulated length fields
- Deliver file to target via download, attachment or media stream
- Victim application opens and parses the file using stb_vorbis
- Decoder setup performs out-of-bounds write
- Attacker payload executes in process context
How to detect it
Inspect application and system logs for crashes, segmentation faults or memory errors occurring during OGG Vorbis decoding; correlate file open events with subsequent abnormal process behavior or unexpected code execution indicators.
What your security team should do
- Immediately audit all products and dependencies for inclusion of the vulnerable stb_vorbis code and schedule replacement
- Enforce sandboxing or isolated processes for any audio file decoding
- Add runtime length validation wrappers if immediate library update is not feasible
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[len] = (char)'\0';`. The root cause is that if `len` read in `start_decoder` is a negative number and `setup_malloc` successfully allocates memory in that case, but memory write is done with a negative index `len`. Similarly if len is INT_MAX the integer overflow len+1 happens in `f->vendor = (char*)setup_malloc(f, sizeof(char) * (len+1));` and `f->comment_list[i] = (char*)setup_malloc(f, sizeof(char) * (len+1));`. 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
- CVE-2023-47212 A heap-based buffer overflow vulnerability exists in the comment functionality of stb… Also affects libstb
- CVE-2023-43281 Double Free vulnerability in Nothings Stb Image.h v.2.28 allows a remote attacker to… Also affects libstb
- CVE-2023-45664 stb_image is a single file MIT licensed library for processing images. Also affects libstb
- CVE-2023-45676 stb_vorbis is a single file MIT licensed library for processing ogg vorbis files. Also affects libstb
- CVE-2023-45682 stb_vorbis is a single file MIT licensed library for processing ogg vorbis files. Also affects libstb
- CVE-2023-45679 stb_vorbis is a single file MIT licensed library for processing ogg vorbis files. Also affects libstb
- CVE-2023-45675 stb_vorbis is a single file MIT licensed library for processing ogg vorbis files. Also affects libstb
- CVE-2023-45666 stb_image is a single file MIT licensed library for processing images. Also affects libstb