Speex libspeex: Out-of-bounds write in speex_bits_read_whole_bytes()
Summary
Speex (libspeex) through 1.2.1 contains an out-of-bounds write in speex_bits_read_whole_bytes() that mishandles length truncation for buffers not owned by the library. An attacker who can stream crafted Speex data into an application using speex_bits_init_buffer() or speex_bits_set_bit_buffer() can corrupt heap or stack memory. The most reliable effect is a crash of the affected application; code execution is speculated but not confirmed.
Affected
- Speex (libspeex) up to and including 1.2.1
- Applications that embed libspeex and pass untrusted data through speex_bits_init_buffer() or speex_bits_set_bit_buffer()
- Distribution packages: status unclear, Red Hat lists fix deferred for RHEL 10, Ubuntu lists needs evaluation
Fixed in
Unknown.
- A candidate fix exists as GitLab merge request 32, but its merge and release status could not be confirmed.
- No confirmed fixed release or vendor advisory was found.
Workaround
- Restrict which applications process untrusted Speex streams or files.
- Validate the length of incoming Speex data and check buffer bounds before passing it to the library, if you control the application code.
- Keep the affected code out of internet-facing services where possible.
Exploitation
- Not known to be exploited in the wild; not listed in CISA KEV.
- A third-party write-up exists; its content was not reviewed and public proof of concept is not confirmed.
Our recommendation
- Inventory systems and applications that bundle libspeex or the speex package and record their versions.
- Ask software vendors whether their products use the affected buffer APIs with untrusted input.
- Apply vendor patches as soon as they are available and track the Xiph GitLab merge request and your distribution security trackers.
- Restrict exposure of affected applications until a fix is confirmed.
- Monitor for crashes of applications that process Speex audio.
Public exploits
PoC-in-GitHub, Metasploit and Exploit-DB list nothing for this CVE.
Research sources
- Xiph Speex GitHub mirror github.com
- bits.c at Speex-1.2.1 github.com
- Speex issue #42 github.com
- Xiph GitLab merge request 32 gitlab.xiph.org
- VulnCheck advisory www.vulncheck.com
- HackMD write-up hackmd.io
- Ubuntu security notice ubuntu.com
- OpenCVE entry app.opencve.io
Researched and written up in English and German by an AI (Claude by Anthropic) based on NVD, CISA, EPSS and the sources listed. The vendor information is authoritative. Researched on 1 Nov 2026, 13:13.
Original description (NVD)
Speex (libspeex) through 1.2.1 contains an out-of-bounds write vulnerability in speex_bits_read_whole_bytes() in libspeex/bits.c that mishandles length truncation for non-owned SpeexBits buffers. Attackers can stream crafted Speex data into buffers set up with speex_bits_init_buffer() or speex_bits_set_bit_buffer() to corrupt heap or stack memory and crash applications.
NVD references (6)
- https://github.com/xiph/speex
- https://github.com/xiph/speex/blob/Speex-1.2.1/libspeex/bits.c#L177
- https://github.com/xiph/speex/issues/42
- https://gitlab.xiph.org/xiph/speex/-/merge_requests/32
- https://hackmd.io/@haindpwn/speex-bits-read-whole-bytes-oob-write
- https://www.vulncheck.com/advisories/speex-through-1.2.1-out-of-bounds-write-via-speex-bits-read-whole-bytes
Sources
The tracker combines official, freely usable data sources – updated continuously:
- NVD (NIST) – CVEs, rating (CVSS), affected products
- CISA KEV – vulnerabilities confirmed by CISA as actively exploited
- CISA Vulnrichment – CISA assessment (SSVC) in the official CVE record
- FIRST EPSS – probability of exploitation
- Microsoft MSRC – Patch Tuesday: vulnerabilities, severity, updates
- PoC-in-GitHub – public proof-of-concept repositories
- Metasploit (Rapid7) – modules of the Metasploit Framework
- Exploit-DB (OffSec) – archive of public exploits (links only)
- Patch days: official vendor pages (linked per vendor) (Vendor patch days)
This product uses data from the NVD API but is not endorsed or certified by the NVD. EPSS data © FIRST.org.
Affected? We can help.
We check whether your systems are affected, install updates and close the gap – continuously with the System Health Checker if you wish.
