CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-49340

CVE-2026-49340: Arbitrary File Write via Path Traversal in Gonic Subsonic Playlist Handler

Alon Barad
Alon Barad
Software Engineer

Jun 26, 2026·7 min read·22 visits

Executive Summary (TL;DR)

A logic error and missing path sanitation in Gonic before v0.21.0 allow authenticated users to execute arbitrary file writes across the host filesystem via crafted playlist names.

An arbitrary file write vulnerability exists in Gonic, a music streaming server implementing the Subsonic API. Due to an unreachable guard clause combined with missing path containment validation in the playlist storage engine, authenticated users can write playlist contents to arbitrary filesystem paths with overly permissive directory permissions.

Vulnerability Overview

Gonic is an open-source, self-hosted music streaming server that implements the Subsonic API protocol. To support the synchronization and export of user-created music playlists, Gonic allows playlists to be serialized and stored on the host disk as M3U files. This filesystem interaction introduces an attack surface that must be strictly contained to prevent unauthorized modifications to host system resources.

Prior to version 0.21.0, Gonic exposes an arbitrary file write vulnerability via its Subsonic API implementation. The vulnerability is located within the ServeCreateOrUpdatePlaylist function, which handles request processing for playlist generation and updates. Because the API allows users to specify playlist names that are subsequently mapped to host directories, the absence of strict input containment introduces high security risks.

The vulnerability is categorized under CWE-22 (Improper Limitation of a Pathname to a Restricted Directory) and CWE-697 (Incorrect Comparison). Standard, non-administrative authenticated users can leverage this vulnerability to escape the designated playlist directories. By writing files to arbitrary locations, attackers can manipulate host configuration files, drop shell scripts, or overwrite application components.

Root Cause Analysis

The vulnerability stems from two primary software flaws working in tandem: an unreachable access-control guard clause and a lack of pathname containment in the storage layer.

First, a logic error in ServeCreateOrUpdatePlaylist produces an unreachable guard clause. The application implements an authorization check intended to ensure that the requesting user holds the required permissions to modify playlists or write to specific physical directories. However, due to an incorrect boolean comparison (CWE-697), this validation routine consistently evaluates to false or is bypassed completely, allowing execution to proceed down the write path regardless of the user's privilege tier.

Second, the storage abstraction layer implements a writing routine (Store.Write) that lacks path containment verification (CWE-22). When Gonic attempts to write the .m3u file to the host disk, it joins the base directory path with the client-supplied playlist name. Because Gonic fails to resolve, sanitize, and verify that the final path resides within the base playlist directory, attackers can supply absolute file paths or relative directory traversal sequences (such as ../../).

Third, when the target directory path does not exist, Gonic invokes directory creation functions with overly permissive default flags (CWE-732). Specifically, Gonic calls os.MkdirAll with 0777 permissions. This behavior creates intermediate directories that are globally readable, writable, and executable by any system user on the host, undermining standard operational access controls.

Code Analysis

To understand the vulnerability, consider the simplified representation of the vulnerable Go code path inside the playlist handler and storage layer:

// VULNERABLE FUNCTION (Prior to v0.21.0)
func ServeCreateOrUpdatePlaylist(w http.ResponseWriter, r *http.Request) {
    playlistName := r.FormValue("name") // User-controlled string (e.g., "../../../../etc/cron.d/malicious_job")
    user := GetAuthenticatedUser(r)
 
    // Unreachable Guard Clause due to a logic error
    if user.IsAdmin() == false && IsValidPlaylistPath(playlistName) { 
        // The logical condition is structurally flawed, allowing execution to proceed
        http.Error(w, "Unauthorized", http.StatusUnauthorized)
        return
    }
 
    // Execution proceeds to file write
    err := store.Write(playlistName, playlistData)
    if err != nil {
        http.Error(w, err.Error(), http.StatusInternalServerError)
        return
    }
}
 
func (s *Store) Write(name string, data []byte) error {
    // Vulnerable path generation
    targetPath := filepath.Join(s.BasePlaylistDir, name)
    
    // If directories do not exist, they are created with permissive 0777 permissions
    dir := filepath.Dir(targetPath)
    if err := os.MkdirAll(dir, 0777); err != nil {
        return err
    }
 
    return os.WriteFile(targetPath, data, 0644)
}

The patched version introduces strict path validation to guarantee containment within the designated parent folder before executing any directory-creation or file-writing logic:

