Repository navigation
Threat Model
This page records what MusicWasp trusts, what it does not, and which risks are accepted. Review it when a feature starts fetching from the network or reading files from outside the user's control.
MusicWasp is a desktop application for one local user on Linux and Windows. It has no server, no accounts and no inbound network port. The main threat is untrusted content the user chooses to load or play: a downloaded audio file, a podcast feed, a skin, or an image embedded in a tag.
| Asset | Where it lives | Protection |
|---|---|---|
| Library database |
library.db in the data directory |
Local file, not encrypted |
| ListenBrainz token | OS credential store (fallback: settings.json, mode 0600) |
Keyring; see Configuration |
| AcoustID application key | Compiled into release builds | Not a secret; sent only in fingerprint lookups |
| Audio files and tags | User's music folders | MusicWasp never deletes audio files |
| Settings and undo journals | Data directory | Owner-only on Unix for settings.json
|
| Input | Source | Handling |
|---|---|---|
| Audio files and tags | Anything the user scans | Read with lofty; pictures are decoded with bounded image limits |
| Cover art | Tags, cover.jpg sidecars, Cover Art Archive |
Downloads capped at 16 MiB; decoded within 8192 px and 512 MiB |
| Podcast feeds | Any HTTP(S) host the user subscribes to | Capped at 32 MiB; parsed as XML; text stored as plain text |
| Podcast enclosures | Named by the feed | Fetched without a size cap; streamed through the decoder |
| Radio stream URLs | Typed by the user | Scheme must be http or https
|
| Lyrics sidecars | Beside the audio file | Capped at 1 MiB |
| Skins and backgrounds | User files and skins.json
|
Decoded within the image limits; invalid files fall back to built-ins |
| MusicBrainz and AcoustID responses | Remote services | Parsed as JSON; requests use one shared client with timeouts |
-
Decompression bombs: image decodes set explicit dimension and allocation limits. See
gui/src/images.rs. -
Size caps: feeds, cover downloads and lyrics sidecars are read through a capped reader
(
core/src/bounded.rs). - SQL injection: all user input reaches SQLite as bound parameters. The only interpolated strings are fixed column lists.
-
Path traversal from tags: organizer path segments are sanitized and
./..are rejected (core/src/organize.rs). -
Debug overrides:
MUSICWASP_*developer hooks run only withMUSICWASP_DEBUG=1. Endpoint overrides for MusicBrainz, Cover Art Archive and AcoustID are compiled out of release builds, so an environment variable cannot redirect the AcoustID key. - Credentials: the ListenBrainz token is kept in the OS credential store and only sent to the fixed ListenBrainz submission URL.
- Poisoned locks: the audio thread recovers from poisoned mutexes rather than panicking.
Before: the app followed any http or https URL a subscribed feed named, including
localhost, LAN addresses and link-local addresses such as 169.254.169.254, and followed redirects
to any host. A subscribed feed could make the app send GET requests from the user's machine to local
services. Feed text was stored and displayed, so a service returning XML-like content could show it.
Now: by default, podcast feeds, podcast enclosures and every redirect hop may only use public
addresses (core/src/netguard.rs):
- IP-literal hosts (
http://127.0.0.1/,http://[::1]/) are refused before any request. - Host names go through a resolver that keeps only public addresses. reqwest connects to exactly those addresses, so a name that resolves to a private address, including by DNS rebinding, is not reached.
- Refused: loopback, private (RFC 1918 and unique-local), link-local, CGNAT, multicast, reserved and unspecified addresses, including IPv4-mapped, IPv4-compatible, NAT64 and 6to4 forms.
- Redirects are rechecked at each hop and capped at 10.
- The user can turn on Allow podcasts from local network addresses in Settings → Track options for a podcast server on their own network. The setting applies to feeds and episodes.
Radio streams are not restricted: the user types those URLs, so the request is explicit. Radio streams on a LAN work without the setting.
Residual risk:
-
Proxies. When a system proxy is configured (
HTTP_PROXYand similar), reqwest sends requests through it, and the proxy resolves the target. The address policy does not apply to the proxy's lookups. Users who need the policy to hold should not route MusicWasp through a proxy they don't control. - Playback refusals are quiet. A refused enclosure stops playback. The player logs the reason, and the UI shows "stream stopped" without the cause. Feed refreshes show the reason in the Podcasts view.
- Cross-host redirects still happen between public hosts. The policy stops the redirect into a private address, not the redirect itself.
- Name resolution blocks a worker thread. Each new connection resolves its host on the HTTP client's worker, as any blocking resolver does.
- Existing subscriptions that point at local addresses fail to refresh until the setting is on.
Not implemented:
- Refuse enclosure URLs whose scheme is not
httporhttpswith a clear message. reqwest already refuses other schemes, so this is for the error text only. - Stop following redirects to a different host, or cap them at 5.
- Record the resolved address for each feed, so a change to a private address is noticed.
- Physical access to an unlocked session.
- A compromised operating system or keyring provider.
- Malicious code already running as the same user. It can read the library and the token, whatever MusicWasp does.