fix(lib-vuetify): only follow http(s) chat links, open other origins in a new tab - #72
Merged
Merged
Conversation
…in a new tab The navigate handler assigned the raw href of a link clicked in the chat to the host page's location: a javascript: URL (its origin is "null", so it took the external branch) would run in the host page with the user's session, and an off-site link planted in the conversation replaced the host page in one click. Only sanitize-html in the chat markdown stood in the way. Anything but an http(s) URL is now ignored, and another origin opens in a new tab without an opener. The evaluator page gets the same scheme check. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Harden how links written by the model in chat are followed:
lib-vuetify) only acts onhttp(s)links.javascript:,data:,vbscript:and malformed hrefs are ignored instead of being assigned towindow.location.noopener,noreferrer) instead of replacing the host page. Same-origin links still use in-SPA navigation, or a full page load when no route matches.http(s)filter.Why: the href is model output, so a page or tool result can influence it. Before this change, a
javascript:link would run in the host page with the user's session, and a cross-origin link could silently replace the host page with a look-alike.Heads-up:
window.openruns in the host'spostMessagehandler, relying on the click's user activation reaching the parent frame. Check that popup blockers allow it in Firefox and Safari.NavDecision.spais replaced byaction.link-utilsis not re-exported from the package index, so only deep imports are affected.