GHSA-MF65-HJ88-HVRW
AzuraCast OS command injection via incomplete backslash escaping in Liquidsoap annotation values
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-MF65-HJ88-HVRW divulgada · CVSS 8.8 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
AzuraCast serializes track metadata into Liquidsoap annotation strings using a helper that escapes double quotes but not backslashes. A user holding the station-level Media permission can upload a media file whose ID3 title (or other annotated tag) ends a value with a backslash immediately before the closing quote. Because the backslash is not escaped, the serialized annotation breaks out of the quoted value, letting the attacker inject an arbitrary Liquidsoap resource URI. Using Liquidsoap's built-in `process:` protocol, this yields arbitrary OS command execution in the Liquidsoap container when the generated playlist is loaded. The attack needs no software beyond a default AzuraCast and Liquidsoap installation and triggers automatically during playback.
Root Cause
The annotation serializer neutralizes the double-quote delimiter (`"` becomes `\"`) and strips newline, tab, and carriage-return characters, but it does not neutralize the backslash character. In a context where backslash is itself the escape character, failing to escape it is unsafe: a value containing a trailing backslash followed by a quote is emitted as `\\"`, which the Liquidsoap lexer reads as an escaped backslash (a literal `\`) followed by an unescaped closing quote. The quoted value therefore terminates early, and the remaining attacker-controlled bytes are parsed as subsequent annotation syntax and, ultimately, as the resource URI.
backend/src/Radio/Backend/Liquidsoap/ConfigWriter.php:1418
return str_replace(['"', "\n", "\t", "\r"], ['\"', '', '', ''], $strVal);
// escapes the quote delimiter but not the backslash escape character
Vulnerable function: App\Radio\Backend\Liquidsoap\ConfigWriter::annotateValueThe tag value reaches this serializer unfiltered: the title is stored via `Types::stringOrNull()` with only a length truncation applied, and the annotation key allowlist filters by key name, never by value.
Impact
The attacker needs the station-scoped `StationPermissions::Media` permission (media manager, not global administrator). No additional software or non-default configuration is required: Liquidsoap and its built-in `process:` protocol are always present, and AzuraCast does not disable or restrict that protocol. The attacker achieves arbitrary command execution inside the Liquidsoap process context: reading container files and environment variables, writing or corrupting files, and disrupting the broadcast process. Execution occurs passively when the AutoDJ generates the playlist annotation and Liquidsoap loads the watched playlist file, making the attack persistent and easy to overlook.
Proof of Concept
Prerequisites:
- A default AzuraCast station running Liquidsoap (process: protocol enabled by default).
- An account with the station-level Media permission.
- A media file whose ID3 title tag is set to the payload below.- Set the media file's ID3 title tag to the following value (35 bytes), then upload it through the station media management API and add it to a playlist:
\":process:wav,id>/tmp/pwned #- When the AutoDJ builds the playlist annotation, the serializer emits the following line into the station's `.m3u` playlist file (the leading backslash is preserved, the quote is escaped, producing `\\"` which closes the title value early):
annotate:title="\\":process:wav,id>/tmp/pwned #",artist="Normal Artist",...:media:path/to/song.mp3- Liquidsoap, watching the playlist file, parses `title` as the literal `\`, treats the following `:` as the end of the annotation block, and resolves the remainder as the URI `process:wav,id>/tmp/pwned #...`. The `process:` protocol runs the command portion through the shell:
# /tmp/pwned inside the Liquidsoap container now contains the output of `id`
# (the trailing `#` comments out the rest of the generated line)Attack Chain
- Exposure: An authenticated media manager uploads a media file through the station media management API, guarded by `StationPermissions::Media`.
- Control: The ID3 title is stored by `StationMedia::fromMetadata()` at `backend/src/Entity/StationMedia.php:177` via `Types::stringOrNull()`, with only a 255-character truncation at `backend/src/Entity/Traits/HasSongFields.php:53`; backslash and quote survive.
- Path: On a `WriteLiquidsoapConfiguration` event, `PlaylistFileWriter` (`backend/src/Radio/Backend/Liquidsoap/PlaylistFileWriter.php:148-167`) dispatches `AnnotateNextSong`, whose `Annotations` subscriber adds the title (`backend/src/Radio/AutoDJ/Annotations.php:101-103`); `AnnotateNextSong::buildAnnotations()` calls `ConfigWriter::annotateArray()` which calls `annotateValue()`.
- Guard: `annotateValue()` at `backend/src/Radio/Backend/Liquidsoap/ConfigWriter.php:1418` escapes `"` to `\"` but leaves `\` untouched, so a trailing backslash before the quote produces `\\"` and the quoted value is terminated early. The annotation key allowlist filters keys, not values.
- Primitive: The broken-out bytes are written verbatim to the `.m3u` file and parsed by Liquidsoap's `playlist()` loader as a resource URI, reaching the built-in `process:` protocol.
- Result: The `process:` protocol executes the attacker's command through the shell, giving arbitrary OS command execution within the Liquidsoap container.
Bypass Evidence
The relevant protection is the quote escaping in `annotateValue()` (`ConfigWriter.php:1418`), intended to keep attacker text inside the quoted annotation value. It fails because the backslash escape character is not itself escaped. The strongest challenge to the finding was whether Liquidsoap's annotation lexer actually treats `\\` as an escape sequence; if it treated only `\"` as special, the sequence `\\"` would keep the value open. Inspection of Liquidsoap v2.4.5 (installed via `util/docker/stations/setup/liquidsoap.sh:21`) resolves this: the lexer's string reader consumes `\\` as a single escape unit producing a literal backslash, leaving the following `"` as an unescaped closing delimiter, so the value terminates and the remaining bytes are parsed as annotation/URI syntax. The `process:` protocol is registered by default in the Liquidsoap standard library and is not disabled or restricted by AzuraCast. The earlier remote-relay-password advisory addressed a different function (`cleanUpString`) and did not modify `annotateValue()`.
Affected Versions
- Ecosystem: `composer`
- Package: `azuracast/azuracast`
- Confirmed affected range: `<= 0.23.8`
- Latest release checked: `0.23.8` (Packagist
https://packagist.org/packages/azuracast/azuracast) - Fix status: not fixed
The incomplete escaping in `annotateValue()` is present in the latest stable release (0.23.8). The earlier remote-relay-password fix (released in 0.23.6) did not modify this function, so the issue is independent of that advisory. The introduction boundary was not established from the available history.
Suggested Fix
Neutralize the backslash before (or together with) the double quote when serializing annotation values, so that a value's trailing backslash cannot terminate the quoted field. Escaping `\` to `\\` and `"` to `\"` (backslash first) makes the serialized value self-consistent with Liquidsoap's string lexer. The fix must cover every annotated field, not only the title, since any attacker-influenced tag reaches the same serializer. As an interim mitigation, operators can restrict the station Media permission; this reduces exposure but does not remove the underlying flaw.
---
Reported by zx.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Packagistazuracast/azuracast |
Sin parche | — | — | — |
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-mf65-hj88-hvrwLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
