GHSA-8q6q-m837-fv64: Phanan/koel Koel Has SSRF Through Authenticated Vulnerability

MODERATE
CVSS 6.4
CWE-918
Published
Advisory Summary

GHSA-8q6q-m837-fv64 is a MODERATE (CVSS 6.4) koel has ssrf through authenticated vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Phanan/koel libraries in the Packagist ecosystem. The issue involves koel has ssrf through authenticated subsonic podcast feed urls. Remediation is available by upgrading affected packages to version 9.7.0.

GHSA-8q6q-m837-fv64 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-8q6q-m837-fv64
Severity MODERATE
CVSS v3.1 Base Score 6.4
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product Phanan/koel
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 6.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix GHSA-8q6q-m837-fv64

To remediate this vulnerability, upgrade all affected Phanan/koel dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

phanan/koel fixed: 9.7.0
Upgrade phanan/koel to 9.7.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for phanan/koel

How to Check if You Are Affected

To determine whether your application is affected by GHSA-8q6q-m837-fv64, inspect your project dependencies for Phanan/koel:

inspect dependencies for phanan/koel

Analyze the terminal output to locate any version of Phanan/koel in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 9.7.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In Phanan/koel, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary Koel's Subsonic `createPodcastChannel.view` endpoint accepts a user supplied podcast feed URL and fetches it server-side before applying the safe URL checks that are used for podcast episode enclosure URLs. An authenticated Subsonic API user can provide a loopback or internal URL as the feed URL and cause the Koel backend to issue a request to that address. A related redirect gap exists in the podcast stream helper: `PodcastService::getStreamableUrl()` validates only the original URL, then lets Guzzle follow redirects and accepts the final redirected URL without re-validating it. ## Impact An attacker with any valid Koel account and Subsonic API key can trigger server-side requests from the Koel host to loopback or internal network services. This can be used for blind SSRF against internal HTTP endpoints reachable by the Koel deployment. If an internal service returns valid RSS/XML or permissive CORS responses, parts of the response or final URL may be reflected back through normal podcast or stream behavior. ## Reproduction 1. Start Koel v9.6.0 or current main and create a normal user. 2. Obtain the user's Subsonic API key. 3. Start a local canary HTTP server on the Koel host at `127.0.0.1:8103` that records requests and returns this minimal RSS feed: ```xml <?xml version="1.0" encoding="UTF-8"?> <rss version="2.0"> <channel> <title>Internal Canary Feed</title> <link>https://example.com/</link> <description>Internal feed SSRF canary</description> <item> <title>Episode One</title> <guid>koel-internal-canary-episode-1</guid> <pubDate>Mon, 01 Jun 2026 12:00:00 GMT</pubDate> <enclosure url="https://example.com/episode.mp3" length="1" type="audio/mpeg" /> </item> </channel> </rss> ``` 4. Send an authenticated Subsonic request: ```http GET /rest/createPodcastChannel.view?apiKey=<SUBSONIC_API_KEY>&f=json&url=http://127.0.0.1:8103/feed.xml HTTP/1.1 Host: koel.example ``` 5. The endpoint returns a successful Subsonic response and the canary records a backend request: ```text GET /feed.xml ``` Unauthenticated control: the same request without a valid API key fails and does not hit the canary. Redirect control for the stream helper: calling `PodcastService::getStreamableUrl()` with direct `http://127.0.0.1:8102/secret` returns `null` and makes no canary request. Calling it with a safe-looking public URL that redirects to `http://127.0.0.1:8102/secret` causes the backend to request `OPTIONS /secret` and returns the loopback final URL. ## Root cause `app/Http/Requests/Subsonic/CreatePodcastChannelRequest.php` validates `url` only as `required|string|url`. The controller passes it to `PodcastService::addPodcast()`, where `PodcastService.php` calls `createParser($url)` and `Poddle::fromUrl($url, ...)` before any `Network::isSafeUrl()` check. The enclosure URL guard in `synchronizeEpisodes()` runs later and only covers episode enclosure URLs, not the feed URL that was already fetched. For streaming, `PodcastService::getStreamableUrl()` checks `Network::isSafeUrl($url)` on the original URL, then follows redirects with Guzzle and accepts the last redirect target from `X-Guzzle-Redirect-History` without validating that target. ## Remediation Validate the podcast feed URL with the same safe URL policy before `Poddle::fromUrl()` performs any request. Re-validate every redirect target before following it, or disable automatic redirects and manually fetch only targets that pass the safe URL policy. Apply the same redirect validation in `getStreamableUrl()`. Add regression tests for direct loopback and private IP feed URLs, DNS names resolving to private ranges, and public URL to loopback redirects.

GHSA-8q6q-m837-fv64 Affected Phanan/koel Versions

1 component(s)
Fixed Versions:
9.7.0
Product / Package Ecosystem Affected Versions Fixed Version
phanan/koel
Packagist
< 9.7.0
9.7.0

References

Frequently Asked Questions

