Two C Audio-Parser Bugs: Integer Narrowing and a Missing Bounds Check

Përparim Mjeku
27 Sep 2026 — 5 min read

Share

LLM Fundamentals

A practical guide to how large language models read, learn, generate answers, use tools, and where their limits matter.

Cyber Academy

CVE-2026-89266 and CVE-2026-75904 affect two C audio parsers. The first involves an allocation-size conversion in stb_vorbis; the second involves a missing lower-bound check in libmodplug.

These cases show why dependency inventories must track the actual code revision and reachable parsing paths. A familiar library name, a successful build, or a system update does not establish that a vendored copy has been fixed.

CVE-2026-89266: A Truncated Integer Turns Audio Playback Into Heap Corruption

Library: stb_vorbis through 1.22
Recorded weakness: CWE-787 — Out-of-bounds Write
CVSS v3.1: 8.2 High; CVSS v4.0: 8.8 High
CVE publication: September 11, 2026 UTC
Fix status checked November 9, 2026: no verified 1.23 release established in the checked upstream records; Debian tracks this issue as unfixed.

The Mechanism

The codebook allocation expression includes sizeof, so the cited path computes a size_t byte count before passing it to setup_malloc, which takes an int. For the reported input on the tested build, narrowing produces an allocation smaller than the subsequent writes require. This is an implicit conversion at the function boundary, not a literal five-character cast. A value above INT_MAX does not invariably become a small positive allocation.

Source: https://github.com/nothings/stb/issues/1947

Impact

A crafted file can trigger heap corruption or a crash in an affected decoder. Whether that corruption is exploitable for code execution depends on the build and runtime environment; the cited report does not establish a working code-execution exploit.

Exposure depends on whether the application includes the vulnerable code and allows untrusted input to reach the relevant decoding path.

 

Why the Blast Radius Is Enormous

stb code may be vendored into an application or supplied through a distribution package such as Debian’s libstb. Update responsibilities depend on that integration choice. Updating a system package does not necessarily replace a copy embedded in an application.

 

Identify the actual source revision, check the matching advisory, and verify the deployed build. This article does not establish a count of affected applications.

 

CVE-2026-75904: A 32-Byte MIDI File Reads Memory It Shouldn't

Library: libmodplug through 0.8.9.1
Recorded weakness: CWE-125 — Out-of-bounds Read
CVSS v3.1: 3.3 Low; CVSS v4.0: 4.8 Medium
CVE publication: August 18, 2026
Fix status checked November 9, 2026: the upstream issue records a November fix; Debian identifies 1:0.8.9.0-4 as fixed in forky/sid. Status varies by distribution and release. A 0.8.9.2 release was not verified.

The Mechanism

In src/load_pat.cpp, pat_smplooped checks that the sample index is below MAXSMP before accessing pat_loops at index minus one. It does not first require the index to be positive. A zero value therefore produces a read immediately before the array. The original function returns 1 when its upper-bound condition is not satisfied.

Source: https://github.com/Konstanty/libmodplug/issues/103

When smpno is zero, the access becomes pat_loops[-1]: one byte before the array. And zero isn’t an edge case — it’s the default. The smpno field of a parsed MIDI event starts at zero and only gets overwritten when a program-change message assigns an instrument. Any note event that fires before that assignment carries a zero index straight into this function.

A MIDI file as small as 32 bytes is enough to walk the path: ModPlug_Load → CSoundFile::ReadMID → MID_ReadPatterns → pat_smplooped(0).

Impact

The report demonstrates a one-byte out-of-bounds read that can influence loop behavior. It does not establish a reliable channel for extracting arbitrary secrets or a working code-execution chain. Sanitizer or hardened builds may detect the invalid read and terminate the process, so absence of a crash or a trace should not be assumed.

Blast Radius

An application is affected only if it includes a vulnerable libmodplug build and exposes the relevant parsing path. Distribution packages, static linking, and vendored copies can have different patch status.

Check the advisory for the actual operating-system release and package build. Do not assume that every media player, preview feature, or indexing service uses the affected decoder, or that routine updates have fixed every release.

The Pattern Worth Noticing

These two bugs look unrelated on the surface. Different libraries, different severity, different exploitation potential. But the underlying pattern is the same: a C library parsing an untrusted binary format, with arithmetic that was never validated against the full range of its inputs.

In one case, a type narrowing from size_t to int turns a large allocation into a small one. In the other, a missing > 0 check lets a default zero walk past a bounds guard. Neither bug is complex. Both sat in widely-shipped code for years.

Media parsers run early in the processing pipeline, on attacker-supplied input, often with no sandboxing. The blast radius of a bug in one of these libraries isn’t determined by the library’s name recognition — it’s determined by how many applications silently linked against it and never looked at it again.

CVE Cybersecurity