-
Notifications
You must be signed in to change notification settings - Fork 767
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
settings: require explicit user action before using workspace/folder settings #1094
Comments
Change https://golang.org/cl/283256 mentions this issue: |
Change https://golang.org/cl/283253 mentions this issue: |
Change https://golang.org/cl/283257 mentions this issue: |
Change https://golang.org/cl/283255 mentions this issue: |
…ings Configuration's get returns the 'go' section of the vscode settings. This wraps the vscode.WorkspaceConfiguration object that would be returned by vscode.workspace.getConfiguration, but this prevents it from returning values from the workspace/workspaceFolder level settings if the queried key is security-sensitive - e.g. use of workspace level settings from the untrusted repository may result in arbitrary binary execution. This CL does not use the new Configuration from the extension yet. For #1094 Change-Id: Ia75389032dfaec300506b26ab839b173ff9e5557 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/283253 Trust: Hyang-Ah Hana Kim <hyangah@gmail.com> Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Suzy Mueller <suzmue@golang.org>
And let them use the new Configuration class For #1094 Change-Id: I96d0cc32b6499e59d1062c2b04031bc675703a24 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/283255 Trust: Hyang-Ah Hana Kim <hyangah@gmail.com> Reviewed-by: Suzy Mueller <suzmue@golang.org>
Also add 'go.inferGopath' to the dangerous setting list. For #1094 Change-Id: If5c936d6a875b92aef6d8368e14d02c66bbae7ce Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/283256 Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Trust: Hyang-Ah Hana Kim <hyangah@gmail.com> Reviewed-by: Suzy Mueller <suzmue@golang.org>
…pace And initialize the default config object when the module loads, and reuse it. For #1094 Change-Id: Ia80d703487f6a717dc7aed6d52baeb73c4b49707 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/283257 Trust: Hyang-Ah Hana Kim <hyangah@gmail.com> Reviewed-by: Suzy Mueller <suzmue@golang.org>
v0.21.0 is out. |
Change https://golang.org/cl/300289 mentions this issue: |
For #1094 Change-Id: Ibe4c405271404ff08200ab6f5d5afcc2a4e162e6 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/300289 Trust: Hyang-Ah Hana Kim <hyangah@gmail.com> Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Suzy Mueller <suzmue@golang.org>
Many of VS Code Go settings are defined as
resource
ormachine-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:
typescript.tsdk
has been switched to ignore the workspace-level setting by default in 2017 (typescript.tsdk "must be a user setting" microsoft/vscode#19451)python.pythonPath
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:
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
.The text was updated successfully, but these errors were encountered: