Vulnerabilities in pkg:golang/go.senan.xyz/gonic

PACKAGE
Advisory Identifier: GHSA-hmgp-w9jm-vp95
Advisory Summary

CVE-2026-49338 is a HIGH (CVSS 7.1) any authenticated user can delete vulnerability (CWE-639: Authorization Bypass Through User-Controlled Key) affecting Subsonic API libraries in the Go ecosystem. The issue involves any authenticated user can delete or read any other user's playlist (idor). Remediation is available by upgrading affected packages to version 0.21.0.

3 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/go.senan.xyz/gonic

3 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/go.senan.xyz/gonic. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-hmgp-w9jm-vp95 CVE-2026-49338 HIGH Subsonic API: any authenticated user can delete or read any other user's playlist (IDOR)
GHSA-2fp4-5v5c-4448 CVE-2026-49339 HIGH gonic: Path Traversal in playlist `id` bypasses ownership check, enabling any user to read/delete other users' playlists
GHSA-4gxv-p5g5-j7w7 CVE-2026-49340 HIGH gonic has arbitrary file write in createPlaylist: any authenticated user can write playlist M3U content to attacker-controlled path on the host

CVE-2026-49338 at a Glance

CVE Identifier CVE-2026-49338
GHSA Identifier GHSA-hmgp-w9jm-vp95
Severity HIGH
CVSS v3.1 Base Score 7.1
CWE Classification CWE-639: Authorization Bypass Through User-Controlled Key
Affected Product Subsonic API
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 7.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-49338

To remediate this vulnerability, upgrade all affected Subsonic API dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

go.senan.xyz/gonic fixed: 0.21.0
Upgrade go.senan.xyz/gonic to 0.21.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for go.senan.xyz/gonic

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-49338, inspect your project dependencies for Subsonic API:

inspect dependencies for go.senan.xyz/gonic

