Auto-Approved File Write via Unconfirmed Environment-Variable Path Redirection
LowCVE-2026-45482 · Published Jun 9, 2026
## VS Code - Security Feature Bypass Vulnerability A security feature bypass vulnerability exists in VS Code where the terminal command auto-approval logic could approve a file-write redirection to a path that escapes the expected workspace scope. The guard that blocks redirection to non-absolute destinations accounted for POSIX tilde/home expansion (`~`) but not Windows environment-variable expansion (`%`). Paths such as `%APPDATA%\file.txt` or `%HOME%/file.txt` are not classified as absolute by `posix.isAbsolute` or `win32.isAbsolute`, so a command redirecting output to one of them could be auto-approved and write to a sensitive, user-controlled location without explicit user confirmation. ### Patches The fix extends the redirection guard to also block auto-approval when the destination path contains `%` (Windows environment-variable expansion), in addition to the existing `~` handling, and adds regression tests for both bash and pwsh. ### Workarounds Avoid enabling terminal command auto-approval, or set `chat.tools.terminal.autoApprove` / the file-write blocking setting so that detected file writes are always blocked. ### References - The patch for this can be found at ht...
Affected versions
| Package | Affected | Fixed in |
|---|---|---|
| vscode Product | < 1.123.1 | 1.123.1 |
Details and references
## VS Code - Security Feature Bypass Vulnerability A security feature bypass vulnerability exists in VS Code where the terminal command auto-approval logic could approve a file-write redirection to a path that escapes the expected workspace scope. The guard that blocks redirection to non-absolute destinations accounted for POSIX tilde/home expansion (`~`) but not Windows environment-variable expansion (`%`). Paths such as `%APPDATA%\file.txt` or `%HOME%/file.txt` are not classified as absolute by `posix.isAbsolute` or `win32.isAbsolute`, so a command redirecting output to one of them could be auto-approved and write to a sensitive, user-controlled location without explicit user confirmation. ### Patches The fix extends the redirection guard to also block auto-approval when the destination path contains `%` (Windows environment-variable expansion), in addition to the existing `~` handling, and adds regression tests for both bash and pwsh. ### Workarounds Avoid enabling terminal command auto-approval, or set `chat.tools.terminal.autoApprove` / the file-write blocking setting so that detected file writes are always blocked. ### References - The patch for this can be found at https://github.com/microsoft/vscode/pull/320676 - An issue for this can be found at [#320660](https://github.com/microsoft/vscode/issues/320660) - MSRC details for this can be found at https://msrc.microsoft.com/update-guide/vulnerability/CVE-2026-45482
- Severity from
- GitHub (reviewed advisory)
More Microsoft advisories
All Microsoft| Date | Advisory | Severity | Fixed in |
|---|---|---|---|
| Jul 2 | Microsoft 365 Copilot: open redirect | Critical9.3 | No fix yet |
| Jul 2 | Microsoft Azure Synapse: improper access control | Medium4.8 | No fix yet |
| Jul 1 | Microsoft Edge (Chromium-based): use after free | High8.3 | 149.0.4022.68 |
| Jun 9 | GitHubCredentialProvider - Regex substring host match sends Basic-auth tokens | High | 1.123.1 |
| Jun 9 | Path traversal in profile snippets import allows writing files outside the profile directory (Zip-Slip) | Medium | 1.123.1 |
| Jun 9 | Unconfirmed Remote Host Connection via Workspace File | High | 1.123.1 |