mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #8936] [MERGED] fix(server): play local music files only from the Music DJ folders #8896
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#8896
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8936
Author: @SpicyMarinara
Created: 11/7/2026
Status: ✅ Merged
Merged: 11/7/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/local-music-file-scope📝 Commits (3)
520250afix(server): play local music files only from the Music DJ folders (#8915)0627d75fix(server): stream the music file that passed the folder checkeefb9e4fix(server): a failed music folder recheck is a logged server error, not a silent 404📊 Changes
3 files changed (+260 additions, -6 deletions)
View changed files
📝
packages/server/src/routes/game-assets.routes.ts(+76 -6)📝
packages/shared/src/utils/music-dj-folder.ts(+16 -0)➕
scripts/regressions/local-music-file-security.regression.ts(+168 -0)📄 Description
Linked issue
Closes #8915
Why this change
GET /api/game-assets/local-music-fileserved any file with an audio extension, anywhere on the server's device, to anyone with privileged access. It only checked the extension and that the path was a file. It never checked that the file sits in a folder the Music DJ was told to play from: the default device folder, a character's folder or a chat's folder (#8901/#8914). Its only legitimate callers are the Music DJ's ownlocal-music:paths and the floating player.What changed
packages/shared/src/utils/music-dj-folder.ts:listMusicDjFolders(settings, chatMetadata)lists every folder the Music DJ can play from: the default folder (including the olderlocalMusicExternalFolderkey), every character folder and every chat folder. It reuses the file's existing readers.packages/server/src/routes/game-assets.routes.ts:spotifyrow generation uses) and the chats' folders...and Windows short names. Containment is then checked with the existingisCanonicalMediaPathInsideRoot, which ignores case on Windows.404 { error: "Music file not found" }as a missing file, so the route can't be used to probe which files exist. The privileged gate and the other errors are unchanged.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Run by the agent (not a substitute for the boxes above):
pnpm check: exit 0.scripts/regressions/local-music-file-security.regression.ts, run against the real app (node scripts/run-regressions.mjs --filter …): 1/1...;--filter security(34/34),--filter music-dj,--filter local-musicand--filter game-assets: pass.Still to verify by hand:
Docs and release impact
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
[PR #8936] fix(server): play local music files only from the Music DJ foldersto [PR #8936] [MERGED] fix(server): play local music files only from the Music DJ folders