Analyze the terminal output to locate any version of Subsonic API in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.21.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-639: Authorization Bypass Through User-Controlled Key, where the system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data. In Subsonic API, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary In gonic, the Subsonic API endpoints `/rest/deletePlaylist.view` and `/rest/getPlaylist.view` perform no per-resource authorization. Once authenticated as *any* user (admin or not), an attacker can: 1. **Delete any playlist owned by any other user** (including admin) by passing its `id`. 2. **Read the full contents** (name, comment, song list) of any other user's **private** (non-public) playlist by passing its `id`. The Subsonic playlist `id` is `base64url("<userID>/<filename>.m3u")`. Because filenames are user-supplied or time-derived and the `userID` is a small integer, IDs are guessable and frequently exposed (e.g. a previously-public playlist that was later made private still has the same ID). This breaks the multi-user trust boundary of gonic: a low-privileged user can wipe an administrator's curated playlists, and a user can exfiltrate any private playlist they obtain an ID for. ## Status This was originally disclosed to the maintainer by email and has been **fixed in commit `6dd71e6a3c966867ef8c900d359a7df75789f410`** (`fix(subsonic): enforce playlist ownership on getPlaylist/deletePlaylist`, 2026-05-18). The fix has not yet been included in a tagged release; the latest tagged version `v0.20.1` is still vulnerable. Filing this advisory now that private vulnerability reporting is enabled on the repo, so the issue has a public record once the next release ships. ## Vulnerable code (pre-fix, at `v0.20.1` / commit `37090aa7`) **Delete IDOR** — `server/ctrlsubsonic/handlers_playlist.go` lines 177-187: ```go func (c *Controller) ServeDeletePlaylist(r *http.Request) *spec.Response { params := r.Context().Value(CtxParams).(params.Params) playlistID, err := params.GetFirstID("id", "playlistId") if err != nil { return spec.NewError(10, "please provide an `id` or `playlistId` parameter") } if err := c.playlistStore.Delete(playlistIDDecode(playlistID)); err != nil { return spec.NewError(0, "delete playlist: %v", err) } return spec.NewResponse() } ``` The handler never loads the playlist to check `playlist.UserID == user.ID`. Compare to `ServeUpdatePlaylist` (same file, line 138) which *does* perform this check. **Read IDOR** — `server/ctrlsubsonic/handlers_playlist.go` lines 51-68: ```go func (c *Controller) ServeGetPlaylist(r *http.Request) *spec.Response { params := r.Context().Value(CtxParams).(params.Params) playlistID, err := params.GetFirstID("id", "playlistId") if err != nil { return spec.NewError(10, "please provide an `id` parameter") } playlist, err := c.playlistStore.Read(playlistIDDecode(playlistID)) if err != nil { return spec.NewError(70, "playlist with id %s not found", playlistID) } // ... never checks playlist.UserID or playlist.IsPublic ... sub.Playlist = rendered return sub } ``` The listing endpoint `ServeGetPlaylists` (line 38) correctly filters by `playlist.UserID != user.ID && !playlist.IsPublic`, but the singular `getPlaylist` did not. ## Live PoC (passing Go test) A reproducer against the existing test fixture (`server/ctrlsubsonic`): ```go func TestIDOR_DeleteOtherUsersPlaylist(t *testing.T) { f := newFixture(t) victimRelPath := filepath.Join("1", "victim-private.m3u") _ = f.contr.playlistStore.Write(victimRelPath, &playlistp.Playlist{ UserID: f.admin.ID, Name: "victim-private", IsPublic: false, Items: []string{"/music/foo.flac"}, }) victimID := playlistIDEncode(victimRelPath).String() // f.alt is a non-admin, non-owner user body := f.query(t, f.contr.ServeDeletePlaylist, f.alt, url.Values{"id": {victimID}}) // Subsonic returns status="ok" and the file is gone. } ``` Test output: ``` --- PASS: TestIDOR_ReadOtherUsersPrivatePlaylist (0.07s) --- PASS: TestIDOR_DeleteOtherUsersPlaylist (0.07s) PASS ok go.senan.xyz/gonic/server/ctrlsubsonic 0.730s ``` ## Equivalent HTTP request ``` GET /rest/deletePlaylist.view?u=lowpriv&p=lowpriv&v=1&c=poc&f=json&id=cGwtMS1zaGFyZWQubTN1 ``` Response: `{"subsonic-response":{"status":"ok","version":"..."}}` — playlist is gone. ## Impact - **Integrity / Availability**: low-privileged users can delete any other user's playlists, including admin's curated lists. There is no undo. - **Confidentiality**: private playlists (including their comment fields) are readable by any authenticated user with an ID. IDs are predictable (`base64("<smallUserID>/<name>.m3u")`) and previously-public IDs persist after being marked private. - **Trust boundary**: gonic supports multiple users (`createUser`, non-admin role). This bug collapsed the user-to-user authorization model. ## Affected versions Latest tagged release `v0.20.1` and all prior versions back to when the playlist M3U store was introduced. Master HEAD is fixed at commit `6dd71e6a3c966867ef8c900d359a7df75789f410`. ## Suggested patch (applied by maintainer in `6dd71e6`) Load the playlist first and enforce ownership in both handlers: ```go // ServeGetPlaylist if playlist.UserID != user.ID && !playlist.IsPublic { return spec.NewError(50, "you aren't allowed to read that user's playlist") } // ServeDeletePlaylist if playlist.UserID != 0 && playlist.UserID != user.ID { return spec.NewError(50, "you aren't allowed to delete that user's playlist") } ``` This mirrors the existing ownership check already present in `ServeCreateOrUpdatePlaylist` (line 84) and `ServeUpdatePlaylist` (line 138). ## Credits Reported by Vishal Shukla ([@shukla304](https://github.com/shukla304) / [@therawdev](https://github.com/therawdev)).

CVE-2026-49338 Affected Subsonic API Versions

1 component(s)
Fixed Versions:
0.21.0
Product / Package Ecosystem Affected Versions Fixed Version
go.senan.xyz/gonic
Go
< 0.21.0
0.21.0

References

Frequently Asked Questions