What is GHSA-8q6q-m837-fv64?
GHSA-8q6q-m837-fv64 is a security vulnerability in Phanan/koel involving Koel has SSRF through Authenticated Subsonic podcast feed URLs under CWE-918: Server-Side Request Forgery (SSRF).
Which Phanan/koel versions are affected?
Affected versions include releases prior to 9.7.0 across affected packages: phanan/koel.
What version fixes GHSA-8q6q-m837-fv64?
Upgrading to 9.7.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is phanan/koel affected?
Yes, phanan/koel is affected in releases prior to 9.7.0. Upgrade your dependency to 9.7.0 or later.
What is the CVSS score of GHSA-8q6q-m837-fv64?
GHSA-8q6q-m837-fv64 has a CVSS v3.1 base score of 6.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N.
What CWE is associated with GHSA-8q6q-m837-fv64?
GHSA-8q6q-m837-fv64 is classified under CWE-918: Server-Side Request Forgery (SSRF) (The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.).
How can I check Packagist dependencies for GHSA-8q6q-m837-fv64?
Run the dependency tree command: 'inspect dependencies for phanan/koel'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-8q6q-m837-fv64",
  "modified" : "2026-07-15T17:31:12Z",
  "published" : "2026-07-15T17:31:12Z",
  "aliases" : [ ],
  "summary" : " Koel has SSRF through Authenticated Subsonic podcast feed URLs",
  "details" : "## Summary\n\nKoel's Subsonic `createPodcastChannel.view` endpoint accepts a user supplied podcast feed URL and fetches it server-side before applying the safe URL checks that are used for podcast episode enclosure URLs. An authenticated Subsonic API user can provide a loopback or internal URL as the feed URL and cause the Koel backend to issue a request to that address.\n\nA related redirect gap exists in the podcast stream helper: `PodcastService::getStreamableUrl()` validates only the original URL, then lets Guzzle follow redirects and accepts the final redirected URL without re-validating it.\n\n## Impact\n\nAn attacker with any valid Koel account and Subsonic API key can trigger server-side requests from the Koel host to loopback or internal network services. This can be used for blind SSRF against internal HTTP endpoints reachable by the Koel deployment. If an internal service returns valid RSS/XML or permissive CORS responses, parts of the response or final URL may be reflected back through normal podcast or stream behavior.\n\n## Reproduction\n\n1. Start Koel v9.6.0 or current main and create a normal user.\n2. Obtain the user's Subsonic API key.\n3. Start a local canary HTTP server on the Koel host at `127.0.0.1:8103` that records requests and returns this minimal RSS feed:\n\n```xml\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<rss version=\"2.0\">\n  <channel>\n    <title>Internal Canary Feed</title>\n    <link>https://example.com/</link>\n    <description>Internal feed SSRF canary</description>\n    <item>\n      <title>Episode One</title>\n      <guid>koel-internal-canary-episode-1</guid>\n      <pubDate>Mon, 01 Jun 2026 12:00:00 GMT</pubDate>\n      <enclosure url=\"https://example.com/episode.mp3\" length=\"1\" type=\"audio/mpeg\" />\n    </item>\n  </channel>\n</rss>\n```\n\n4. Send an authenticated Subsonic request:\n\n```http\nGET /rest/createPodcastChannel.view?apiKey=<SUBSONIC_API_KEY>&f=json&url=http://127.0.0.1:8103/feed.xml HTTP/1.1\nHost: koel.example\n```\n\n5. The endpoint returns a successful Subsonic response and the canary records a backend request:\n\n```text\nGET /feed.xml\n```\n\nUnauthenticated control: the same request without a valid API key fails and does not hit the canary.\n\nRedirect control for the stream helper: calling `PodcastService::getStreamableUrl()` with direct `http://127.0.0.1:8102/secret` returns `null` and makes no canary request. Calling it with a safe-looking public URL that redirects to `http://127.0.0.1:8102/secret` causes the backend to request `OPTIONS /secret` and returns the loopback final URL.\n\n## Root cause\n\n`app/Http/Requests/Subsonic/CreatePodcastChannelRequest.php` validates `url` only as `required|string|url`. The controller passes it to `PodcastService::addPodcast()`, where `PodcastService.php` calls `createParser($url)` and `Poddle::fromUrl($url, ...)` before any `Network::isSafeUrl()` check. The enclosure URL guard in `synchronizeEpisodes()` runs later and only covers episode enclosure URLs, not the feed URL that was already fetched.\n\nFor streaming, `PodcastService::getStreamableUrl()` checks `Network::isSafeUrl($url)` on the original URL, then follows redirects with Guzzle and accepts the last redirect target from `X-Guzzle-Redirect-History` without validating that target.\n\n## Remediation\n\nValidate the podcast feed URL with the same safe URL policy before `Poddle::fromUrl()` performs any request. Re-validate every redirect target before following it, or disable automatic redirects and manually fetch only targets that pass the safe URL policy. Apply the same redirect validation in `getStreamableUrl()`. Add regression tests for direct loopback and private IP feed URLs, DNS names resolving to private ranges, and public URL to loopback redirects.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "phanan/koel"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "9.7.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 9.6.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/koel/koel/security/advisories/GHSA-8q6q-m837-fv64"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/koel/koel"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/koel/koel/releases/tag/v9.7.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-918" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-15T17:31:12Z",
    "nvd_published_at" : null
  }
}