# GHSA-7498-VJGW-9CR2: Zero-length HEVC parameter sets in an RTMP publisher's configuration cause an index-out-of-range panic that crashes MediaMTX

- Database: GitHub
- Severity: CVSS 8.7 (High)
- Published: 2026-10-08
- Modified: 2026-10-08

## Affected versions

- github.com/bluenviron/mediamtx (Go): from 0.23.0, fixed in 1.21.0

## Description

MediaMTX's RTMP server relies on the `gortmplib` library to parse the codec configuration sent by publishers. For H265 streams, the `HEVCDecoderConfigurationRecord` carried by an RTMP video configuration message contains arrays of VPS, SPS and PPS NAL units. The helper `h265FindNALU()` in `gortmplib`'s `reader.go` looked up each parameter set by checking that the array had the requested type and exactly one NAL unit (`entry.NumNalus == 1`), and then verified the NAL unit type by reading `entry.Nalus[0].NALUnit[0]`. It never checked that the declared NAL unit contained at least one byte.

A publisher can send an HEVC configuration in which the VPS, SPS and PPS arrays each declare a single NAL unit of length zero. Dereferencing `NALUnit[0]` on the empty slice raises a `runtime error: index out of range [0] with length 0`. The configuration can be sent after a valid track has been set up, since `gortmplib` handles later configuration messages in the `OnDataH265()` callback, so the panic occurs in the RTMP connection goroutine, which does not recover from it. A panic in any goroutine terminates the whole Go process, so a single unauthenticated RTMP publisher (on a default configuration, where publishing is open) could crash MediaMTX and interrupt every stream and protocol served by it. The same unchecked access was present in MediaMTX's own RTMP code before it was moved into `gortmplib`, and was present in `gortmplib` since its first release.

This was fixed in `gortmplib` PR #121, which replaces `h265FindNALU()` with a stricter `h265FindParams()` that returns an error for empty or multiple parameter sets, and makes the message parsing reject empty H264/H265 parameters, so the connection is closed with an error instead of panicking. The fix is included in MediaMTX v1.21.0, which updates `gortmplib` to v1.0.2.

Reported by the University of Sydney security research team.

## References

- https://github.com/bluenviron/mediamtx/security/advisories/GHSA-7498-vjgw-9cr2

Page: https://cve.now/GHSA-7498-VJGW-9CR2

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