// PATCHED IMPLEMENTATION (v0.21.0)
func (s *Store) Write(name string, data []byte) error {
    // 1. Clean and join the path
    targetPath := filepath.Clean(filepath.Join(s.BasePlaylistDir, name))
    
    // 2. Validate path containment (CWE-22 Remediation)
    cleanBase := filepath.Clean(s.BasePlaylistDir) + string(filepath.Separator)
    if !strings.HasPrefix(targetPath, cleanBase) {
        return errors.New("path traversal attempt detected")
    }
 
    // 3. Create intermediate directories with restrictive permissions (0750)
    dir := filepath.Dir(targetPath)
    if err := os.MkdirAll(dir, 0750); err != nil {
        return err
    }
 
    return os.WriteFile(targetPath, data, 0600)
}

Exploitation Mechanics

An attacker with valid, low-privilege authentication credentials can exploit this vulnerability remotely over HTTP. The target endpoint is the Subsonic REST API wrapper for creating or updating playlists, typically accessible at /rest/createPlaylist or /rest/updatePlaylist.

The attack sequence is executed as follows:

  1. Authentication: The attacker authenticates to the Subsonic endpoint using valid user credentials, receiving an active session token or generating valid request query parameters (username, salt, and token).

  2. Payload Formulation: The attacker crafts a request payload containing a directory traversal or absolute path string inside the name parameter. To target a system-level configuration folder, the attacker sets the name to /etc/cron.d/malicious_job or a relative equivalent. The playlist tracks or metadata (within the request body) are populated with content designed to trigger action when parsed by external system utilities.

  3. Request Transmission: The attacker submits an HTTP GET or POST request targeting the endpoint:

POST /rest/createPlaylist?u=attacker&t=token&s=salt&v=1.16.0&c=client&name=../../../../etc/cron.d/malicious_cron HTTP/1.1
Host: target-gonic-instance:8080
Content-Type: application/x-www-form-urlencoded
 
songId=1&songId=2
  1. Execution: The server processes the request, bypasses the faulty guard clause, fails to validate the parent boundary of the generated path, creates any non-existent folders with 0777 permissions, and writes the M3U structured text containing the attacker-specified track paths to /etc/cron.d/malicious_cron.

Impact Assessment

The actual security impact of CVE-2026-49340 is governed by the privilege level under which the Gonic process executes within the host environment.

If Gonic runs as the root user or within a container mapped directly to root on the host namespace, the impact is critical. An attacker can write files to sensitive locations such as /etc/cron.d/, /etc/shadow, /etc/passwd, or /home/user/.ssh/authorized_keys. Writing to these paths allows standard users to execute arbitrary commands, overwrite system binaries, or insert SSH access credentials, resulting in remote code execution (RCE) and full machine compromise.

If Gonic runs as an unprivileged service account, the impact is localized but still significant. The attacker is restricted to folders where the service user has write privileges. However, the attacker can still overwrite Gonic database files, modify configuration assets, or cause a denial of service (DoS) by corrupting the server's data. Additionally, the permissive directory creation permissions (0777) mean that other local service accounts on the host can gain access to Gonic data, facilitating local lateral privilege escalation.

Remediation & Defensive Measures

The definitive solution for CVE-2026-49340 is upgrading Gonic to version 0.21.0 or higher. The release addresses the logic flaws in the Subsonic API handler and introduces path sanitization to isolate files within the designated storage directory.

If immediate patching is not possible, organizations should implement the following host-level and network-level mitigations to reduce exposure:

  1. Enforce Principle of Least Privilege: Verify that Gonic does not run as root. Transition the system to execute the daemon under an isolated, unprivileged system user account (e.g., a dedicated gonic system group and user) with minimal filesystem write permissions.

  2. Isolate Environment via Containerization: Run Gonic inside an isolated container environment (e.g., Docker) without exposing root privileges (--user directive). Use read-only root filesystems where possible, mapping only the necessary data volumes for music and playlists. This ensures that even in the event of an arbitrary file write, the attacker cannot write to the real host's physical filesystems.

  3. Implement Web Application Firewall (WAF) Rules: Configure fronting reverse proxies or WAF layers to block requests to Subsonic playlist endpoints containing classic directory traversal syntax (../ or ..\) or absolute pathways in the request URL parameters.

Official Patches

sentrizOfficial Gonic release containing security fixes for the directory traversal issue.
sentrizGitHub Security Advisory detail sheet regarding CVE-2026-49340.

Technical Appendix

CVSS Score
8.1/ 10
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H
EPSS Probability
0.27%
Top 82% most exploited

