Repository navigation
FIX: Validate API local media paths against results storage - #3061
Open
Richard Lundeen (richlundeen) wants to merge 2 commits into
Open
Richard Lundeen (richlundeen) wants to merge 2 commits into
Richard Lundeen (richlundeen) wants to merge 2 commits into
Conversation
Reuse the media route's canonical containment check for preview and message inputs. Validate original and converted media, reject incomplete media references, and keep URLs, uploads, and converter outputs unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 59fd033b-89ce-4424-b418-510b8144b8c8
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 59fd033b-89ce-4424-b418-510b8144b8c8
This branch has not been deployed
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.
Description
API media preparation could accept a local file, or extract one from
/api/media?path=..., thatGET /api/mediawould reject. This let preview or message preparation read files outside the allowed media directories.Move the existing canonical-path containment check into the shared backend media persistence service. Client-supplied local media must resolve into
prompt-memory-entriesorseed-prompt-entriesunder the configured results directory. Apply the check to preview, original and converted message values, and prepended history before conversion or target I/O. Reject media references without a path, and prevent similar/api/media-prefixed file names from bypassing the local-path check.Keep the existing
GET /api/mediastatus codes and rendering/download behavior. Preserve HTTP(S) URLs, base64/data URI uploads, managed references, and converter-generated outputs. This is an API input check, not a new SDK path or URL policy. No dependency oruv.lockchanges.