Bug 443590 - There's no way with LSP client plugin to avoid language server in untrusted projects
Summary: There's no way with LSP client plugin to avoid language server in untrusted p...
Status: RESOLVED WORKSFORME
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 21.08.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-11 11:50 UTC by Denis Lisov
Modified: 2021-12-07 05:46 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Denis Lisov 2021-10-11 11:50:38 UTC
Some language servers / ecosystems run unsandboxed code by default. One example here is Rust's RLS and rust-analyzer servers because compiling dependencies may require calling build scripts or procedural macros. A malicious developer can create a repository that, when a language server is started for it, executes arbitrary malicious code on the developer's machine without any sandbox (or, best case, in Kate's sandbox if there's one).

At the moment there's no nice way to use language server in trusted projects, but still be able to open a random cloned repository with Kate without this risk. Ideally a user should be able to open projects as untrusted by default, and only enable the language server if they mark the project as trusted. Notably, this mark should be local so that a malicious repository cannot mark itself trusted.
Comment 1 Denis Lisov 2021-10-11 19:31:07 UTC
Update: I've been told that the list of enabled plugins is a per-session setting, so one way available today is to leave it disabled in the default session, but enable in sessions used for my projects. One problem with this is that currently opening a file externally (with "Open in Kate" or xdg-open) opens it in whatever session is currently open instead of starting an instance in default session.