Summary
Koel's podcast feature accepts episode enclosure URLs from RSS feeds and stores them without applying the same SafeUrl SSRF validation used for the main feed URL.
When a user plays an episode, the server fetches and streams the enclosure URL directly, which can allow server-side requests to arbitrary internal HTTP services if an attacker controls the RSS feed.
Affected context
The vulnerability arises in Koel's podcast ingestion and playback flow where RSS feeds are parsed and episode <enclosure url="..."> values are persisted.
Deployments are affected when:
- Podcast feeds are accepted from external or user-controlled sources, and
- The server hosting Koel has network access to internal or cloud-metadata services, and
- Episode playback triggers the server to fetch enclosure content on behalf of the user.
Under these conditions, the application becomes an HTTP proxy to internal network resources that are not otherwise directly reachable from the internet.
Exploit preconditions
- Attack surface: Podcast subscription mechanism that ingests external RSS feeds containing episode enclosures.
- Required access: Ability to supply or influence a podcast RSS feed consumed by Koel (e.g., adding a podcast URL, controlling the feed source, or compromising an existing feed).
- Trigger point: A user plays an affected podcast episode, causing Koel to call
Http::sink()->get()on the attacker-controlled enclosure URL. - Why exploitation is possible: Only the top-level podcast feed URL is validated via SafeUrl (DNS + public IP check). The per-episode enclosure URLs are neither revalidated nor constrained, so the server performs arbitrary HTTP GET requests from its own network context and returns the raw response stream to the client.
Why this happens
The core issue is incomplete application of SSRF defenses: validation is applied to the feed URL but not consistently propagated to derived URLs within the RSS content.
This leads to CWE-918: Server-Side Request Forgery (SSRF), where the server makes HTTP requests to attacker-specified endpoints based on ostensibly trusted but externally sourced data.
Design-wise, the system treats enclosure URLs extracted from RSS as inherently safe metadata, persisting them and later using them as direct HTTP targets without:
- Reusing the SafeUrl rule,
- Restricting address ranges or protocols, or
- Treating them as untrusted input at the point of use.
The pattern is an insufficient validation of secondary/indirect URLs derived from an initially validated resource, creating a server-side proxy into internal networks.
Potential impact
- Full-read SSRF against internal HTTP services the Koel server can reach.
- Access to sensitive internal APIs, admin panels, or service endpoints not exposed to the public internet.
- Retrieval of cloud-instance metadata (e.g., credentials, tokens, configuration) if reachable via HTTP.
- Discovery and mapping of internal hosts, ports, and HTTP-based services.
- Exposure of configuration files, debug endpoints, or status pages that can assist in further compromise.
General mitigation guidance
Effective mitigation focuses on treating all externally influenced URLs—including those derived from parsed content—as untrusted and applying consistent SSRF controls:
- Apply the same SafeUrl SSRF validation (or equivalent) to enclosure URLs and any other nested or secondary URLs extracted from feeds.
- Restrict outbound HTTP requests from the application to a well-defined allowlist of domains or networks, preferably outside internal address ranges (e.g., RFC1918, link-local, loopback, metadata endpoints).
- Introduce a dedicated URL-fetching service or proxy with strict egress policies and no access to sensitive internal networks.
- Enforce network-level egress restrictions for the Koel server or its container, limiting what internal resources it can directly reach.
- Treat configuration-driven podcast sources as partially trusted, and use schema and type validation when parsing RSS fields that later drive network requests.
How teams detect issues like this
Detection can combine code-centric and operational approaches:
- Static analysis / SAST: Flag code patterns where user or externally sourced input influences HTTP client calls (e.g.,
Http::get,Http::sink()->get) without passing through a validation or sanitization layer like SafeUrl. - Code review: Look for:
- Parsing of RSS/XML/JSON payloads where URL fields are stored and later used to initiate server-side HTTP requests.
- Inconsistent application of URL validation rules between primary inputs (e.g., feed URL) and nested data (e.g., enclosures).
- Runtime monitoring: Instrument outbound HTTP requests to log target domains and IP address ranges, alerting on requests to internal, loopback, or metadata addresses.
- Security policy enforcement: Use CI/CD checks or linters that require any network call site to reference a validated URL-building helper or a central HTTP client wrapper with SSRF protections.

