Summary
Koel's Subsonic-compatible internet radio routes accept authenticated users' stream URLs without applying the URL and content-type checks used by the regular radio API. When the server later proxies the stored URL, an attacker may cause Koel to request internal services that are reachable from the server.
Affected context
The vulnerability occurs in Koel deployments that expose the Subsonic-compatible internet radio creation or update routes and allow an authenticated user to control a stored stream URL. The URL is later processed by the radio streaming proxy without equivalent destination and response validation, so the Koel server may connect to loopback, private-network, container, metadata, or other internally reachable HTTP services.
Exploit preconditions
- Attack surface: Subsonic-compatible internet radio creation and update routes, followed by the radio streaming endpoint
- Required access: An authenticated Koel account with permission to create or modify an internet radio station
- Trigger point: Server-side opening and proxying of the stored
streamUrl - Why exploitation is possible: The Subsonic request paths do not apply the same safe-URL and audio-content-type checks as the regular radio API, allowing user-controlled destinations to reach the server-side stream proxy
Why this happens
The underlying bug is inconsistent validation of equivalent input paths. The Subsonic request handlers accept a user-controlled URL and pass it to a server-side proxy that opens the URL directly, without enforcing destination restrictions before the outbound request.
This maps to CWE-918: Server-Side Request Forgery, where an application makes network requests based on attacker-influenced input and thereby exposes the application's network position and privileges.
Potential impact
- An attacker may access HTTP services bound to the Koel host or internal networks
- The vulnerability could expose cloud or container metadata endpoints
- Internal service responses may be returned through the streaming endpoint
- Attackers may use reachable administrative or unauthenticated services for further compromise
- Sensitive network topology, credentials, or service data could be disclosed
General mitigation guidance
Mitigation generally focuses on treating every user-supplied URL as untrusted and applying consistent outbound-request controls across all API variants.
Common defensive patterns include:
- Reuse centralized safe-URL validation for every route that accepts a stream URL
- Resolve hostnames and reject loopback, link-local, multicast, RFC1918, RFC6598, and other prohibited destinations
- Recheck the destination after redirects and prevent DNS rebinding
- Restrict outbound traffic using network-level egress policies and allowlists
- Validate the upstream scheme, port, response type, and response size before proxying content
- Avoid returning arbitrary upstream response bodies to clients
- Run the application with minimal network and system privileges
How teams detect issues like this
Detection can combine code analysis, request monitoring, and network policy enforcement.
Useful approaches include:
- Static analysis rules for network APIs such as
fopen, HTTP clients, or stream wrappers receiving request-derived URLs - Code review checks for inconsistent validation between REST, compatibility, and alternate protocol handlers
- Tests that verify rejection of loopback, private, link-local, metadata, and redirected destinations
- Monitoring outbound requests from Koel for unusual internal IP ranges, metadata hostnames, or unexpected ports
- Egress firewall policies that alert on or block application traffic to restricted network segments
- Automated security review tools that identify server-side URL fetches and missing destination validation

