Repository navigation
Studio: open http(s): source links without slashes as web links; flag Windows theme downloads - #13195
Merged
Merged
Conversation
…ation URLs; treat Windows theme and search-connector files as dangerous
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
danielhanchen
pushed a commit
to danielhanchen/unsloth-staging-2
that referenced
this pull request
Oct 10, 2026
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
shimmyshimmer
pushed a commit
to shimmyshimmer/unsloth-staging-4
that referenced
this pull request
Oct 19, 2026
… ignore the dev Studio home (unslothai#14190) Three small hardenings from a re-check of the security scan backlog. Each was approved in an earlier triage round and had not landed. No visible change for normal use. 1. **`//host` links open as web links** (`studio/frontend/src/lib/open-link.ts`). `openLink` treated a protocol-relative href (`//evil.example/x`, or the backslash forms browsers read the same way) as a path inside Studio and let native navigation run, which replaced Studio's page, and in Desktop the main window, with another site. unslothai#13195 covered `https:host` without slashes; this covers `//host`. It is rewritten to `https://host/...` and opened like any other web link (browser panel or a new tab). Relative paths, anchors and ordinary links are unchanged. 2. **The Desktop elevated Linux install runs `/usr/bin/apt-get` by absolute path** (`studio/src-tauri/src/install.rs`). The code already checks that `/usr/bin/apt-get` exists, then ran `apt-get update` and `apt-get install` by bare name under elevation. Both now use the checked path, as `debian_update.rs` already does. 3. **`/.studio/` is ignored by git** (`.gitignore`). The README's dev install keeps the Studio home in the checkout (`UNSLOTH_STUDIO_HOME="$PWD/.studio"`). Only `auth.db` was ignored, so `git add .` would stage `studio.db` (chats, saved connections), `auth/`, `accounts/`, the venv and caches. Tests: - `studio/frontend/tests/open-link-scheme-without-slashes.test.ts`: `//host` and the backslash forms open as `https://host/...` (fails on main); the existing cases still pass. Related link tests pass (32), `tsc` and `eslint` clean. - `tests/test_installer_elevation_report.py`: no bare `apt-get` command in `install.rs`, and the README's dev Studio home is ignored. `cargo check --locked` for Desktop passes on Linux. ### Before / after A web-search source chip whose stored URL is `//host/landing` (a local landing page), clicked in a chat. Markdown links are already normalised by the renderer, so a source chip is where a `//host` href reaches `openLink`. Before: Studio's page is replaced by the landing page. After: Studio stays on the chat and the link opens as a web link in a new tab. 
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.
Two frontend fixes from the latest security scan. Ordinary links, citations and downloads behave the same.
Source chips with an
http(s):hostURL no longer replace Studio's page (lib/open-link.ts,features/chat/utils/document-citation-source.ts).parseSourcesFromResultreads theURL:lines of a search result, which a search snippet can inject. Its validator acceptedhttps:evil.exampleandhttps:+ tab +//evil.examplebecause the URL parser reads both as absolute, but it returned the raw string.openLinktreats any href without a literal://as app-relative and lets the browser navigate natively. So clicking such a chip replaced Studio's page:https:on a localhttp://Studio, or any scheme in the Desktop main window, which has no navigation allowlist);openLinkstrips tabs and newlines the way the URL parser does. Anhttp(s):link without slashes is turned into its parsed form and opened like any other web link, in the browser panel or externally. The validator now returns the parsed URL, so new chips storehttps://....https://links behave as before.Before and after, Studio web UI, clicking a source chip whose URL is
http:127.0.0.1:<port>/landing. Before, the page is replaced (Page not found, conversation gone). After, Studio stays on the chat and the landing page opens as a web link.Windows theme and search-connector files count as dangerous downloads (
features/browser/dangerous-file-types.json, shared with the Tauri download check). The list already coveredlibrary-ms,search-ms,scf,urlandlnk.theme,themepack,deskthemepackandsearchconnector-mswere missing. Opening a crafted one makes Windows connect to an attacker's SMB share and leak the user's NTLM hash. They now get the existing dangerous-download treatment.Tests:
tests/open-link-scheme-without-slashes.test.tschecks:https:host, tab-split and upper-case forms open as web links;tests/download-safety-windows-shell-types.test.ts.tsc --noEmitis clean.