Skip to content

Explicitly declare VS Code extension workspace trust capabilities#3087

Closed
samwgoldman wants to merge 1 commit intomainfrom
security-improvement
Closed

Explicitly declare VS Code extension workspace trust capabilities#3087
samwgoldman wants to merge 1 commit intomainfrom
security-improvement

Conversation

@samwgoldman
Copy link
Copy Markdown
Member

The extension already does not run in untrusted workspaces and lspPath can already be overridden in trusted workspaces. These changes make that behavior explicit by declaring untrustedWorkspaces support as disabled via the capabilities API and adding machine-overridable scope to the lspPath and lspArguments settings.

Test Plan

Confirmed that we get a dialog when opening an untrusted workspace:
Screenshot 2026-04-09 at 11 04 00 AM

In an untrusted workspace, the settings.json is not used (Pyrefly is not enabled at all), no PWNED file:
Screenshot 2026-04-09 at 11 22 49 AM

The Extension summary includes the description of why restricted mode is not supported:
Screenshot 2026-04-09 at 11 34 14 AM

In trusted mode, a malicious actor can still cause point lspPath to a malicious binary. This is the same as rust-analyzer and TypeScript extensions.
Screenshot 2026-04-09 at 11 43 05 AM

The extension already does not run in untrusted workspaces and lspPath
can already be overridden in trusted workspaces. These changes make
that behavior explicit by declaring untrustedWorkspaces support as
disabled via the capabilities API and adding machine-overridable scope
to the lspPath and lspArguments settings.
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync bot commented Apr 9, 2026

@samwgoldman has imported this pull request. If you are a Meta employee, you can view this in D100202731.

Copy link
Copy Markdown
Contributor

@grievejia grievejia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@meta-codesync meta-codesync bot closed this in 9e3779b Apr 9, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync bot commented Apr 9, 2026

@samwgoldman merged this pull request in 9e3779b.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants