Skip to main content
Menu
Advisories

Unauthenticated denial of service via unbounded track count in MoQ catalog PUBLISH

GHSA-P8H6-6W9Q-Q7F3Published Updated GitHub

Description

When a client publishes a .catalog track over the MoQ (Media over QUIC) server, mediamtx parses the incoming JSON catalog and then, in onPublishCatalog (internal/servers/moq/session.go), immediately converts every listed track into internal structures via moq.ToStream and allocates one entry per track in the inboundTracks map. This conversion happens before pathManager.AddPublisher is called, which is the point where credentials and path permissions are actually checked.

Because the only limit enforced on the incoming catalog is the overall payload size (10 MB), and a single track entry only needs a few dozen bytes, an unauthenticated client can include on the order of 100,000 tracks in one catalog message while staying under that cap. Each such message forces the server to perform tens of megabytes of heap allocation and tens of milliseconds of CPU work per connection, all before any authentication or authorization decision is made. A modest number of concurrent connections doing this is enough to produce significant memory pressure and CPU load on the server, i.e. a pre-authentication denial-of-service condition. This affects any deployment with the MoQ server enabled, which is the case in the project's default configuration.

The fix caps the number of tracks a catalog may contain to 50, rejecting oversized catalogs right after JSON unmarshaling and before any per-track allocation or authorization check is performed (PR #6087).

Affected versions

References

GitHub · bluenviron/mediamtx