8.5high
PJSIP: Heap buffer overflow in Opus codec decoding
- Severity
- 8.5high CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.23% (higher than 15% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
Description
PJSIP is a free and open source multimedia communication library written in C. In 2.16 and earlier, there is a buffer overflow when decoding Opus audio frames due to insufficient buffer size validation in the Opus codec decode path. The FEC decode buffers (dec_frame[].buf) were allocated based on a PCM-derived formula: (sample_rate/1000) * 60 * channel_cnt * 2. At 8 kHz mono this yields only 960 bytes, but codec_parse() can output encoded frames up to MAX_ENCODED_PACKET_SIZE (1280) bytes via opus_repacketizer_out_range(). The three pj_memcpy() calls in codec_decode() copied input->size bytes without bounds checking, causing a heap buffer overflow.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| pjsip pjproject | <= 2.16 | CVE List |
| pjsip pjsip | before 2.17 | NVD |
All scores
| GitHub_M | 8.5high CVSS:4.0 | CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N |
| NVD | 8.8high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.
What each source says
CVE List
PJSIP is a free and open source multimedia communication library written in C. In 2.16 and earlier, there is a buffer overflow when decoding Opus audio frames due to insufficient buffer size validation in the Opus codec decode path. The FEC decode buffers (dec_frame[].buf) were allocated based on a PCM-derived formula: (sample_rate/1000) * 60 * channel_cnt * 2. At 8 kHz mono this yields only 960 bytes, but codec_parse() can output encoded frames up to MAX_ENCODED_PACKET_SIZE (1280) bytes via opus_repacketizer_out_range(). The three pj_memcpy() calls in codec_decode() copied input->size bytes without bounds checking, causing a heap buffer overflow.
NVD (es)
PJSIP es una biblioteca de comunicación multimedia de código abierto y gratuita escrita en C. En 2.16 y versiones anteriores, existe un desbordamiento de búfer al decodificar tramas de audio Opus debido a una validación insuficiente del tamaño del búfer en la ruta de decodificación del códec Opus. Los búferes de decodificación FEC (dec_frame[].buf) se asignaron basándose en una fórmula derivada de PCM: (sample_rate/1000) * 60 * channel_cnt * 2. A 8 kHz mono, esto produce solo 960 bytes, pero codec_parse() puede generar tramas codificadas de hasta MAX_ENCODED_PACKET_SIZE (1280) bytes a través de opus_repacketizer_out_range(). Las tres llamadas a pj_memcpy() en codec_decode() copiaron input -> size bytes sin verificación de límites, causando un desbordamiento de búfer de pila.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-40614 changed 2026-04-22 | CVE Terms of Use |
| NVD | CVE-2026-40614 changed 2026-10-26 | Public domain |