GHSA-RRJX-WRHF-8V47
SSRF / local file read in remote playlist AutoDJ fetch (file_get_contents) allows a station Media user to read host files and internal HTTP responses via the queue API
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-RRJX-WRHF-8V47 divulgada | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
A station user with Media permission can set a remote playlist URL to `file:///etc/passwd` (or `http://127.0.0.1/...`). When AutoDJ builds the queue, the backend fetches that URL with raw `file_get_contents()` with no scheme allowlist and no private/loopback/metadata IP policy. Playlist lines are stored in `StationQueue.autodj_custom_uri` and returned by `GET /api/station/{station_id}/queue` to anyone with Broadcasting (often the same station-manager role). That turns an intentional "fetch remote M3U over HTTP" feature into host file disclosure and non-blind internal SSRF.
Affected
- Product: AzuraCast
- Tested: commit `3f9d6ff626745d9aa20a7158eec7a8583ed635e0` (rolling), Docker
- Component: AutoDJ remote playlist fetch (`backend/src/Radio/AutoDJ/QueueBuilder.php` → `getMediaFromRemoteUrl()`)
- Gate: Playlist `source=remote_url` and `remote_type=playlist` (`StationPlaylist::isPlayable`)
- Runtime: Stock PHP `allow_url_fopen=1`; Docker PHP config does not disable it
Prerequisites
- Authenticated station account with Media (set playlist) and Broadcasting (read queue). Frequently the same role.
- Ability to create/update a playlist with `source=remote_url`, `remote_type=playlist`, `is_enabled=true`.
- AutoDJ must select that playlist and build a queue entry (normal station operation).
Impact
- Local file read: `remote_url=file:///etc/passwd` (or `/etc/hostname`, app `.env`, other files readable by the web container UID). Readable lines appear as queue URIs after M3U/PLS parsing.
- Internal SSRF: `http://127.0.0.1/...`, RFC1918, link-local / cloud metadata style targets. Response body lines that look like playlist entries leak via the queue API.
- Who is hurt: Operators of multi-user / multi-station AzuraCast where a station Media manager is not a host admin. Single-admin self-host installs still expose the host FS and loopback through a feature that was never meant to accept `file://`.
- Not by design: Remote M3U over http/https for AutoDJ is intentional. Passing the URL straight into `file_get_contents` with PHP wrappers and no IP policy is the defect.
Attack path
- Attacker holds station Media + Broadcasting.
- Attacker creates/updates a playlist with `source=remote_url`, `remote_type=playlist`, `remote_url=file:///etc/passwd` (or an internal HTTP URL).
- AutoDJ selects the playlist and runs `getMediaFromRemoteUrl()`.
- Attacker reads `GET /api/station/{id}/queue` and observes host file / internal response lines in `autodj_custom_uri`.
Steps to reproduce
Environment: AzuraCast Docker at commit `3f9d6ff`, station with Media + Broadcasting. Confirmed end-to-end on 2026-07-24, including a dedicated non-admin Media+Broadcasting role (no Super Admin).
- Authenticate as a station Media user and create a remote playlist:
POST /api/station/{station_id}/playlists
X-API-Key: <media-key>
Content-Type: application/json
{
"name": "ssrf-lfi-test",
"source": "remote_url",
"remote_type": "playlist",
"remote_url": "file:///etc/passwd",
"is_enabled": true,
"type": "default",
"weight": 99,
"order": "shuffle"
}Alternate payloads: `file:///etc/hostname`, `file:///etc/hosts`.
- Ensure the playlist is the playable AutoDJ source (disable competing song playlists if needed). Wait for a normal AutoDJ queue build tick, or in a lab use `PUT /api/admin/debug/station/{station_id}/clearqueue` (admin) to force rebuild. Production path is the normal AutoDJ/`BuildQueue` sync; admin clearqueue is not required for the bug.
- As Broadcasting (same principal is fine), read the queue:
GET /api/station/{station_id}/queue
X-API-Key: <media-key>- Observe `autodj_custom_uri` on queued items. Host file lines (or internal HTTP playlist lines) appear as the URI strings returned from `PlaylistParser::getSongs()`.
Expected: Only `http`/`https` remote playlist URLs are fetched; `file://` and internal targets are rejected.
Actual: Unrestricted `file_get_contents($playlist->remote_url)`; file/HTTP body lines leak via the queue API.
Root cause
When `remote_type` is playlist (not raw stream), AutoDJ loads the remote URL with an unrestricted PHP fetch:
// backend/src/Radio/AutoDJ/QueueBuilder.php (getMediaFromRemoteUrl)
$playlistRemoteUrl = $playlist->remote_url;
if (null !== $playlistRemoteUrl) {
$playlistRaw = file_get_contents($playlistRemoteUrl);
if (false !== $playlistRaw) {
$mediaQueue = PlaylistParser::getSongs($playlistRaw);
}
}There is no scheme allowlist (`http`/`https` only), no block on `file://` / `phar://` / other wrappers, and no private/loopback/link-local/metadata IP policy (unlike partial checks elsewhere, e.g. webhook `isLinkLocal`).
Parsed entries are written onto the queue:
$stationQueueEntry->autodj_custom_uri = $mediaUri;`PlaylistParser` treats non-comment lines as songs (so `/etc/passwd` lines become "URIs"). `QueueController` exposes `autodj_custom_uri` on the station queue API. The playable gate for remote sources is `remote_type === Playlist` in `StationPlaylist::isPlayable()`.
Suggested fix
- Allowlist schemes: only `http` and `https`. Reject `file://`, `phar://`, `data://`, and any other wrapper.
- SSRF policy: resolve hostnames and block loopback, RFC1918, link-local, and cloud metadata addresses; account for DNS rebinding and redirect-after-validate.
- Prefer Guzzle (already used elsewhere) with an SSRF-aware middleware instead of `file_get_contents` for user-controlled URLs.
- Optional defense-in-depth: disable `allow_url_fopen` in the web container if nothing else requires it; never treat queue URIs as a channel for raw fetched body lines from untrusted URLs.
### POC screenshot
<img width="1920" height="1080" alt="image" src="https://github.com/user-attachments/assets/ddd45e04-d779-47d6-8bfb-ea13fb9d89dc" />
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Estado del parche por paquete
La fuente no informa paquetes ni versiones corregidas.
Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/AzuraCast/AzuraCast/security/advisories/GHSA-rrjx-wrhf-8v47Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
