/

CVE-2026-49128

Severity:

HIGH RISK

(7.5)

Path Traversal in MPD Local Storage Plugin

CVE-2026-49128

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Unauthorized File and Directory Access

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Music Player Daemon (MPD) before 0.24.11 contains a path traversal flaw in the local storage plugin where user-supplied URIs are concatenated with the storage root without proper canonicalization.

An unauthenticated attacker can abuse the listfiles and albumart commands to traverse outside the configured music_directory and enumerate or read files in arbitrary directories accessible to the MPD process.

Affected context

This vulnerability appears in MPD deployments that enable the local storage plugin and expose MPD's control interface (e.g., TCP socket, networked clients) to users that are not fully trusted.

The bug resides in LocalStorage::MapFSOrThrow and LocalStorage::MapUTF8, where paths are computed by joining a configured storage root with user-provided URIs.

When these URIs contain .. segments, the resulting on-disk path can escape the intended music_directory, allowing access to any file or directory readable by the MPD process account.

Exploit preconditions

  • Attack surface: MPD control interface using commands such as listfiles and albumart.
  • Required access: Ability to issue MPD protocol commands (often unauthenticated or weakly controlled in some setups).
  • Trigger point: Submission of crafted URIs containing .. path segments that are passed to LocalStorage::MapFSOrThrow / MapUTF8.
  • Why exploitation is possible: The code constructs file system paths via string concatenation without normalizing or validating the resulting path, allowing the kernel's path resolution at openat() time to flatten .. and escape the configured root directory.

Why this happens

The core issue is improper handling of user-controlled path components, a classic CWE-22: Path Traversal scenario.

Instead of canonicalizing the user-supplied URI and enforcing that the resolved path remains within the configured music_directory, the implementation simply concatenates strings and relies on the filesystem to process them.

This allows ../ sequences in the URI to remain intact until the operating system resolves them, effectively bypassing the intended directory boundary and granting access to paths outside the designated storage root.

Potential impact

  • An attacker may enumerate directory contents (filenames, sizes, modification times) anywhere that the MPD process can read.
  • An attacker could read album-art-style image files from arbitrary directories outside the music_directory.
  • Sensitive information stored in readable image or media files (e.g., screenshots, document scans) could be exposed.
  • Environmental details such as directory layout and file metadata can be used to support further attacks against the host.

General mitigation guidance

Effective mitigation focuses on strict path normalization and enforcing directory boundaries:

  • Canonicalize and normalize all user-supplied paths before use, resolving . and .. segments and symbolic links as appropriate.
  • Enforce that the resolved absolute path remains within the configured music_directory (or other intended root) before opening files.
  • Prefer filesystem APIs or utility functions that operate relative to a trusted root and reject traversal attempts instead of manual string concatenation.
  • Run the MPD service under a dedicated, least-privileged account with minimal read access outside of the music directory.
  • Limit network exposure of the MPD control interface using firewalls, authentication, and access controls to reduce who can send commands.

How teams detect issues like this

Detection typically combines code-level and behavioral approaches:

  • Static analysis: Search for patterns where user-controlled path segments are concatenated with root directories or passed directly to file APIs (openat, fopen, etc.) without validation or canonicalization.
  • Code review: Flag logic that handles URIs or filenames in the local storage plugin and check for explicit checks against .., absolute paths, or paths that escape the configured root.
  • Runtime monitoring: Observe MPD logs and system audit logs for unexpected file access patterns, such as the MPD process reading files outside the configured music_directory.
  • Security testing: Use directory traversal test cases (e.g., ../ sequences in URIs) in integration tests to verify that access is properly constrained.

Sources

SourceLink
github.comgithub.com/MusicPlayerDaemon/MPD/commit/0b5315b9e5a42cb0e88bf46a7579bb5641543f60
github.comgithub.com/MusicPlayerDaemon/MPD/issues/2484
github.comgithub.com/MusicPlayerDaemon/MPD/releases/tag/v0.24.11
mstreet97.github.iomstreet97.github.io/security-research/opensource/vulnerability-disclosure/cybersecurity/cve/2026/05/25/Four_Bugs_Reachable_nc.html
raw.githubusercontent.comraw.githubusercontent.com/MusicPlayerDaemon/MPD/v0.24.11/NEWS
musicpd.orgmusicpd.org/news/2026/05/mpd-0-24-11-released/
vulncheck.comvulncheck.com/advisories/music-player-daemon-path-traversal-via-localstorage-uri-handling

Frequently asked

questions

Yes, if the MPD control interface is reachable over the network and not restricted by firewalls or strong authentication, an attacker can issue crafted commands remotely.

Not necessarily. Exploitation requires the ability to send listfiles or albumart commands to MPD; many deployments expose MPD without strict authentication, making the attack effectively unauthenticated.

Normalize and canonicalize all user-supplied paths, then enforce that the resolved path is strictly contained within an intended root directory before accessing the filesystem, rejecting any request that attempts to escape that root.

Adopt secure filesystem access patterns (no raw string concatenation for paths), include path traversal checks in code review and static analysis rules, and design APIs around "safe roots" where all file operations are constrained by construction.

Find out what's already
exploitable in your codebase.