CVE-2026-40614
Received Received - Intake
Buffer Overflow in PJSIP Opus Codec Causes Heap Corruption

Publication date: 2026-04-21

Last updated on: 2026-04-23

Assigner: GitHub, Inc.

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.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-04-21
Last Modified
2026-04-23
Generated
2026-05-07
AI Q&A
2026-04-21
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
pjsip pjsip to 2.17 (exc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-122 A heap overflow condition is a buffer overflow, where the buffer that can be overwritten is allocated in the heap portion of memory, generally meaning that the buffer was allocated using a routine such as malloc().
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

CVE-2026-40614 is a heap buffer overflow vulnerability in the Opus codec decoding process within pjproject versions 2.16 and earlier. The issue occurs because the buffers used to decode Opus audio frames were allocated based on an incorrect size calculation derived from PCM audio parameters, which is too small for some encoded Opus frames.

Specifically, the decode buffers were sized using a formula that yields only 960 bytes at 8 kHz mono audio, but the codec can output encoded frames up to 1280 bytes. During decoding, three memory copy operations copy data without checking if the input size fits into the allocated buffer, leading to a heap buffer overflow when larger frames are processed.

This flaw can be triggered by receiving specially crafted audio packets, potentially causing memory corruption or application crashes.


How can this vulnerability impact me? :

This vulnerability can impact applications using the Opus codec for audio reception by causing unexpected application termination or memory corruption.

An attacker could exploit this flaw by sending specially crafted Opus audio packets that trigger the heap buffer overflow, potentially leading to crashes or other unpredictable behavior in the affected software.

Such instability could disrupt communication services relying on pjproject, affecting availability and reliability.


How can this vulnerability be detected on my network or system? Can you suggest some commands?

This vulnerability arises from a heap buffer overflow in the Opus codec decoding process when receiving specially crafted Opus audio frames. Detection involves monitoring for abnormal application behavior such as unexpected termination or memory corruption in applications using the pjproject library with Opus codec version 2.16 or earlier.

Since the vulnerability is triggered by malformed Opus audio packets, network detection could involve capturing and analyzing RTP streams carrying Opus audio frames to identify unusually large or malformed packets exceeding typical size limits (greater than 960 bytes but up to 1280 bytes).

Specific commands are not provided in the resources, but general approaches include:

  • Using packet capture tools like tcpdump or Wireshark to capture RTP streams and filter for Opus codec payloads.
  • Analyzing RTP payload sizes to detect frames larger than expected thresholds (e.g., >960 bytes).
  • Monitoring application logs for crashes or memory errors related to Opus decoding.

What immediate steps should I take to mitigate this vulnerability?

The primary mitigation is to upgrade pjproject to version 2.17 or later, where the vulnerability has been fixed by increasing buffer sizes and adding input size validation.

If upgrading immediately is not possible, a workaround is to disable the Opus codec in your application to prevent processing of potentially malicious Opus audio frames.


How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:

The provided information does not specify any direct impact of this vulnerability on compliance with common standards and regulations such as GDPR or HIPAA.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart