fix(raycast): only offer http(s) URLs from server-controlled metadata - #1585
Open
Sravanjangam wants to merge 1 commit into
Open
fix(raycast): only offer http(s) URLs from server-controlled metadata#1585Sravanjangam wants to merge 1 commit into
Sravanjangam wants to merge 1 commit into
Conversation
metadata.url arrives from the API and can originate in third-party ingested content shared into a container. extractUrl now parses the value and only returns it for https:/http: schemes, so javascript:, file:, and arbitrary app-handler URLs never reach Action.OpenInBrowser and the OS opener.
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.
Hi supermemory team 👋 Thanks for building such a great product! While running a security & quality audit of the repo we hit this issue and put together a small, tested fix — details below.
Problem
apps/raycast-extension/src/search-memories.tsxpassed server-controlledmetadata.url— which originates from ingested third-party content — straight toAction.OpenInBrowserwith no scheme check. A crafted memory document could surfacejavascript:,file:, or custom app-handler schemes as clickable actions in Raycast.Part of #1578 (finding M10).
Solution
Parse with
new URL()and offer onlyhttps:/http:targets as browser actions; anything else is dropped from the action list rather than crashing the result view.Changes
search-memories.tsx→ newextractUrl()helper: https/http-only via URL parsing, used by the action listVerification
Biome clean on the touched file (fresh from branch). Note: this package defines no test runner or typecheck gate upstream;
tsc --noEmitfails identically on cleanmainin this workspace because@raycast/*dependencies aren't installed — baseline parity confirmed, zero errors attributable to this diff.Happy to iterate on any of this — feedback and reworks very welcome! 🙏
Environment
fix/raycast-url-allowlist— all gates re-run fresh at commit4c5754de473d