# GHSA-9589-5P58-QPH8: CORS wildcard echoes request Origin while allowing credentials, enabling cross-origin credential theft

- Database: GitHub
- Severity: CVSS 6.8 (Medium)
- Published: 2026-09-12
- Modified: 2026-09-12

## Affected versions

- github.com/bluenviron/mediamtx (Go): from 1.18.0, fixed in 1.19.3

## Description

The HTTP origin-handling middleware shared by MediaMTX's HLS, WebRTC, API, playback, metrics and pprof servers is responsible for adding CORS headers when a request carries an `Origin` header. When the configured allow-list contains the wildcard `*`, the handler was supposed to signal that any origin is permitted by returning the literal string `*` in `Access-Control-Allow-Origin`. Instead, it returned whatever value the client sent in its own `Origin` request header, and the same code path unconditionally also set `Access-Control-Allow-Credentials: true`.

Browsers refuse to expose a credentialed cross-origin response when `Access-Control-Allow-Origin` is the literal wildcard, but they accept it when a specific origin is named, even if that origin was just echoed back verbatim from the request. Combining an echoed, attacker-controlled origin with `Access-Control-Allow-Credentials: true` therefore produces a response that looks fully spec-compliant to the browser while approving every possible origin. Any third-party web page can issue a credentialed cross-origin request to a MediaMTX instance configured with a wildcard allow-list and have the browser attach cached credentials, letting the attacker's script read the response body directly, including stream data, recordings, and, on the API server, configuration and administrative responses.

This was fixed in PR #5975, which makes the wildcard branch return the literal `*` instead of the request's Origin header and stops setting `Access-Control-Allow-Credentials` altogether, so browsers correctly withhold credentials from wildcard-permitted requests.

## References

- https://github.com/bluenviron/mediamtx/security/advisories/GHSA-9589-5p58-qph8

Page: https://cve.now/GHSA-9589-5P58-QPH8

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