Skip to content

settings: require explicit user action before using workspace/folder settings #1094

Closed
@hyangah

Description

@hyangah

Many of VS Code Go settings are defined as resource or machine-overridable scope configuration, which means they can be specified in the workspace or folder levels. Some of the settings, for example, "go.goroot", "go.alternateTools", "go.gopath", "go.toolsGopath", "go.inferGopath", ... can affect the location of tools and binaries the extension runs. While this is convenient (*), it also can be exploited to run any binaries on users' machines once if the users are tricked to check out a random repository with workspace settings and open it with vscode.

This vulnerability issue around workspace/folder level settings is not new:

While hoping to have a unified approach for this class of issues eventually, we want to address this issue from our extension now.

When opening workspace/folder-level configuration for those settings, the extension will ignore them by default and warn users. If users trust the workspace, they can explicitly tell the extension by running a command.

The affected settings (**) are:

  • go.goroot
  • go.gopath
  • go.toolsGopath
  • go.inferGopath
  • go.alternateTools
  • go.toolsEnvVars

cc @FiloSottile @rsc @suzmue @pjweinb @stamblerre

*: when we previously tried to convert some of those settings to machine scope ones for different reasons, the change broke many users' workflow and had to be reverted.
**: should we include all the settings by default to be safe? (there could be more settings that can be potentially exploitable...)
We will consider adding restrictions to additional settings like go.testOnSave.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions