Security fixes: path traversal, filename injection, input validation, error leakage#204
Draft
Copilot wants to merge 25 commits intodevelopmentfrom
Draft
Security fixes: path traversal, filename injection, input validation, error leakage#204Copilot wants to merge 25 commits intodevelopmentfrom
Copilot wants to merge 25 commits intodevelopmentfrom
Conversation
Prisma bricked itself (again)
Resolves #200 (I hope this works)
…alidation, error leakage Co-authored-by: SvenFinn <77897281+SvenFinn@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Review project for feedback and improvements
Security fixes: path traversal, filename injection, input validation, error leakage
Mar 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Several security and correctness issues found across the API servers during project review.
screens/images— Path Traversal & Filename Injectionpath.includes("..")guards withresolveSafePath()usingpath.resolve()+ prefix check againstbasePath. The old check is bypassable via encoded sequences, symlinks, or null bytes.sanitizeFileName()usingpath.basename()+ null-byte stripping on uploaded filenames. A filename like../../etc/cron.d/evilwould previously write outside the upload root.screens/screenManager— Input Validation & Error LeakagePUT /api/screens/:screenIdnow validatesreq.bodywithisDbScreen()before spreading into the Prisma upsert — consistent with howPOST /api/screensalready handles this./api/screens/resolvewas sending`Internal server error: ${error}`to clients. Now logs server-side and returns a generic message.res.end()calls afterres.send()in/nextand/previoushandlers.ranges/merge— Body Parsing & Crash on Malformed Inputexpress.json()middleware. The server had no body parser, soparseInt(req.body)inPOST /api/ranges/known/:rangeMacalways returnedNaN— the endpoint was effectively broken.parseInt(req.body)→parseInt(req.body?.rangeId).JSON.parse(handshakeRanges)in try-catch; malformed JSON in the WebSocket handshake query previously threw an uncaught exception.Original prompt
⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.