# GHSA-8q6q-m837-fv64: Koel has SSRF through Authenticated Subsonic podcast feed URLs

> Authenticated users can exploit SSRF in Koel's Subsonic API to access internal network services via podcast feed URLs.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 15 Jul 2026

## What is GHSA-8q6q-m837-fv64?

GHSA-8q6q-m837-fv64 is a server-side request forgery vulnerability in phanan/koel, published on 15 Jul 2026. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

## 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.

## Which versions are affected by GHSA-8q6q-m837-fv64?

2 open source packages ship an affected version, including phanan/koel.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `phanan/koel` | Packagist | All versions | 9.7.0 |
| `phanan/koel` | Packagist | All versions | 9.7.0 |

## How do I fix GHSA-8q6q-m837-fv64?

Upgrade phanan/koel to 9.7.0 or later.

## Is GHSA-8q6q-m837-fv64 being exploited?

There is no known exploitation of GHSA-8q6q-m837-fv64 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-8q6q-m837-fv64 and fix it if it is affected.

What it is: GHSA-8q6q-m837-fv64 is a server-side request forgery vulnerability in phanan/koel, published on 15 Jul 2026. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-8q6q-m837-fv64 in the wild and no public exploit code.

Affected packages and fixed versions:
- phanan/koel (Packagist): affected all versions; fixed in 9.7.0
- phanan/koel (Packagist): affected all versions; fixed in 9.7.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-8q6q-m837-fv64/ (Markdown: https://insights.sbomify.com/GHSA-8q6q-m837-fv64/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-8q6q-m837-fv64

---
From sbomify Insights: https://insights.sbomify.com/GHSA-8q6q-m837-fv64/
Summaries are generated and may contain mistakes; the official description above is the record.