Affected Systems

Gonic music streaming server instances prior to version 0.21.0

Affected Versions Detail

Product
Affected Versions
Fixed Version
gonic
sentriz
< 0.21.00.21.0
AttributeDetail
CWE IDCWE-22, CWE-697, CWE-732
Attack VectorNetwork (AV:N)
CVSS v3.1 Score8.1 (High)
Exploit Statuspoc
ImpactArbitrary File Write / Potential Remote Code Execution
Privileges RequiredLow (PR:L)
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1222File and Directory Permissions Modification
Defense Evasion
T1005Data from Local System
Collection
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

The application uses external input to construct a pathname that resolves outside of the restricted directory, paired with faulty logic comparison in checking execution permissions.

Vulnerability Timeline

CVE-2026-49340 published to CVE and NVD databases
2026-06-19
GitHub Security Advisory GHSA-4gxv-p5g5-j7w7 released by repository maintainers
2026-06-19
NVD finalizes CVSS scores and classifications
2026-06-23

References & Sources

  • [1]GitHub Security Advisory GHSA-4gxv-p5g5-j7w7
  • [2]Gonic Release tag v0.21.0
  • [3]Gonic GitHub Repository

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•2 days ago•CVE-2026-71556
7.1

CVE-2026-71556: Symbolic Link Directory Traversal in go-git

A symbolic link directory traversal vulnerability was identified in go-git, a pure Go implementation of the Git specification. This vulnerability allows an attacker to construct a repository that, when checked out or processed, bypasses directory boundaries to write or overwrite arbitrary files on the host filesystem.

Amit Schendel
Amit Schendel
14 views•5 min read
•3 days ago•CVE-2026-71557
6.3

CVE-2026-71557: Path Traversal and Configuration Overwrite in go-git Filesystem Storage Engine

CVE-2026-71557 is a path traversal vulnerability in go-git, a pure-Go implementation of Git. In vulnerable versions, the filesystem-backed storage engine fails to validate reference names before mapping them to on-disk paths. An attacker hosting a malicious Git server can advertise references containing directory traversal sequences, such as 'refs/heads/../../config', to write or overwrite files outside the intended reference storage directory.

Amit Schendel
Amit Schendel
10 views•7 min read
•3 days ago•GHSA-7C4V-FWGW-9RF7
5.3

GHSA-7c4v-fwgw-9rf7: Nuxt Dev Server Discloses Project Root and Workspace UUID via Chrome DevTools Endpoint

An information disclosure vulnerability in the Nuxt development server allows adjacent network attackers to retrieve the absolute project root directory and a persistent workspace UUID by querying the unprotected Chrome DevTools workspace endpoint. This occurs when the development server is bound to a network-reachable interface, allowing requests that bypass the header-based security verification checks.

Alon Barad
Alon Barad
11 views•7 min read
•3 days ago•CVE-2026-66062
5.3

CVE-2026-66062: Regular Expression Denial of Service (ReDoS) in SvelteKit Content Negotiation

A Regular Expression Denial of Service (ReDoS) vulnerability exists in SvelteKit's content negotiation header parser prior to version 2.70.2. An unauthenticated remote attacker can exploit this vulnerability by sending a crafted Accept header with highly repetitive malformed values. This triggers catastrophic backtracking on the single-threaded Node.js/Bun event loop, leading to CPU exhaustion and full denial of service.

Alon Barad
Alon Barad
8 views•6 min read
•3 days ago•CVE-2026-15895
8.4

CVE-2026-15895: OS Command Injection in AWS jsii-diff CLI

An OS command injection vulnerability exists in the npm package loading component of the jsii-diff CLI tool within the AWS jsii framework. Prior to version 1.131.0, when parsing package specifiers prefixed with `npm:`, the tool concatenated user-controlled inputs directly into a shell execution string via child_process.exec. This allows attackers to execute arbitrary shell commands under the context of the running Node.js process.

Amit Schendel
Amit Schendel
7 views•7 min read
•3 days ago•CVE-2026-63220
4.8

CVE-2026-63220: Trust of Untrusted Reverse Proxy Headers in CodeIgniter4

CodeIgniter4 versions prior to v4.7.4 contain a protocol-spoofing vulnerability due to improper verification of upstream reverse proxy forwarding headers. Remote, unauthenticated attackers can inject headers like X-Forwarded-Proto to deceive the framework into identifying an insecure HTTP request as a secure HTTPS connection.

Alon Barad
Alon Barad
14 views•7 min read