Visual Studio Code Restricted Mode bypass via nested configuration objects
High7.8CVE-2026-70334 · Published Sep 8, 2026
## Impact A security feature bypass vulnerability exists in Visual Studio Code 1.136.1 and earlier versions. A restricted setting specified in a workspace's `.vscode/settings.json` using nested-object form could take effect even when the workspace was open in Restricted Mode. For example: ```json { "terminal": { "integrated": { "allowInUntrustedWorkspace": true } } } ``` Visual Studio Code's Workspace Trust filtering checked the raw top-level JSON key against the configuration registry. As a result, it correctly rejected the equivalent dotted setting: ```json { "terminal.integrated.allowInUntrustedWorkspace": true } ``` However, it did not recognize the nested-object form as the same restricted setting. An attacker could convince a user to open a specially crafted workspace containing restricted settings expressed in nested-object form. Those settings could then be applied without the user granting trust, bypassing Workspace Trust protections and potentially allowing commands or code to execute in the context of the user. ## Patches The fix is available starting with Visual Studio Code 1.136.2. The fix ([0684cb5](https://github.com/microsoft/vscode/comm...
Affected versions
| Package | Affected | Fixed in |
|---|---|---|
| Visual Studio Code Product | < 1.136.2 | 1.136.2 |
Details and references
## Impact A security feature bypass vulnerability exists in Visual Studio Code 1.136.1 and earlier versions. A restricted setting specified in a workspace's `.vscode/settings.json` using nested-object form could take effect even when the workspace was open in Restricted Mode. For example: ```json { "terminal": { "integrated": { "allowInUntrustedWorkspace": true } } } ``` Visual Studio Code's Workspace Trust filtering checked the raw top-level JSON key against the configuration registry. As a result, it correctly rejected the equivalent dotted setting: ```json { "terminal.integrated.allowInUntrustedWorkspace": true } ``` However, it did not recognize the nested-object form as the same restricted setting. An attacker could convince a user to open a specially crafted workspace containing restricted settings expressed in nested-object form. Those settings could then be applied without the user granting trust, bypassing Workspace Trust protections and potentially allowing commands or code to execute in the context of the user. ## Patches The fix is available starting with Visual Studio Code 1.136.2. The fix ([0684cb5](https://github.com/microsoft/vscode/commit/0684cb5905a3f23156f45a28135326e09310ff4d)) recursively walks nested configuration objects and resolves each setting against the configuration registry using its effective dotted path. Restricted settings are therefore filtered consistently whether they are expressed in dotted or nested form. Users should update to Visual Studio Code 1.136.2 or later. ## Workarounds Do not open workspaces from untrusted sources. Keep Workspace Trust enabled and do not grant trust to an unfamiliar workspace. These precautions reduce exposure but are not a substitute for updating Visual Studio Code. ## References [Visual Studio Code issue #335112](https://github.com/microsoft/vscode/issues/335112) [Fix commit 0684cb5](https://github.com/microsoft/vscode/commit/0684cb5905a3f23156f45a28135326e09310ff4d) [MSRC entry for CVE-2026-70334](https://msrc.microsoft.com/update-guide/vulnerability/CVE-2026-70334) [Visual Studio Code Workspace Trust documentation](https://code.visualstudio.com/docs/editor/workspace-trust)
- CVSS 3.1
- CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- Severity from
- GitHub (reviewed advisory)
- Weakness
- CWE-184
More Microsoft advisories
All Microsoft| Date | Advisory | Severity | Fixed in |
|---|---|---|---|
| Sep 8 | Microsoft Skype for Business: spoofing | High8.3 | 6.0.9319.885+2 more |
| Sep 8 | Microsoft Skype for Business: cross-site scripting | Medium6.5 | 6.0.9319.885+2 more |
| Sep 8 | Microsoft Skype for Business: spoofing | High7.1 | 6.0.9319.885+2 more |
| Sep 8 | Microsoft Skype for Business: information disclosure | Medium6.5 | 6.0.9319.885+2 more |
| Sep 8 | Microsoft Skype for Business: integer overflow | High7.5 | 6.0.9319.885+2 more |
| Sep 8 | Microsoft Skype for Business: out-of-bounds read | Medium6.5 | 6.0.9319.885+2 more |