Skip to content

fix: validate URL scheme before openExternal in linkifier#11291

Open
uadhran wants to merge 1 commit into
Eugeny:masterfrom
uadhran:fix/linkifier-open-external-scheme-validation
Open

fix: validate URL scheme before openExternal in linkifier#11291
uadhran wants to merge 1 commit into
Eugeny:masterfrom
uadhran:fix/linkifier-open-external-scheme-validation

Conversation

@uadhran
Copy link
Copy Markdown
Contributor

@uadhran uadhran commented May 18, 2026

Security Fix

Severity: Medium

The linkifier URLHandler and xterm built-in linkHandler called openExternal() with any URL matched from terminal output, without validating the scheme. The URL regex accepts any 3-9 letter scheme, so a malicious SSH server could print a file://, data:, or custom protocol URL and have it opened when the user clicks it.

Fix

Added an allowlist check (http, https, ftp, mailto, ssh) in both call sites before invoking openExternal().

Files changed:

  • tabby-linkifier/src/handlers.ts — URLHandler.handle()
  • tabby-linkifier/src/decorator.ts — xterm linkHandler.activate

Note: IPHandler (prepends http://) and BaseFileHandler (prepends file://) are intentional and unchanged.

Terminal output matching the URL regex could contain arbitrary schemes
(file://, data:, javascript:, custom protocol handlers). Added an
allowlist check (http/https/ftp/mailto/ssh) in both the URLHandler and
xterm's built-in linkHandler before calling openExternal().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant