DEV Community

OnaEiuspkz
OnaEiuspkz

Posted on

Mopidy HTTP is safe only while its bind address stays inside the trusted boundary

Mopidy HTTP is safe only while its bind address stays inside the trusted boundary

Mopidy's HTTP extension exposes the player's core API over HTTP and WebSockets. Its official documentation is unusually direct: the extension has no user authentication or authorization, and anyone who can reach the web server can use the full core API. Mopidy mitigates the default exposure by binding the HTTP server to 127.0.0.1. Changing http/hostname to a network address removes that local-only bound.

A count-only ZoomEye query at 19:45 UTC on 25 November 2026 returned 0 matches for app="Mopidy" and 170 for title="Mopidy". The query used sub_type=all, page 1, and page size 1. The title count is an index observation, not a count of public Mopidy instances. The official default bind behavior also means an indexed page may be a web frontend, a reverse proxy, or a customization that has its own controls.

The product documentation defines the control

The HTTP extension's documentation says the core API can be reached through the web server. It recommends local-network access or a reverse proxy that performs user authentication. CORS settings affect which browser origins can send requests, and CSRF protection should remain enabled. Those settings reduce browser-origin risk, but they do not replace an authenticated proxy or a firewall.

The configuration defaults matter. The HTTP server is local-only unless the operator changes http/hostname. Zeroconf publication can advertise the service name on the local network. An operator who wants remote control should understand that every listener change is a security decision, not just a convenience setting.

Find the address that changed

For each owned Mopidy deployment, record the configured hostname, port, CORS origins, CSRF setting, and the web clients that connect. Check the actual process and container port mapping because a localhost bind inside a container can still be published on a host interface. Search proxy and orchestration configuration for a route that forwards to the Mopidy port.

If the service is network-reachable, test only a read-only request from an approved host. Confirm whether it requires the authenticating proxy and whether direct access to the backend port is blocked. Do not change the track or queue on a production system. Preserve the exact response and source address as evidence.

Put Mopidy behind a real identity boundary

Keep the HTTP listener on localhost or a private management address. If remote users need control, put Mopidy behind a reverse proxy that authenticates every request and enforces the intended user set. Configure CORS only for trusted client origins. Do not treat a long random URL path as authentication.

Review the web clients hosted by Mopidy and the extensions that add routes. A third-party client may expose additional endpoints or accept untrusted callbacks. Remove unused clients and extensions, and verify that the proxy covers the JSON-RPC path as well as the static interface. If the team cannot add authentication, restrict access to a VPN or a dedicated host firewall.

What to log and review

Record HTTP and WebSocket connections, CORS rejections, CSRF failures, and changes to the player queue or configuration. Correlate an unusual request with the client device and the user who should be using it. Mopidy may not distinguish users because the HTTP extension has no user model, so proxy identity and network identity become the relevant evidence.

After a suspected unauthorized session, stop the exposed listener, preserve logs and configuration, and rotate credentials used by music services or plugins. Review the queue, library paths, and any plugin that could reach files or network services. Rebuild the host if the reachability window allowed code or configuration changes outside Mopidy.

The useful next step

Start with the owned Mopidy hosts. Check the http/hostname value, the effective container port mapping, CORS, CSRF, and reverse-proxy authentication. The 170 title matches are a reminder to discover candidates, while the product documentation provides the actual security rule: the HTTP API is unauthenticated, so its network boundary is the authentication boundary.

References

Top comments (0)