Skip to content
GHSA Qr8h P53p X564

GHSA Qr8h P53p X564

github.com • November 25, 2026

The WebRTC RTCP decoder in SRS trusts the 16-bit length field of each RTCP packet. A WebRTC peer can send one malformed RTCP packet that either:

crashes the server through a reachable assertion (remote DoS), or

overflows a fixed 1500-byte heap buffer with data the peer controls (heap-based out-of-bounds write).

Every SRS version with WebRTC since 4.0 is affected. Fixed in v8.0.73 , v7.0.214 and v6.0.194 .

SRS 4.0 up to and including 6.0.193, 7.0.0 to 7.0.213, and 8.0.0 to 8.0.72.

Only servers with WebRTC enabled ( rtc_server.enabled on ).

The attacker must be a WebRTC peer, meaning they can open a session as a player (WHEP) or a publisher (WHIP). SRS decodes RTCP only after ICE and DTLS complete, and the peer encrypts the packet with its own SRTP keys. Without on_play or on_publish callbacks, anyone can open such a session, so in a default setup the attack needs no authentication.

All RTCP packets in a datagram go through SrsRtcpCompound::decode() ( trunk/src/kernel/srs_kernel_rtc_rtcp.cpp ). It picks a decoder by packet type, and each decoder calls SrsRtcpCommon::decode_header() first:

The header check only makes sure the packet isn't longer than the datagram. It neis big enough for the fields the decoders read , or small enough for thedecoders' fixed buffers. That allows three failures.

1. Header length 0: assertion abort (BYE, SDES, APP, TWCC, any unknown type)

Types without their own decoder, such as BYE (203), fall through to SrsRtcpCommon::decode() . TWCC (RTPFB, FMT 15) uses the same formula:

With length = 0 , payload_len_ is -4 . SrsBuffer::read_bytes() asserts req() returns false for a negative size, so srs_assert aborts the process.

2. Feedback packet with length 1: assertion abort (NACK, PLI, SLI, RPSI, gen

The feedback decoders read a second SSRC, the media source, right after the heade

An 8-byte feedback packet with length = 1 passes decode_header() , because 4 bder SSRC. Nothing is left for the media SSRC, so read_4bytes() fails its require(4) assertion and the process aborts.

3. Large packet: heap buffer overflow (any type decoded by SrsRtcpCommon , and TWCC)

SrsRtcpCommon and SrsRtcpTWCC copy the payload into a fixed array:

payload_len_ comes straight from the wire length , and the only limit is the sreads UDP into a 65535-byte buffer. A BYE or TWCC packet with length = 400 (1604 bytes) copies 1596 bytes into payload_ , writing 96 attacker-controlled bytes past the end of a heap object. Larger packets write further, up to 64 KB. AddressSanitizer reports this as a heap-buffer-overflow WRITE in SrsBuffer::read_bytes .

Each payload below is one plaintext RTCP packet. The peer protects it with its SRs it on the established WebRTC session:

The fix adds regression tests for these cases and their variants (TWCC, NACK, genernelRTCPTest.SrsRtcpCompound_Decode*`. All of them abort or report an ASANheap-buffer-overflow on unpatched code.

Availability: one packet stops the whole SRS process, which ends every live stream on the server, including RTMP, HLS, HTTP-FLV and SRT. The attacker can repeat it after every restart.

Memory corruption: the heap overflow writes up to 64 KB of attacker-chosen bytes past a heap object. No working code-execution exploit has been shown, but the write is controlled in both content and length, so treat it as potentially exploitable.

The fix makes the decoder check the length before reading:

decode_header() rejects length < 1 , so the sender SSRC is always inside the

The feedback decoders (NACK, PLI, SLI, RPSI, generic FB) reject length < 2 before reading the media SSRC.

SrsRtcpCommon and SrsRtcpTWCC reject a payload larger than `kRtcpPacketSize

Each check returns an error that drops the packet, so the server keeps running.

SRS 6.0.194 also carries the receiver-report bounds fix that SRS 7 and 8 already a 12-byte SR still aborts a 6.0 server.

If you can't upgrade:

If you don't use WebRTC, disable it: rtc_server { enabled off ; }

If you don't use WebRTC, disable it:

If you need WebRTC, limit who can open a session with on_play and `on_publishly reduces exposure to trusted peers; it does not fix the bug.

If you need WebRTC, limit who can open a session with on_play and `on_publishly reduces exposure to trusted peers; it does not fix the bug.

Extracted Entities