What is CVE-2026-49338?
CVE-2026-49338 is a security vulnerability in Subsonic API involving any authenticated user can delete or read any other user's playlist (IDOR) under CWE-639: Authorization Bypass Through User-Controlled Key.
Which Subsonic API versions are affected?
Affected versions include releases prior to 0.21.0 across affected packages: go.senan.xyz/gonic.
What version fixes CVE-2026-49338?
Upgrading to 0.21.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is go.senan.xyz/gonic affected?
Yes, go.senan.xyz/gonic is affected in releases prior to 0.21.0. Upgrade your dependency to 0.21.0 or later.
What is the CVSS score of CVE-2026-49338?
CVE-2026-49338 has a CVSS v3.1 base score of 7.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N.
What CWE is associated with CVE-2026-49338?
CVE-2026-49338 is classified under CWE-639: Authorization Bypass Through User-Controlled Key (The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data.).
How can I check Go dependencies for CVE-2026-49338?
Run the dependency tree command: 'inspect dependencies for go.senan.xyz/gonic'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-hmgp-w9jm-vp95",
  "modified" : "2026-06-26T23:33:25Z",
  "published" : "2026-06-26T23:33:24Z",
  "aliases" : [ "CVE-2026-49338" ],
  "summary" : "Subsonic API: any authenticated user can delete or read any other user's playlist (IDOR)",
  "details" : "## Summary\n\nIn gonic, the Subsonic API endpoints `/rest/deletePlaylist.view` and `/rest/getPlaylist.view` perform no per-resource authorization. Once authenticated as *any* user (admin or not), an attacker can:\n\n1. **Delete any playlist owned by any other user** (including admin) by passing its `id`.\n2. **Read the full contents** (name, comment, song list) of any other user's **private** (non-public) playlist by passing its `id`.\n\nThe Subsonic playlist `id` is `base64url(\"<userID>/<filename>.m3u\")`. Because filenames are user-supplied or time-derived and the `userID` is a small integer, IDs are guessable and frequently exposed (e.g. a previously-public playlist that was later made private still has the same ID).\n\nThis breaks the multi-user trust boundary of gonic: a low-privileged user can wipe an administrator's curated playlists, and a user can exfiltrate any private playlist they obtain an ID for.\n\n## Status\n\nThis was originally disclosed to the maintainer by email and has been **fixed in commit `6dd71e6a3c966867ef8c900d359a7df75789f410`** (`fix(subsonic): enforce playlist ownership on getPlaylist/deletePlaylist`, 2026-05-18). The fix has not yet been included in a tagged release; the latest tagged version `v0.20.1` is still vulnerable. Filing this advisory now that private vulnerability reporting is enabled on the repo, so the issue has a public record once the next release ships.\n\n## Vulnerable code (pre-fix, at `v0.20.1` / commit `37090aa7`)\n\n**Delete IDOR** — `server/ctrlsubsonic/handlers_playlist.go` lines 177-187:\n\n```go\nfunc (c *Controller) ServeDeletePlaylist(r *http.Request) *spec.Response {\n    params := r.Context().Value(CtxParams).(params.Params)\n    playlistID, err := params.GetFirstID(\"id\", \"playlistId\")\n    if err != nil {\n        return spec.NewError(10, \"please provide an `id` or `playlistId` parameter\")\n    }\n    if err := c.playlistStore.Delete(playlistIDDecode(playlistID)); err != nil {\n        return spec.NewError(0, \"delete playlist: %v\", err)\n    }\n    return spec.NewResponse()\n}\n```\n\nThe handler never loads the playlist to check `playlist.UserID == user.ID`. Compare to `ServeUpdatePlaylist` (same file, line 138) which *does* perform this check.\n\n**Read IDOR** — `server/ctrlsubsonic/handlers_playlist.go` lines 51-68:\n\n```go\nfunc (c *Controller) ServeGetPlaylist(r *http.Request) *spec.Response {\n    params := r.Context().Value(CtxParams).(params.Params)\n    playlistID, err := params.GetFirstID(\"id\", \"playlistId\")\n    if err != nil {\n        return spec.NewError(10, \"please provide an `id` parameter\")\n    }\n    playlist, err := c.playlistStore.Read(playlistIDDecode(playlistID))\n    if err != nil {\n        return spec.NewError(70, \"playlist with id %s not found\", playlistID)\n    }\n    // ... never checks playlist.UserID or playlist.IsPublic ...\n    sub.Playlist = rendered\n    return sub\n}\n```\n\nThe listing endpoint `ServeGetPlaylists` (line 38) correctly filters by `playlist.UserID != user.ID && !playlist.IsPublic`, but the singular `getPlaylist` did not.\n\n## Live PoC (passing Go test)\n\nA reproducer against the existing test fixture (`server/ctrlsubsonic`):\n\n```go\nfunc TestIDOR_DeleteOtherUsersPlaylist(t *testing.T) {\n    f := newFixture(t)\n    victimRelPath := filepath.Join(\"1\", \"victim-private.m3u\")\n    _ = f.contr.playlistStore.Write(victimRelPath, &playlistp.Playlist{\n        UserID: f.admin.ID, Name: \"victim-private\", IsPublic: false,\n        Items: []string{\"/music/foo.flac\"},\n    })\n    victimID := playlistIDEncode(victimRelPath).String()\n    // f.alt is a non-admin, non-owner user\n    body := f.query(t, f.contr.ServeDeletePlaylist, f.alt, url.Values{\"id\": {victimID}})\n    // Subsonic returns status=\"ok\" and the file is gone.\n}\n```\n\nTest output:\n\n```\n--- PASS: TestIDOR_ReadOtherUsersPrivatePlaylist (0.07s)\n--- PASS: TestIDOR_DeleteOtherUsersPlaylist (0.07s)\nPASS\nok  go.senan.xyz/gonic/server/ctrlsubsonic 0.730s\n```\n\n## Equivalent HTTP request\n\n```\nGET /rest/deletePlaylist.view?u=lowpriv&p=lowpriv&v=1&c=poc&f=json&id=cGwtMS1zaGFyZWQubTN1\n```\n\nResponse: `{\"subsonic-response\":{\"status\":\"ok\",\"version\":\"...\"}}` — playlist is gone.\n\n## Impact\n\n- **Integrity / Availability**: low-privileged users can delete any other user's playlists, including admin's curated lists. There is no undo.\n- **Confidentiality**: private playlists (including their comment fields) are readable by any authenticated user with an ID. IDs are predictable (`base64(\"<smallUserID>/<name>.m3u\")`) and previously-public IDs persist after being marked private.\n- **Trust boundary**: gonic supports multiple users (`createUser`, non-admin role). This bug collapsed the user-to-user authorization model.\n\n## Affected versions\n\nLatest tagged release `v0.20.1` and all prior versions back to when the playlist M3U store was introduced. Master HEAD is fixed at commit `6dd71e6a3c966867ef8c900d359a7df75789f410`.\n\n## Suggested patch (applied by maintainer in `6dd71e6`)\n\nLoad the playlist first and enforce ownership in both handlers:\n\n```go\n// ServeGetPlaylist\nif playlist.UserID != user.ID && !playlist.IsPublic {\n    return spec.NewError(50, \"you aren't allowed to read that user's playlist\")\n}\n\n// ServeDeletePlaylist\nif playlist.UserID != 0 && playlist.UserID != user.ID {\n    return spec.NewError(50, \"you aren't allowed to delete that user's playlist\")\n}\n```\n\nThis mirrors the existing ownership check already present in `ServeCreateOrUpdatePlaylist` (line 84) and `ServeUpdatePlaylist` (line 138).\n\n## Credits\n\nReported by Vishal Shukla ([@shukla304](https://github.com/shukla304) / [@therawdev](https://github.com/therawdev)).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "go.senan.xyz/gonic"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.21.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.20.1"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/sentriz/gonic/security/advisories/GHSA-hmgp-w9jm-vp95"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-49338"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sentriz/gonic/commit/6dd71e6"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/sentriz/gonic"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-285", "CWE-639" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-26T23:33:24Z",
    "nvd_published_at" : "2026-06-19T19:16:36Z"
  }
}