Skip to content

Support Restricted Mode (untrusted workspaces) - #133

Open
RByers wants to merge 1 commit into
jonaraphael:mainfrom
RByers:restricted-mode
Open

RByers wants to merge 1 commit into
jonaraphael:mainfrom
RByers:restricted-mode

Conversation

@RByers

@RByers RByers commented Nov 8, 2026 •

Copy link
Copy Markdown

Without a capabilities.untrustedWorkspaces declaration, VS Code disables
the extension in Restricted Mode. Declare full support: the extension
never runs workspace code.

What an untrusted workspace can still control is its settings, and two of
them were interpolated raw into the webview's <style> block. csv.cellPadding
went in unchecked, and the font family fell back to editor.fontFamily
(workspace-settable) with only \ and " escaped. Either could close the

<style> element and inject markup, such as an https: image beacon, which the CSP allows. wrapHtml now sanitizes the font family, font size and cell padding itself, so every render path is covered.

Without a capabilities.untrustedWorkspaces declaration, VS Code disables
the extension in Restricted Mode. Declare full support: the extension
never runs workspace code.

What an untrusted workspace can still control is its settings, and two of
them were interpolated raw into the webview's <style> block. csv.cellPadding
went in unchecked, and the font family fell back to editor.fontFamily
(workspace-settable) with only \ and " escaped. Either could close the
<style> element and inject markup, such as an https: image beacon, which
the CSP allows. wrapHtml now sanitizes the font family, font size and cell
padding itself, so every render path is covered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@RByers

RByers commented Nov 8, 2026

Copy link
Copy Markdown
Author

Note sure if you'd want this or not, but I sure find it handy to be able to edit CSV files in untrusted repos (a bit paranoid of my agents!). I only lightly reviewed the test and don't personally have a good handle on your test conventions - sorry if it's a bit slop!

This branch has not been deployed

No deployments
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